]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2906] "make check" needs better support for pthreads
authorHarlan Stenn <stenn@ntp.org>
Mon, 14 Sep 2015 06:36:37 +0000 (06:36 +0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 14 Sep 2015 06:36:37 +0000 (06:36 +0000)
bk: 55f66af5N4R6FTpB3CEcm3JZwgD3xA

ChangeLog
sntp/m4/ntp_libevent.m4
sntp/tests/Makefile.am
tests/libntp/Makefile.am
tests/ntpd/Makefile.am

index f3d38732e2294282eec205b9a41fa35fd005772d..dda48bb44c6c38e1788609507daf32535bef2ad4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
 * [Bug 2886] Mis-spelling: "outlyer" should be "outlier".  dave@horsfall.org
 * [Bug 2889] ntp-dev-4.3.67 does not build on Windows.  perlinger@ntp.org
 * [Bug 2890] Ignore ENOBUFS on routing netlink socket.  Konstantin Khlebnikov.
+* [Bug 2906] make check needs better support for pthreads.  Harlan Stenn.
 * [Bug 2907] dist* build targets require our libevent/ to be enabled.  HStenn.
 * libntp/emalloc.c: Remove explicit include of stdint.h.  Harlan Stenn.
 * Put Unity CPPFLAGS items in unity_config.h.  Harlan Stenn.
index 54174f05a21a5e59d9c81f7e0d0cf4a04717690a..785b8e167b8e340a47047e4706a2e4ecb8b1c430 100644 (file)
@@ -64,6 +64,7 @@ AC_REQUIRE([NTP_ENABLE_LOCAL_LIBEVENT])dnl
 ntp_libevent_min_version=m4_default([$1], [2.0.9])
 ntp_libevent_tearoff=m4_default([$2], [libevent])
 
+AC_SUBST([CFLAGS_LIBEVENT])
 AC_SUBST([CPPFLAGS_LIBEVENT])
 AC_SUBST([LDADD_LIBEVENT])
 
@@ -78,6 +79,7 @@ case "$ntp_use_local_libevent" in
        then
            ntp_use_local_libevent=no
            AC_MSG_NOTICE([Using the installed libevent])
+           CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
            CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
            # HMS: I hope the following is accurate.
            # We don't need -levent, we only need  -levent_core.
index 49ea18327b4e5da11b2dcfa2ec6869efe5476180..9d09d6e8643fd239e85aeca81fa2ea19dab29f2a 100644 (file)
@@ -167,6 +167,11 @@ test_utilities_SOURCES =           \
        fileHandlingTest.c              \
        $(NULL)
 
+test_crypto_CFLAGS =                   \
+       $(CFLAGS_LIBEVENT)              \
+       $(AM_CFLAGS)                    \
+       $(NULL)
+
 test_crypto_SOURCES =                  \
        crypto.c                        \
        run-crypto.c                    \
index eaf3a2b6c003df44560eb221abb2c27d05eb1294..0a97769b92fb813b9e85718267d52fb263ca75d2 100644 (file)
@@ -242,9 +242,9 @@ $(srcdir)/run-calendar.c: $(srcdir)/calendar.c $(std_unity_list)
 
 ###
 
-test_caltontp_LDADD =          \
-       $(LDADD)                \
-       -lpthread               \
+test_caltontp_CFLAGS =         \
+       $(CFLAGS_LIBEVENT)      \
+       $(AM_CFLAGS)            \
        $(NULL)
 
 test_caltontp_SOURCES =                        \
@@ -257,9 +257,9 @@ $(srcdir)/run-caltontp.c: $(srcdir)/caltontp.c $(std_unity_list)
 
 ###
 
-test_caljulian_LDADD =         \
-       $(LDADD)                \
-       -lpthread               \
+test_caljulian_CFLAGS =                \
+       $(CFLAGS_LIBEVENT)      \
+       $(AM_CFLAGS)            \
        $(NULL)
 
 test_caljulian_SOURCES =       \
@@ -295,9 +295,9 @@ $(srcdir)/run-clocktime.c: $(srcdir)/clocktime.c $(std_unity_list)
 
 ###
 
-test_decodenetnum_LDADD =      \
-       $(LDADD)                \
-       -lpthread               \
+test_decodenetnum_CFLAGS =     \
+       $(CFLAGS_LIBEVENT)      \
+       $(AM_CFLAGS)            \
        $(NULL)
 
 test_decodenetnum_SOURCES =    \
@@ -504,9 +504,9 @@ $(srcdir)/run-statestr.c: $(srcdir)/statestr.c $(std_unity_list)
 
 ###
 
-test_strtolfp_LDADD =          \
-       $(LDADD)                \
-       -lpthread               \
+test_strtolfp_CFLAGS =         \
+       $(CFLAGS_LIBEVENT)      \
+       $(AM_CFLAGS)            \
        $(NULL)
 
 test_strtolfp_SOURCES =                \
index c9430efcd4bc96b908bc688fdcf4eeb2a0291926..2668da1dba2807fb5d0b97ffc065e59bef31398f 100644 (file)
@@ -16,12 +16,14 @@ check_PROGRAMS =            \
        test-ntp_scanner        \
        $(NULL)
 
-#      test-ntp_signd          \ #doesn't work, can't link it because you can't link static function
+EXTRA_PROGRAMS =               \
+       test-ntp_signd          \ #doesn't work, can't link it because you can't link static function
+       $(NULL)
 
 if GTEST_AVAILABLE
 check_PROGRAMS += tests
 else
-EXTRA_PROGRAMS = tests
+EXTRA_PROGRAMS += tests
 endif
 
 LDADD =                                        \