From: Harlan Stenn Date: Mon, 21 Sep 2015 08:06:14 +0000 (+0000) Subject: Pthread autoconf macro cleanup. Harlan Stenn. X-Git-Tag: NTP_4_3_72~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c7bb48efa7e5c0fa49ed8e2999f47bd4767a68f;p=thirdparty%2Fntp.git Pthread autoconf macro cleanup. Harlan Stenn. bk: 55ffba76V7rk4WL9PluEzNsgVANKJA --- diff --git a/ChangeLog b/ChangeLog index d07870b85..e76d7c88d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -114,6 +114,7 @@ fixed formatting. Tomasz Flendrich * Autoconf cleanup. Harlan Stenn. * Unit test dist cleanup. Harlan Stenn. * Cleanup various test Makefile.am files. Harlan Stenn. +* Pthread autoconf macro cleanup. Harlan Stenn. --- (4.2.8p3) 2015/06/29 Released by Harlan Stenn diff --git a/sntp/m4/ntp_libevent.m4 b/sntp/m4/ntp_libevent.m4 index 7795686b8..895360ee7 100644 --- a/sntp/m4/ntp_libevent.m4 +++ b/sntp/m4/ntp_libevent.m4 @@ -111,10 +111,6 @@ case "$ntp_use_local_libevent" in # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS # is "pthreads"? CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads` - case "$CFLAGS_LIBEVENT" in - '') CFLAGS_LIBEVENT="-pthreads" - ;; - esac AC_MSG_RESULT([no]) fi ;; @@ -138,21 +134,21 @@ case "$ntp_use_local_libevent" in esac esac -AC_ARG_ENABLE( - [cflags-libevent], - [AC_HELP_STRING( - [--enable-cflags-libevent=-pthread], - [CFLAGS value to build with pthreads] - )], - [CFLAGS_LIBEVENT=$enableval], - [# See above about LIBISC_PTHREADS_NOTHREADS - case "$CFLAGS_LIBEVENT" in - '') CFLAGS_LIBEVENT="-pthread" ;; - *) ;; - esac] -) -AC_MSG_NOTICE([LIBISC_PTHREADS_NOTHREADS is <$LIBISC_PTHREADS_NOTHREADS>]) -AC_MSG_NOTICE([CFLAGS_LIBEVENT is <$CFLAGS_LIBEVENT>]) +dnl AC_ARG_ENABLE( +dnl [cflags-libevent], +dnl [AC_HELP_STRING( +dnl [--enable-cflags-libevent=-pthread], +dnl [CFLAGS value to build with pthreads] +dnl )], +dnl [CFLAGS_LIBEVENT=$enableval], +dnl [# See above about LIBISC_PTHREADS_NOTHREADS +dnl case "$CFLAGS_LIBEVENT" in +dnl '') CFLAGS_LIBEVENT="-pthread" ;; +dnl *) ;; +dnl esac] +dnl ) +dnl AC_MSG_NOTICE([LIBISC_PTHREADS_NOTHREADS is <$LIBISC_PTHREADS_NOTHREADS>]) +dnl AC_MSG_NOTICE([CFLAGS_LIBEVENT is <$CFLAGS_LIBEVENT>]) AM_CONDITIONAL([BUILD_LIBEVENT], [test "x$ntp_use_local_libevent" = "xyes"]) diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4 index 89b94b6d4..3999b6e94 100644 --- a/sntp/m4/ntp_libntp.m4 +++ b/sntp/m4/ntp_libntp.m4 @@ -328,7 +328,8 @@ AC_ARG_ENABLE( ) have_pthreads=no case "$enable_thread_support" in - yes) + no) ;; + *) ol_found_pthreads=no OL_THREAD_CHECK([ol_found_pthreads=yes]) case "$ol_found_pthreads" in @@ -352,8 +353,10 @@ case "$enable_thread_support" in # thread cancellation fails to load libgcc_s with dlopen(). # We have to pass this all as linker options to avoid argument # reordering by libtool. + # HMS: The fix below seems to break a number of test programs, + # as it means pthread_once() can't be found. case "$GCC$with_gnu_ld" in - yesyes) + Xyesyes) AC_CHECK_LIB([gcc_s], [exit], [PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"]) ;; diff --git a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4 index fd6009c52..7768a5c5b 100644 --- a/sntp/m4/openldap-thread-check.m4 +++ b/sntp/m4/openldap-thread-check.m4 @@ -205,6 +205,8 @@ dnl [ol_cv_pthread_lpthread_lexc]) OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads]) +AC_MSG_NOTICE([ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>]) + if test $ol_link_threads != no ; then LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" @@ -683,4 +685,8 @@ case "$ol_with_threads" in esac AC_LANG_RESTORE + +AC_SUBST(BUILD_THREAD) +AC_SUBST(LTHREAD_LIBS) + ])