From: Harlan Stenn Date: Mon, 14 Sep 2015 06:36:37 +0000 (+0000) Subject: [Bug 2906] "make check" needs better support for pthreads X-Git-Tag: NTP_4_3_71~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfe6966d4969526098a576fb6b1e63d6fb4397c5;p=thirdparty%2Fntp.git [Bug 2906] "make check" needs better support for pthreads bk: 55f66af5N4R6FTpB3CEcm3JZwgD3xA --- diff --git a/ChangeLog b/ChangeLog index f3d38732e..dda48bb44 100644 --- 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. diff --git a/sntp/m4/ntp_libevent.m4 b/sntp/m4/ntp_libevent.m4 index 54174f05a..785b8e167 100644 --- a/sntp/m4/ntp_libevent.m4 +++ b/sntp/m4/ntp_libevent.m4 @@ -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. diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index 49ea18327..9d09d6e86 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -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 \ diff --git a/tests/libntp/Makefile.am b/tests/libntp/Makefile.am index eaf3a2b6c..0a97769b9 100644 --- a/tests/libntp/Makefile.am +++ b/tests/libntp/Makefile.am @@ -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 = \ diff --git a/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am index c9430efcd..2668da1db 100644 --- a/tests/ntpd/Makefile.am +++ b/tests/ntpd/Makefile.am @@ -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 = \