From: Owen Taylor Date: Wed, 11 Dec 2002 20:28:46 +0000 (+0000) Subject: Factor out repeated thread test into a m4_define(); when cross-compiling, X-Git-Tag: GLIB_2_1_4~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d67044c3911bf5bc7f5d00f3c7bee8550e7178db;p=platform%2Fupstream%2Fglib.git Factor out repeated thread test into a m4_define(); when cross-compiling, Wed Dec 11 15:10:25 2002 Owen Taylor * configure.in: Factor out repeated thread test into a m4_define(); when cross-compiling, assume that AC_LINK_IFELSE() is good enough for thinking that -pthread[s] is OK. (More of #58786) * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) --- diff --git a/ChangeLog b/ChangeLog index 05e526d..40495ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 05e526d..40495ea 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Wed Dec 11 15:10:25 2002 Owen Taylor + + * configure.in: Factor out repeated thread test into + a m4_define(); when cross-compiling, assume that + AC_LINK_IFELSE() is good enough for thinking that + -pthread[s] is OK. (More of #58786) + + * m4macros/glib-gettext.m4: Fix typo. (Manish Singh) + Wed Dec 11 14:28:50 2002 Owen Taylor * configure.in: Version 2.1.4, interface age 1. diff --git a/configure.in b/configure.in index b86fccb..46cc9cb 100644 --- a/configure.in +++ b/configure.in @@ -1269,6 +1269,21 @@ G_THREAD_LIBS= G_THREAD_LIBS_EXTRA= G_THREAD_CFLAGS= +dnl +dnl Test program for basic POSIX threads functionality +dnl +m4_define([glib_thread_test],[ +#include +int check_me = 0; +void* func(void* data) {return check_me = 42;} +main() + { pthread_t t; + void *ret; + pthread_create (&t, 0, func, 0); + pthread_join (t, &ret); + exit (check_me != 42 || ret != 42); + }]) + if test x"$have_threads" != xno; then if test x"$have_threads" = xposix; then @@ -1279,19 +1294,17 @@ if test x"$have_threads" != xno; then for flag in pthread pthreads; do glib_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -$flag" - AC_TRY_RUN([#include - int check_me = 0; - void* func(void* data) {return check_me = 42;} - main() - { pthread_t t; - void *ret; - pthread_create (&t, 0, func, 0); - pthread_join (t, &ret); - exit (check_me != 42 || ret != 42); - }], - [G_THREAD_CFLAGS=-$flag - G_THREAD_LIBS=-$flag]) + AC_TRY_RUN(glib_thread_test, + glib_flag_works=yes, + glib_flag_works=no, + AC_LINK_IFELSE(glib_thread_test, + glib_flag_works=yes, + glib_flag_works=no)) CFLAGS="$glib_save_CFLAGS" + if test $glib_flag_works = yes ; then + G_THREAD_CFLAGS=-$flag + G_THREAD_LIBS=-$flag + fi done fi @@ -1408,16 +1421,7 @@ case $have_threads in LIBS="$glib_save_LIBS $add_thread_lib" AC_MSG_CHECKING(for pthread_create/pthread_join$IN) - AC_TRY_RUN([#include - int check_me = 0; - void* func(void* data) {check_me = 42;} - main() - { pthread_t t; - void *ret; - pthread_create (&t, $defattr, func, 0); - pthread_join (t, &ret); - exit (check_me != 42); - }], + AC_TRY_RUN(glib_thread_test, [AC_MSG_RESULT(yes) G_THREAD_LIBS="$add_thread_lib" break], diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 index 737549d..d52c20b 100644 --- a/m4macros/glib-gettext.m4 +++ b/m4macros/glib-gettext.m4 @@ -26,7 +26,7 @@ dnl # GLIB_LC_MESSAGES #-------------------- -glib_DEFUN([glib_LC_MESSAGES], +glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,