]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Pthread autoconf macro cleanup. Harlan Stenn.
authorHarlan Stenn <stenn@ntp.org>
Mon, 21 Sep 2015 08:06:14 +0000 (08:06 +0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 21 Sep 2015 08:06:14 +0000 (08:06 +0000)
bk: 55ffba76V7rk4WL9PluEzNsgVANKJA

ChangeLog
sntp/m4/ntp_libevent.m4
sntp/m4/ntp_libntp.m4
sntp/m4/openldap-thread-check.m4

index d07870b850a796f03a6996c83cea45d16a643648..e76d7c88d315ccc68315c1df2f6169b7f6c3bc31 100644 (file)
--- 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 <stenn@ntp.org>
 
index 7795686b8bf55c065ff12e266be1f796ec2dc3a9..895360ee7b7612f9e11242f36770497d1a04da03 100644 (file)
@@ -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"])
 
index 89b94b6d4ea24884e090ad9886a72ab0c7c4966e..3999b6e947c4fa4d31ee1ca077127405ed28ba49 100644 (file)
@@ -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"])
                ;;
index fd6009c52cc24a3d674c79d5cbaa71fe37d70663..7768a5c5b3b5302c2fd2185424797daf7cd2459b 100644 (file)
@@ -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)
+
 ])