From bf7c3fb6708a2f77bd333b20a5167b9eead392a9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 30 Mar 2015 09:45:22 -0500 Subject: [svn-r26647] Description: Bring r26639 from autotools_rework branch to trunk: Switch AC_TRY_RUN macros to AC_RUN_IFELSE macros. Tested on: Linux/32 2.6.18 (jam) w/serial & parallel (Daily tested on branch for 2+ days) --- configure | 68 ++++++++++++++++++++++++++++++++++++++++-------------------- configure.ac | 50 ++++++++++++++++++++------------------------ 2 files changed, 69 insertions(+), 49 deletions(-) diff --git a/configure b/configure index b33349c..5182b4d 100755 --- a/configure +++ b/configure @@ -25600,16 +25600,29 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + #include "szlib.h" + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - int main(void) - { /* SZ_encoder_enabled returns 1 if encoder is present */ - if(SZ_encoder_enabled() == 1) - exit(0); - else - exit(1); - } + if(SZ_encoder_enabled() == 1) + exit(0); + else + exit(1); + + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -25621,6 +25634,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi @@ -26122,15 +26136,12 @@ int main () { - int main(void) - { pthread_attr_t attribute; int ret; pthread_attr_init(&attribute); ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); exit(ret==0 ? 0 : 1); - } ; return 0; @@ -26945,17 +26956,30 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include - - int main(void) - { - char *s = malloc(128); - long long x = (long long)1048576 * (long long)1048576; - sprintf(s,"%${hdf5_cv_printf_ll}d",x); - exit(strcmp(s,"1099511627776")); - } + #include + #include + #include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + char *s = malloc(128); + long long x = (long long)1048576 * (long long)1048576; + sprintf(s,"%${hdf5_cv_printf_ll}d",x); + exit(strcmp(s,"1099511627776")); + + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : diff --git a/configure.ac b/configure.ac index bf13fbf..7d48482 100644 --- a/configure.ac +++ b/configure.ac @@ -1538,18 +1538,18 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" AC_CACHE_VAL([hdf5_cv_szlib_can_encode], - [AC_TRY_RUN([ - #include - - int main(void) - { + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include "szlib.h" + ],[[ /* SZ_encoder_enabled returns 1 if encoder is present */ - if(SZ_encoder_enabled() == 1) - exit(0); - else - exit(1); - } - ], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)]) + if(SZ_encoder_enabled() == 1) + exit(0); + else + exit(1); + ]])] + , [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)] + ) AC_DEFINE([HAVE_FILTER_SZIP], [1], [Define if support for szip filter is enabled]) @@ -1728,15 +1728,12 @@ if test "X$THREADSAFE" = "Xyes"; then #include #endif ],[ - int main(void) - { pthread_attr_t attribute; int ret; pthread_attr_init(&attribute); ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); exit(ret==0 ? 0 : 1); - } ])] , [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])]) @@ -1931,19 +1928,18 @@ AC_MSG_CHECKING([how to print long long]) AC_CACHE_VAL([hdf5_cv_printf_ll], [ for hdf5_cv_printf_ll in l ll L q unknown; do - AC_TRY_RUN([ - #include - #include - #include - - int main(void) - { - char *s = malloc(128); - long long x = (long long)1048576 * (long long)1048576; - sprintf(s,"%${hdf5_cv_printf_ll}d",x); - exit(strcmp(s,"1099511627776")); - } - ], [break],,[continue]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #include + #include + ],[[ + char *s = malloc(128); + long long x = (long long)1048576 * (long long)1048576; + sprintf(s,"%${hdf5_cv_printf_ll}d",x); + exit(strcmp(s,"1099511627776")); + ]])] + , [break],,[continue]) done]) AC_MSG_RESULT([%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u]) -- cgit v0.12