Subject: [PATCH] libpcap: pkgconfig support

From: Fabio Berton <[email-masked]>
Date: Thu, 3 Nov 2016 17:56:29 -0200

Adding basic structure to support pkg-config.

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Joe MacDonald <[email-masked]>
Signed-off-by: Fabio Berton <[email-masked]>
---
 Makefile.in   |  5 +++++
 configure.ac  |  1 +
 libpcap.pc.in | 10 ++++++++++
 3 files changed, 16 insertions(+)
 create mode 100644 libpcap.pc.in

diff --git a/Makefile.in b/Makefile.in
index e71d973..d7004ed 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -61,6 +61,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
 PROG=libpcap
 
+# pkgconfig support
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libpcap.pc
+
 # Standard CFLAGS
 FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
 
@@ -286,6 +290,7 @@ EXTRA_DIST = \
 	lbl/os-solaris2.h \
 	lbl/os-sunos4.h \
 	lbl/os-ultrix4.h \
+	libpcap.pc \
 	missing/getopt.c \
 	missing/getopt.h \
 	missing/snprintf.c \
diff --git a/configure.ac b/configure.ac
index da2f940..4fc67bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1805,6 +1805,7 @@ fi
 AC_PROG_INSTALL
 
 AC_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([libpcap.pc])
 
 AC_OUTPUT_COMMANDS([if test -f .devel; then
 	echo timestamp > stamp-h
diff --git a/libpcap.pc.in b/libpcap.pc.in
new file mode 100644
index 0000000..4f78ad8
--- /dev/null
+++ b/libpcap.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libpcap
+Description: System-independent interface for user-level packet capture.
+Version: @VERSION@
+Libs: -L${libdir} -lpcap
+Cflags: -I${includedir}
-- 
2.1.4