From: Dave Hart Date: Mon, 9 Apr 2012 05:25:13 +0000 (+0000) Subject: [Bug 1122] openssl detection via pkg-config fails when no additional X-Git-Tag: NTP_4_2_7P271~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4afa80f781c8674dc9083c2cd47a08febcf7b5c;p=thirdparty%2Fntp.git [Bug 1122] openssl detection via pkg-config fails when no additional -Idir flags are needed. Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead they are added to LDFLAGS_NTP. bk: 4f8272b9rZiAzhICqaMr_-iK1ES_FQ --- diff --git a/ChangeLog b/ChangeLog index 0d05e65c5..e80c7c805 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* [Bug 1122] openssl detection via pkg-config fails when no additional + -Idir flags are needed. +* Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead + they are added to LDFLAGS_NTP. (4.2.7p270) 2012/03/26 Released by Harlan Stenn * Update driver45.html page. (4.2.7p269) 2012/03/25 Released by Harlan Stenn diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index a308a111c..e5e29aeb4 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -12,6 +12,8 @@ AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + # LDADD might need RESLIB and ADJLIB. LDADD = version.o libntpd.a $(LIBPARSE) AM_YFLAGS = -d -t -r all @@ -85,8 +87,8 @@ man_MANS= ntpd.$(NTPD_MS) # simulator currently uses ntpd-opts.[ch]. This also means there is no # longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def. -LDADD_NTPD_COMMON = @LDADD_LIBNTP@ $(LIBOPTS_LDADD) $(PTHREAD_LIBS) -LDADD_NTPD_COMMON += $(LIBM) $(LCRYPTO) $(LSCF) +LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) +LDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF) ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_NTPD_COMMON) ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON) ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index 97e3efad6..12bf77098 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -16,10 +16,12 @@ AM_CFLAGS = $(CFLAGS_NTP) AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + # LDADD might need RESLIB and ADJLIB LDADD = version.o ../libntp/libntp.a ntpdate_LDADD = $(LDADD) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LIBOPTS_LDADD) -ntpdate_LDADD += $(LIBM) $(LCRYPTO) +ntpdate_LDADD += $(LIBM) $(LDADD_NTP) DISTCLEANFILES= .version version.c stamp-v noinst_HEADERS= ntpdate.h diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am index 5ad2a5477..997152021 100644 --- a/ntpdc/Makefile.am +++ b/ntpdc/Makefile.am @@ -14,11 +14,13 @@ AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + # LDADD might need RESLIB and ADJLIB ntpdc_LDADD = version.o $(LIBOPTS_LDADD) ntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) ntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS) -ntpdc_LDADD += $(LCRYPTO) +ntpdc_LDADD += $(LDADD_NTP) # ntpdc-layout doesn't need any additional libraries at all ntpdc_layout_LDADD= diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index e56685259..45c451889 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -11,11 +11,13 @@ AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + # LDADD might need RESLIB and ADJLIB ntpq_LDADD = version.o $(LIBOPTS_LDADD) ntpq_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) ntpq_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS) -ntpq_LDADD += $(LCRYPTO) +ntpq_LDADD += $(LDADD_NTP) noinst_HEADERS= ntpq.h noinst_LIBRARIES= libntpq.a libntpq_a_CFLAGS= -DNO_MAIN_ALLOWED -DBUILD_AS_LIB diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am index 7dfd8abc2..0d9e5271c 100644 --- a/ntpsnmpd/Makefile.am +++ b/ntpsnmpd/Makefile.am @@ -10,7 +10,7 @@ ntpsnmpd_SOURCES= netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \ ntp_snmp.h # HMS: we probably want a version.o file here, too. LDADD = ../ntpq/libntpq.a ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) -LDADD += $(PTHREAD_LIBS) $(LCRYPTO) $(SNMP_LIBS) $(LIBOPTS_LDADD) +LDADD += $(PTHREAD_LIBS) $(LDADD_NTP) $(SNMP_LIBS) $(LIBOPTS_LDADD) AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP) @@ -20,6 +20,8 @@ AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(SNMP_CPPFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + EXTRA_DIST= \ ntpsnmpd-opts.def \ ntpsnmpd-opts.menu \ diff --git a/sntp/Makefile.am b/sntp/Makefile.am index 413464936..91f8c1b72 100644 --- a/sntp/Makefile.am +++ b/sntp/Makefile.am @@ -11,13 +11,15 @@ AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + LDADD = version.o LDADD += libsntp.a LDADD += $(LIBOPTS_LDADD) LDADD += $(LDADD_LIBEVENT) LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) LDADD += $(PTHREAD_LIBS) -LDADD += $(LCRYPTO) +LDADD += $(LDADD_NTP) run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L include -L ag-tpl --writable diff --git a/sntp/m4/ntp_compiler.m4 b/sntp/m4/ntp_compiler.m4 index c69b2b0ee..49d677bd6 100644 --- a/sntp/m4/ntp_compiler.m4 +++ b/sntp/m4/ntp_compiler.m4 @@ -5,8 +5,12 @@ AC_REQUIRE([AC_PROG_CC_C89]) CFLAGS_NTP= CPPFLAGS_NTP= +LDADD_NTP= +LDFLAGS_NTP= AC_SUBST([CFLAGS_NTP]) AC_SUBST([CPPFLAGS_NTP]) +AC_SUBST([LDADD_NTP]) +AC_SUBST([LDFLAGS_NTP]) case "$ac_cv_prog_cc_c89" in no) diff --git a/sntp/m4/ntp_openssl.m4 b/sntp/m4/ntp_openssl.m4 index 49ab0c912..6fdb79ef6 100644 --- a/sntp/m4/ntp_openssl.m4 +++ b/sntp/m4/ntp_openssl.m4 @@ -1,238 +1,224 @@ -dnl ###################################################################### +dnl #################################################################### dnl OpenSSL support shared by top-level and sntp/configure.ac +dnl +dnl Provides command-line option --with-crypto, as well as deprecated +dnl options --with-openssl-incdir, --with-openssl-libdir, and the +dnl latter's suboption --with-rpath. +dnl +dnl Specifying --with-openssl-libdir or --with-openssl-incdir causes any +dnl pkg-config openssl information to be ignored in favor of the legacy +dnl manual search for directories and specified library names. +dnl +dnl Output AC_DEFINEs (for config.h) +dnl OPENSSL defined only if using OpenSSL +dnl +dnl Output variables: +dnl ntp_openssl yes if using OpenSSL, no otherwise +dnl +dnl Output substitutions: +dnl CFLAGS_NTP OpenSSL-specific flags added as needed, and +dnl -Wstrict-prototypes for gcc if it does not +dnl trigger a flood of warnings for each file +dnl including OpenSSL headers. +dnl CPPFLAGS_NTP OpenSSL -Iincludedir flags added as needed. +dnl LDADD_NTP OpenSSL -L and -l flags added as needed. +dnl LDFLAGS_NTP Other OpenSSL link flags added as needed. +dnl +dnl #################################################################### AC_DEFUN([NTP_OPENSSL], [ AC_REQUIRE([NTP_PKG_CONFIG])dnl -LCRYPTO= -AC_SUBST([LCRYPTO]) - AC_ARG_WITH( - [rpath], + [crypto], [AS_HELP_STRING( - [--without-rpath], - [s Disable auto-added -R linker paths] - )], - [ans=$withval], - [ans=x] + [--with-crypto], + [+ =openssl] + )] ) -need_dash_r= -case "$ans" in - yes) - need_dash_r=1 - ;; - x) - case "$host" in - *-*-netbsd*) - need_dash_r=1 - ;; - *-*-solaris*) - need_dash_r=1 - ;; - esac - ;; -esac - -AC_SUBST([OPENSSL]) -AC_SUBST([OPENSSL_INC]) -AC_SUBST([OPENSSL_LIB]) - -AC_MSG_CHECKING([for openssl library directory]) AC_ARG_WITH( [openssl-libdir], [AS_HELP_STRING( [--with-openssl-libdir], [+ =/something/reasonable] - )], - [ans=$withval], - [ - case "$build" in - $host) ans=yes ;; - *) ans=no ;; - esac - ] + )] ) -case "$ans" in - no) - ;; - yes) - case "$PKG_CONFIG" in - '') - ;; - *) - pkgans=`$PKG_CONFIG --libs-only-L openssl 2>/dev/null` - pkgans=`echo $pkgans | sed -e 's/^-L//' | tr -d '\n' | tr -d ' '` - if test -f "${pkgans}/pkgconfig/openssl.pc" ; then - ans="$pkgans" - fi - ;; - esac - ;; - *) # Look where they said - ;; +AC_ARG_WITH( + [openssl-incdir], + [AS_HELP_STRING( + [--with-openssl-incdir], + [+ =/something/reasonable] + )] +) +AC_ARG_WITH( + [rpath], + [AS_HELP_STRING( + [--without-rpath], + [s Disable auto-added -R linker paths] + )] +) +ntp_openssl=no +ntp_openssl_from_pkg_config=no +with_crypto=${with_crypto:-yes} +case "$with_crypto" in + openssl) + with_crypto=yes esac -case "$ans" in - yes) - # Look in: - ans="/usr/lib /usr/lib/openssl /usr/sfw/lib" - ans="$ans /usr/local/lib /usr/local/ssl/lib /lib" +case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${with_openssl_incdir-notgiven}" in + yes:notempty:notgiven:notgiven) + if $PKG_CONFIG --exists openssl ; then + CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I openssl`" + CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other openssl`" + LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-L openssl`" + LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-other openssl`" + LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-l openssl`" + ntp_openssl=yes + ntp_openssl_from_pkg_config=yes + fi esac -case "$ans" in - no) - ;; - *) # Look for libcrypto.a and libssl.a: - for i in $ans no - do +case "$with_crypto:$ntp_openssl" in + yes:no) + need_dash_r= + case "${with_rpath-notgiven}" in + yes) + need_dash_r=1 + ;; + notgiven) case "$host" in - *-*-darwin*) - test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break + *-*-netbsd*) + need_dash_r=1 ;; - *) - test -f $i/libcrypto.so -a -f $i/libssl.so && break - test -f $i/libcrypto.a -a -f $i/libssl.a && break + *-*-solaris*) + need_dash_r=1 ;; esac - done - case "$i" in - no) - echo "" - echo "did not find libcrypto and libssl in any of $ans" - ans=no - OPENSSL_LIB= - ;; - *) ans=$i - OPENSSL_LIB=$ans ;; esac - ;; -esac -AC_MSG_RESULT([$ans]) -AC_MSG_CHECKING([for openssl include directory]) -AC_ARG_WITH( - [openssl-incdir], - [AS_HELP_STRING( - [--with-openssl-incdir], - [+ =/something/reasonable] - )], - [ans=$withval], - [ + AC_MSG_CHECKING([for openssl library directory]) + with_openssl_libdir=${with_openssl_libdir-notgiven} + case "$with_openssl_libdir" in + notgiven) case "$build" in - $host) ans=yes ;; - *) ans=no ;; + $host) + with_openssl_libdir=default + ;; + *) + with_openssl_libdir=no + ;; esac - ] -) -case "$ans" in - no) - ;; - yes) # look in: - case "$PKG_CONFIG" in - '') + esac + case "$with_openssl_libdir" in + default) + # Look in: + with_openssl_libdir="/usr/lib /usr/lib/openssl /usr/sfw/lib" + with_openssl_libdir="$with_openssl_libdir /usr/local/lib" + with_openssl_libdir="$with_openssl_libdir /usr/local/ssl/lib /lib" + esac + case "$with_openssl_libdir" in + no) ;; - *) - pkgans=`$PKG_CONFIG --cflags-only-I openssl 2>/dev/null` - pkgans=`echo $pkgans | sed -e 's/^-I//' | tr -d '\n' | tr -d ' '` - if test -f "${pkgans}/openssl/evp.h" ; then - ans="$pkgans" - fi + *) # Look for libcrypto.a and libssl.a: + for i in $with_openssl_libdir no + do + case "$host" in + *-*-darwin*) + test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break + ;; + *) + test -f $i/libcrypto.so -a -f $i/libssl.so && break + test -f $i/libcrypto.a -a -f $i/libssl.a && break + ;; + esac + done + openssl_libdir=$i ;; esac - ;; - *) # Look where they said - ;; -esac -case "$ans" in - yes) - # Look in: - ans="/usr/include /usr/sfw/include /usr/local/include" - ans="$ans /usr/local/ssl/include" -esac -case "$ans" in - no) - ;; - *) # look for openssl/evp.h: - for i in $ans no - do - test -f $i/openssl/evp.h && break - done - case "$i" in + AC_MSG_RESULT([$openssl_libdir]) + case "$openssl_libdir" in + no) + openssl_libdir= + AC_MSG_WARN([libcrypto and libssl not found in any of $with_openssl_libdir]) + esac + + AC_MSG_CHECKING([for openssl include directory]) + with_openssl_incdir=${with_openssl_incdir-notgiven} + case "$with_openssl_incdir" in + notgiven) + # Look in: + with_openssl_incdir="/usr/include /usr/sfw/include" + with_openssl_incdir="$with_openssl_incdir /usr/local/include" + with_openssl_incdir="$with_openssl_incdir /usr/local/ssl/include" + esac + case "$with_openssl_incdir" in no) - echo "" - echo "did not find openssl/evp.h in any of $ans" - ans=no - OPENSSL_INC= ;; - *) ans=$i - OPENSSL_INC=$ans + *) # look for openssl/evp.h: + for i in $with_openssl_incdir no + do + test -f $i/openssl/evp.h && break + done + openssl_incdir=$i ;; esac - ;; -esac -AS_UNSET([pkgans]) -AC_MSG_RESULT([$ans]) - -AC_MSG_CHECKING([if we will use crypto]) -AC_ARG_WITH( - [crypto], - [AS_HELP_STRING( - [--with-crypto], - [+ =openssl] - )], - [ans=$withval], - [ans=yes] -) -case "$ans" in - no) - ;; - yes|openssl) - if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC" + AS_UNSET([i]) + AC_MSG_RESULT([$openssl_incdir]) + case "$openssl_incdir" in + no) + openssl_incdir= + AC_MSG_WARN([did not find openssl/evp.h in any of $with_openssl_incdir]) + esac + if test -z "$openssl_libdir" -o -z "$openssl_incdir" then - ans=no + ntp_openssl=no else - ans=yes + ntp_openssl=yes fi + case "$ntp_openssl" in + yes) + # We have OpenSSL inc/lib dirs - use them. + case "$openssl_incdir" in + /usr/include) + ;; + *) + CPPFLAGS_NTP="$CPPFLAGS_NTP -I$openssl_incdir" + ;; + esac + case "$openssl_libdir" in + /usr/lib) + ;; + *) + LDFLAGS_NTP="$LDFLAGS_NTP -L$openssl_libdir" + case "$need_dash_r" in + 1) + LDFLAGS="$LDFLAGS -R$openssl_libdir" + esac + ;; + esac + LDADD_NTP="$LDADD_NTP -lcrypto" + esac esac -ntp_openssl=$ans -AC_MSG_RESULT([$ans]) + +AC_MSG_CHECKING([if we will use crypto]) +AC_MSG_RESULT([$ntp_openssl]) case "$ntp_openssl" in yes) - # We have OpenSSL inc/lib - use them. - case "$OPENSSL_INC" in - /usr/include) - ;; - *) - CPPFLAGS_NTP="$CPPFLAGS_NTP -I$OPENSSL_INC" - ;; - esac - case "$OPENSSL_LIB" in - /usr/lib) - ;; - *) - LDFLAGS="$LDFLAGS -L$OPENSSL_LIB" - case "$need_dash_r" in - 1) - LDFLAGS="$LDFLAGS -R$OPENSSL_LIB" - esac - ;; - esac - LCRYPTO="-lcrypto" - AC_DEFINE([OPENSSL], [1], [Use OpenSSL?]) + AC_DEFINE([OPENSSL], [], [Use OpenSSL?]) esac NTPO_SAVED_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP" NTPO_SAVED_LIBS="$LIBS" # # check for linking with -lcrypto failure, and try -lcrypto -lz. # Helps m68k-atari-mint # -case "$ntp_openssl" in - yes) - CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP" - LIBS="$NTPO_SAVED_LIBS $LCRYPTO" +case "$ntp_openssl:$ntp_openssl_from_pkg_config" in + yes:no) + LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" AC_CACHE_CHECK( - [if linking with $LCRYPTO alone works], + [if linking with -lcrypto alone works], [ntp_cv_bare_lcrypto], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -251,9 +237,9 @@ case "$ntp_openssl" in ) case "$ntp_cv_bare_lcrypto" in no) - LIBS="$NTPO_SAVED_LIBS $LCRYPTO -lz" + LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz" AC_CACHE_CHECK( - [if linking with $LCRYPTO -lz works], + [if linking with -lcrypto -lz works], [ntp_cv_lcrypto_lz], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -272,7 +258,7 @@ case "$ntp_openssl" in ) case "$ntp_cv_lcrypto_lz" in yes) - LCRYPTO="$LCRYPTO -lz" + LDADD_NTP="$LDADD_NTP -lz" esac esac esac @@ -291,10 +277,10 @@ esac # # openssl_triggers_warnings=unknown -SAVED_CFLAGS="$CFLAGS" +NTPO_SAVED_CFLAGS="$CFLAGS" -case "$GCC$ntp_openssl" in - yesyes) +case "$ntp_openssl:$GCC" in + yes:yes) CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -342,16 +328,18 @@ case "$GCC$ntp_openssl" in CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes" esac ;; - yesno) + no:yes) # gcc without OpenSSL CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes" esac -CFLAGS="$SAVED_CFLAGS" +CFLAGS="$NTPO_SAVED_CFLAGS" CPPFLAGS="$NTPO_SAVED_CPPFLAGS" LIBS="$NTPO_SAVED_LIBS" -AS_UNSET([SAVED_CFLAGS]) +AS_UNSET([NTPO_SAVED_CFLAGS]) AS_UNSET([NTPO_SAVED_CPPFLAGS]) AS_UNSET([NTPO_SAVED_LIBS]) +AS_UNSET([openssl_triggers_warnings]) +AS_UNSET([ntp_openssl_from_pkg_config]) ]) dnl ====================================================================== diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index f73b550d1..911756436 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -60,7 +60,7 @@ LDADD = \ $(LDADD_LIBEVENT) \ $(top_builddir)/../libntp/libntp.a \ $(LDADD_LIBNTP) \ - $(LCRYPTO) \ + $(LDADD_NTP) \ $(GTEST_LDFLAGS) \ $(GTEST_LIBS) \ $(NULL) @@ -76,6 +76,8 @@ AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT) AM_CPPFLAGS += $(GTEST_CPPFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + TESTS = TEST_INPUT_DIR = $(abs_srcdir)/data diff --git a/tests/libntp/Makefile.am b/tests/libntp/Makefile.am index 431f08cfc..de6067595 100644 --- a/tests/libntp/Makefile.am +++ b/tests/libntp/Makefile.am @@ -8,7 +8,7 @@ LDADD = \ $(top_builddir)/libntp/libntp.a \ $(LDADD_LIBNTP) \ $(PTHREAD_LIBS) \ - $(LCRYPTO) \ + $(LDADD_NTP) \ $(GTEST_LDFLAGS) \ $(GTEST_LIBS) \ $(NULL) @@ -21,6 +21,8 @@ AM_CPPFLAGS += -I$(top_srcdir)/sntp AM_CPPFLAGS += $(GTEST_CPPFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \ libntptest.cpp \ a_md5encrypt.cpp \ diff --git a/util/Makefile.am b/util/Makefile.am index b8f1ce9d6..f8f76c3b4 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -13,11 +13,13 @@ AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(LIBOPTS_CFLAGS) AM_CPPFLAGS += $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) + # LDADD might need RESLIB and ADJLIB LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a -ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LCRYPTO) +ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h tickadj_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LDADD_NLIST)