diff mbox series

[v4,4/9] linux-gen: stop poisoning CFLAGS/LIBS with libpcap flags

Message ID 1498888823-4065-5-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v4,1/9] pkgconfig: provide minimal proper static linking flags | expand

Commit Message

Github ODP bot July 1, 2017, 6 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Instead of poisoning global AM_CFLAGS/LIBS with libpcap flags,
use fine-grained controls for compiling/linking with libpcap.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 45 (lumag:m4)
 ** https://github.com/Linaro/odp/pull/45
 ** Patch: https://github.com/Linaro/odp/pull/45.patch
 ** Base sha: ceeab69f3af67701adb524c7b9757d19cefb1110
 ** Merge commit sha: eee6b6add9a03184bf2f3198f07e983bb88c0e0a
 **/
 configure.ac                          | 1 -
 pkgconfig/libodp-linux.pc.in          | 2 +-
 platform/linux-generic/Makefile.am    | 4 ++++
 platform/linux-generic/m4/odp_pcap.m4 | 8 ++++++--
 4 files changed, 11 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 3432b29a..8e518a16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -210,7 +210,6 @@  AC_SUBST([testdir])
 # Set conditionals as computed within platform specific files
 ##########################################################################
 AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ])
-AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
 AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"])
 AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
 AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
diff --git a/pkgconfig/libodp-linux.pc.in b/pkgconfig/libodp-linux.pc.in
index 6dc06dc9..860c1cae 100644
--- a/pkgconfig/libodp-linux.pc.in
+++ b/pkgconfig/libodp-linux.pc.in
@@ -7,5 +7,5 @@  Name: libodp-linux
 Description: The ODP packet processing engine
 Version: @PKGCONFIG_VERSION@
 Libs: -L${libdir} -lodp-linux @DPDK_LIBS@
-Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
+Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ @PCAP_LIBS@ @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
 Cflags: -I${includedir}
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 45bee7ea..a59d424f 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -260,6 +260,10 @@  __LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS)
 __LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS)
 __LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS)
 
+if HAVE_PCAP
+__LIB__libodp_linux_la_LIBADD += $(PCAP_LIBS)
+endif
+
 # Create symlink for ABI header files. Application does not need to use the arch
 # specific include path for installed files.
 install-data-hook:
diff --git a/platform/linux-generic/m4/odp_pcap.m4 b/platform/linux-generic/m4/odp_pcap.m4
index 0439c60b..ffdff17c 100644
--- a/platform/linux-generic/m4/odp_pcap.m4
+++ b/platform/linux-generic/m4/odp_pcap.m4
@@ -9,6 +9,10 @@  AC_CHECK_HEADER(pcap/pcap.h,
 [])
 
 if test $have_pcap == yes; then
-    AM_CFLAGS="$AM_CFLAGS -DHAVE_PCAP"
-    LIBS="$LIBS -lpcap"
+    ODP_CFLAGS="$AM_CFLAGS -DHAVE_PCAP"
+    PCAP_LIBS="-lpcap"
 fi
+
+AC_SUBST([PCAP_LIBS])
+
+AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])