From 2796129af52901dd68595e5e88a639308541def9 Mon Sep 17 00:00:00 2001
From: Fabio Berton <fabio.berton@ossystems.com.br>
Date: Thu, 3 Nov 2016 17:56:29 -0200
Subject: [PATCH] libpcap: pkgconfig support
Organization: O.S. Systems Software LTDA.

Adding basic structure to support pkg-config.

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
 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

