- 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.
Этот коммит содержится в:
родитель
aadf1add6c
Коммит
1b8d0cf146
@ -29,9 +29,10 @@ AC_DEFUN([OPAL_CHECK_COMPILER], [
|
|||||||
lower=m4_tolower($1)
|
lower=m4_tolower($1)
|
||||||
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
|
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
|
||||||
[
|
[
|
||||||
CPPFLAGS_orig=$CPPFLAGS
|
if test "$cross_compiling" != "yes" ; then
|
||||||
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
|
CPPFLAGS_orig=$CPPFLAGS
|
||||||
AC_TRY_RUN([
|
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
|
||||||
|
AC_TRY_RUN([
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
|
#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);
|
fprintf (f, "%d", PLATFORM_COMPILER_$1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
], [
|
], [
|
||||||
eval opal_cv_compiler_$1=`cat conftestval`;
|
eval opal_cv_compiler_$1=`cat conftestval`;
|
||||||
], [
|
], [
|
||||||
eval opal_cv_compiler_$1=0
|
eval opal_cv_compiler_$1=0
|
||||||
])
|
])
|
||||||
CPPFLAGS=$CPPFLAGS_orig
|
CPPFLAGS=$CPPFLAGS_orig
|
||||||
|
else
|
||||||
|
opal_cv_compiler_$1=0
|
||||||
|
fi
|
||||||
])
|
])
|
||||||
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
|
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
|
||||||
[The compiler $lower which OMPI was built with])
|
[The compiler $lower which OMPI was built with])
|
||||||
@ -60,9 +64,10 @@ AC_DEFUN([OPAL_CHECK_COMPILER_STRINGIFY], [
|
|||||||
lower=m4_tolower($1)
|
lower=m4_tolower($1)
|
||||||
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
|
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
|
||||||
[
|
[
|
||||||
CPPFLAGS_orig=$CPPFLAGS
|
if test "$cross_compiling" != "yes" ; then
|
||||||
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
|
CPPFLAGS_orig=$CPPFLAGS
|
||||||
AC_TRY_RUN([
|
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
|
||||||
|
AC_TRY_RUN([
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
|
#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));
|
fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
], [
|
], [
|
||||||
eval opal_cv_compiler_$1=`cat conftestval`;
|
eval opal_cv_compiler_$1=`cat conftestval`;
|
||||||
], [
|
], [
|
||||||
eval opal_cv_compiler_$1=UNKNOWN
|
eval opal_cv_compiler_$1=UNKNOWN
|
||||||
])
|
])
|
||||||
CPPFLAGS=$CPPFLAGS_orig
|
CPPFLAGS=$CPPFLAGS_orig
|
||||||
|
else
|
||||||
|
opal_cv_compiler_$1=UNKNOWN
|
||||||
|
fi
|
||||||
])
|
])
|
||||||
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
|
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
|
||||||
[The compiler $lower which OMPI was built with])
|
[The compiler $lower which OMPI was built with])
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user