1
1

- AC_TRY_RUN does not work in case of cross-compilation environments.

Tests based on preprocessor CPP output, won't help either, as they
   don't spit out nice computed numerical values, but rather the
   #define itselve.

This commit was SVN r21364.
Этот коммит содержится в:
Rainer Keller 2009-06-04 13:00:16 +00:00
родитель aadf1add6c
Коммит 1b8d0cf146

Просмотреть файл

@ -29,9 +29,10 @@ AC_DEFUN([OPAL_CHECK_COMPILER], [
lower=m4_tolower($1)
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
[
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
if test "$cross_compiling" != "yes" ; then
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
@ -44,12 +45,15 @@ int main (int argc, char * argv[])
fprintf (f, "%d", PLATFORM_COMPILER_$1);
return 0;
}
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=0
])
CPPFLAGS=$CPPFLAGS_orig
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=0
])
CPPFLAGS=$CPPFLAGS_orig
else
opal_cv_compiler_$1=0
fi
])
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
[The compiler $lower which OMPI was built with])
@ -60,9 +64,10 @@ AC_DEFUN([OPAL_CHECK_COMPILER_STRINGIFY], [
lower=m4_tolower($1)
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
[
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
if test "$cross_compiling" != "yes" ; then
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
@ -75,12 +80,15 @@ int main (int argc, char * argv[])
fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1));
return 0;
}
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=UNKNOWN
])
CPPFLAGS=$CPPFLAGS_orig
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=UNKNOWN
])
CPPFLAGS=$CPPFLAGS_orig
else
opal_cv_compiler_$1=UNKNOWN
fi
])
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
[The compiler $lower which OMPI was built with])