From 9be4551686704d721b898d8cee1c989435335297 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 5 Dec 2002 20:49:26 +0000 Subject: [PATCH] Fix multiple problems with the programs in the argument of AC_TRY_RUN() Thu Dec 5 15:43:46 2002 Owen Taylor * configure.in: Fix multiple problems with the programs in the argument of AC_TRY_RUN() having preprocessor defines not in the first column. --- ChangeLog | 6 +++ ChangeLog.pre-2-10 | 6 +++ ChangeLog.pre-2-12 | 6 +++ ChangeLog.pre-2-2 | 6 +++ ChangeLog.pre-2-4 | 6 +++ ChangeLog.pre-2-6 | 6 +++ ChangeLog.pre-2-8 | 6 +++ configure.in | 113 +++++++++++++++++++++++---------------------- 8 files changed, 99 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92af0864..51b196ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 92af0864..51b196ba 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Thu Dec 5 15:43:46 2002 Owen Taylor + + * configure.in: Fix multiple problems with the programs + in the argument of AC_TRY_RUN() having preprocessor + defines not in the first column. + Thu Dec 5 15:24:14 2002 Owen Taylor Start of fixes for cross-compilation. Based on diff --git a/configure.in b/configure.in index ebc22e16..da6343fe 100644 --- a/configure.in +++ b/configure.in @@ -802,8 +802,7 @@ fi dnl *** check for sane realloc() *** AC_CACHE_CHECK([whether realloc (NULL,) will work],glib_cv_sane_realloc,[ - AC_TRY_RUN([ - #include + AC_TRY_RUN([#include int main() { return realloc (0, sizeof (int)) == 0; }], @@ -853,8 +852,7 @@ dnl ********************** dnl we currently check for all three va_copy possibilities, so we get dnl all results in config.log for bug reports. AC_CACHE_CHECK([for an implementation of va_copy()],glib_cv_va_copy,[ - AC_TRY_RUN([ - #include + AC_TRY_RUN([#include void f (int i, ...) { va_list args1, args2; va_start (args1, i); @@ -872,8 +870,7 @@ AC_CACHE_CHECK([for an implementation of va_copy()],glib_cv_va_copy,[ []) ]) AC_CACHE_CHECK([for an implementation of __va_copy()],glib_cv___va_copy,[ - AC_TRY_RUN([ - #include + AC_TRY_RUN([#include void f (int i, ...) { va_list args1, args2; va_start (args1, i); @@ -903,8 +900,7 @@ if test -n "$g_va_copy_func"; then fi AC_CACHE_CHECK([whether va_lists can be copied by value],glib_cv_va_val_copy,[ - AC_TRY_RUN([ - #include + AC_TRY_RUN([#include void f (int i, ...) { va_list args1, args2; va_start (args1, i); @@ -996,22 +992,22 @@ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness AC_CACHE_CHECK([for RTLD_GLOBAL brokenness], glib_cv_rtldglobal_broken,[ AC_TRY_RUN([ - #include - #ifndef RTLD_GLOBAL - #define RTLD_GLOBAL 0 - #endif - #ifndef RTLD_LAZY - #define RTLD_LAZY 0 - #endif - int pthread_create; - int main () { - void *handle, *global, *local; - global = &pthread_create; - handle = dlopen ("libpthread.so", RTLD_GLOBAL | RTLD_LAZY); - if (!handle) return 0; - local = dlsym (handle, "pthread_create"); - return global == local; - }], +#include +#ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +#endif +#ifndef RTLD_LAZY +# define RTLD_LAZY 0 +#endif +int pthread_create; +int main () { + void *handle, *global, *local; + global = &pthread_create; + handle = dlopen ("libpthread.so", RTLD_GLOBAL | RTLD_LAZY); + if (!handle) return 0; + local = dlsym (handle, "pthread_create"); + return global == local; +} ], [glib_cv_rtldglobal_broken=no], [glib_cv_rtldglobal_broken=yes], []) @@ -1025,8 +1021,7 @@ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness dnl *** check whether we need preceeding underscores AC_CACHE_CHECK([for preceeding underscore in symbols], glib_cv_uscore,[ - AC_TRY_RUN([ - #include + AC_TRY_RUN([#include int glib_underscore_test (void) { return 42; } int main() { void *f1 = (void*)0, *f2 = (void*)0, *handle; @@ -1453,12 +1448,14 @@ case $have_threads in LIBS="$glib_save_LIBS $add_thread_lib" AC_MSG_CHECKING(for sched_get_priority_min$IN) - AC_TRY_RUN([#include - #include - int main() { - errno = 0; - return sched_get_priority_min(SCHED_OTHER)==-1 - && errno != 0;}], + AC_TRY_RUN([ +#include +#include +int main() { + errno = 0; + return sched_get_priority_min(SCHED_OTHER)==-1 + && errno != 0; +} ], [AC_MSG_RESULT(yes) G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib" posix_priority_min="sched_get_priority_min(SCHED_OTHER)" @@ -1527,16 +1524,19 @@ if test x"$have_threads" != xno; then if test "$ac_cv_header_pwd_h" = "yes"; then AC_CACHE_CHECK([for posix getpwuid_r], ac_cv_func_posix_getpwuid_r, - [AC_TRY_RUN([#include - #include - int main () { char buffer[10000]; - struct passwd pwd, *pwptr = &pwd; - int error; - errno = 0; - error = getpwuid_r (0, &pwd, buffer, - sizeof (buffer), &pwptr); - return (error < 0 && errno == ENOSYS) - || error == ENOSYS; }], + [AC_TRY_RUN([ +#include +#include +int main () { + char buffer[10000]; + struct passwd pwd, *pwptr = &pwd; + int error; + errno = 0; + error = getpwuid_r (0, &pwd, buffer, + sizeof (buffer), &pwptr); + return (error < 0 && errno == ENOSYS) + || error == ENOSYS; +} ], [ac_cv_func_posix_getpwuid_r=yes], [ac_cv_func_posix_getpwuid_r=no])]) if test "$ac_cv_func_posix_getpwuid_r" = yes; then @@ -1624,20 +1624,21 @@ if test x"$have_threads" != xno; then CPPFLAGS="$glib_save_CPPFLAGS" AC_MSG_CHECKING(whether to use the PID niceness surrogate for thread priorities) - AC_TRY_RUN([#include - #include - #include - pid_t other_pid = 0; - - void* func(void* data) {other_pid = getpid();} - main() - { pthread_t t; - void *ret; - pthread_create (&t, $defattr, func, NULL); - pthread_join (t, &ret); - exit (getpid()==other_pid || - $posix_priority_min != $posix_priority_max); - }], + AC_TRY_RUN([ +#include +#include +#include +pid_t other_pid = 0; + +void* func(void* data) {other_pid = getpid();} +main() +{ pthread_t t; + void *ret; + pthread_create (&t, $defattr, func, NULL); + pthread_join (t, &ret); + exit (getpid()==other_pid || + $posix_priority_min != $posix_priority_max); +} ], [AC_MSG_RESULT(yes) AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities]) ], -- 2.34.1