aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libpcap/libpcap/pcap-config
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-10 14:59:18 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-10 14:59:18 -0400
commit741efd6ee2f0defb40def8351d3f5a92fc0ab7c8 (patch)
treedcc3711c179264f1b74f97aa606907f52a8066a0 /lib/libpcap/libpcap/pcap-config
parent0d0ad219a6366e30e1b1ae41f79c8e10a21ade6d (diff)
parentd7dbd335bfc76ace0a0d3a13a5ba83b7c6734bfc (diff)
downloadapple_cmds-741efd6ee2f0defb40def8351d3f5a92fc0ab7c8.tar.gz
apple_cmds-741efd6ee2f0defb40def8351d3f5a92fc0ab7c8.tar.zst
apple_cmds-741efd6ee2f0defb40def8351d3f5a92fc0ab7c8.zip
Merge branch 'apple'
Diffstat (limited to 'lib/libpcap/libpcap/pcap-config')
-rw-r--r--lib/libpcap/libpcap/pcap-config89
1 files changed, 89 insertions, 0 deletions
diff --git a/lib/libpcap/libpcap/pcap-config b/lib/libpcap/libpcap/pcap-config
new file mode 100644
index 0000000..ec9e8f1
--- /dev/null
+++ b/lib/libpcap/libpcap/pcap-config
@@ -0,0 +1,89 @@
+#! /bin/sh
+
+#
+# Script to give the appropriate compiler flags and linker flags
+# to use when building code that uses libpcap.
+#
+prefix="/usr/local"
+exec_prefix="${prefix}"
+includedir="${prefix}/include"
+libdir="${exec_prefix}/lib"
+V_RPATH_OPT=""
+LIBS=""
+
+static=0
+show_cflags=0
+show_libs=0
+while [ "$#" != 0 ]
+do
+ case "$1" in
+
+ --static)
+ static=1
+ ;;
+
+ --cflags)
+ show_cflags=1
+ ;;
+
+ --libs)
+ show_libs=1
+ ;;
+
+ --additional-libs)
+ show_additional_libs=1
+ ;;
+ esac
+ shift
+done
+if [ "$V_RPATH_OPT" != "" ]
+then
+ #
+ # If libdir isn't /usr/lib, add it to the run-time linker path.
+ #
+ if [ "$libdir" != "/usr/lib" ]
+ then
+ RPATH=$V_RPATH_OPT$libdir
+ fi
+fi
+if [ "$static" = 1 ]
+then
+ #
+ # Include LIBS so that the flags include libraries containing
+ # routines that libpcap uses.
+ #
+ if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
+ then
+ echo "-I$includedir -L$libdir -lpcap $LIBS"
+ elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+ then
+ echo "-I$includedir -L$libdir $LIBS"
+ elif [ "$show_cflags" = 1 ]
+ then
+ echo "-I$includedir"
+ elif [ "$show_libs" = 1 ]
+ then
+ echo "-L$libdir -lpcap $LIBS"
+ elif [ "$show_additional_libs" = 1 ]
+ then
+ echo "$LIBS"
+ fi
+else
+ #
+ # Omit LIBS - libpcap is assumed to be linked with those
+ # libraries, so there's no need to do so explicitly.
+ #
+ if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
+ then
+ echo "-I$includedir -L$libdir $RPATH -lpcap"
+ elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+ then
+ echo "-I$includedir"
+ elif [ "$show_cflags" = 1 ]
+ then
+ echo "-I$includedir"
+ elif [ "$show_libs" = 1 ]
+ then
+ echo "-L$libdir $RPATH -lpcap"
+ fi
+fi