]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Allow for version suffix in libevent in ntp_libevent.m4
authorHarlan Stenn <stenn@ntp.org>
Sat, 28 Jun 2014 09:00:22 +0000 (05:00 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 28 Jun 2014 09:00:22 +0000 (05:00 -0400)
bk: 53ae8426Ki8v2EeSadTVb094U0zO6Q

ChangeLog
sntp/m4/ntp_libevent.m4

index 3bb9a75db4c7d1ccb78cc319732314ea5a9525e6..2fae3a00c5b5c71904f7869c981e1a1e66ac7535 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 * [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG().
   Provide missing msyslog() message in crypto_alice().
 * Fix a variable lifetime issue.
+* Allow for version suffix in libevent in ntp_libevent.m4.
 (4.2.7p445) 2014/06/12 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2556] mrulist isn't mentioned in the ntpq man page.
 (4.2.7p444) 2014/05/19 Released by Harlan Stenn <stenn@ntp.org>
index 168f398e3c26efbe05a30b2eab2cb538b90cc311..5f81ae90576c5ef51f558606a3615f7d5b46355b 100644 (file)
@@ -58,7 +58,25 @@ case "$ntp_use_local_libevent" in
            ntp_use_local_libevent=no
            AC_MSG_NOTICE([Using the installed libevent])
            CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
-           LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+           # HMS: I hope the following is accurate.
+           # We don't need -levent, we only need  -levent_core.
+           # While we could grab only the -L stuff, there *might* be
+           # other flags there we want.  Originally we just removed -levent
+           # but then somebody decided to install -levent-2.0
+           # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+           # So now we dance...
+           LDADD_LIBEVENT=
+           for i in `$PKG_CONFIG --libs libevent`
+           do
+               case "$i" in
+                -levent*) ;;
+                *) case "$LDADD_LIBEVENT" in
+                    '') LDADD_LIBEVENT="$i" ;;
+                    *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
+                   esac
+                   ;;
+               esac
+           done
            case "$LIBISC_PTHREADS_NOTHREADS" in
             pthreads)
                LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"