Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a --additional-libs flag to pcap-config, to write out any additional

libraries needed to link with libpcap; this is to be used by tcpdump
when it's linking with ../libpcap/libpcap.a.
  • Loading branch information...
commit 4da1fd615902e1c1c302f5714025ccc184356dda 1 parent 6cbbcee
Guy Harris authored
Showing with 26 additions and 2 deletions.
  1. +13 −2 pcap-config.1
  2. +13 −0 pcap-config.in
View
15 pcap-config.1
@@ -30,7 +30,7 @@ pcap-config \- write libpcap compiler and linker flags to standard output
.B \-\-static
]
[
-.B \-\-cflags | \-\-libs
+.B \-\-cflags | \-\-libs | \-\-additional-libs
]
.ad
.SH DESCRIPTION
@@ -50,9 +50,20 @@ writes to the standard output the
.B \-L
and
.B \-l
-linker required to link with libpcap, including
+linker flags required to link with libpcap, including
.B \-l
flags for libraries required by libpcap.
+When run with the
+.B \-\-additional-libs
+option,
+.I pcap-config
+writes to the standard output the
+.B \-L
+and
+.B \-l
+flags for libraries required by libpcap, but not the
+.B \-lpcap
+flag to link with libpcap itself.
.LP
By default, it writes flags appropriate for compiling with a
dynamically-linked version of libpcap; the
View
13 pcap-config.in
@@ -22,6 +22,10 @@ do
--libs)
show_libs=1
;;
+
+ --additional-libs)
+ show_additional_libs=1
+ ;;
esac
shift
done
@@ -34,12 +38,18 @@ then
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
then
echo "-I @includedir@ -L @libdir@ -lpcap @DEPLIBS@"
+ elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+ then
+ echo "-I @includedir@ -L @libdir@ @DEPLIBS@"
elif [ "$show_cflags" = 1 ]
then
echo "-I @includedir@"
elif [ "$show_libs" = 1 ]
then
echo "-L @libdir@ -lpcap @DEPLIBS@"
+ elif [ "$show_additional_libs" = 1 ]
+ then
+ echo "@DEPLIBS@"
fi
else
#
@@ -49,6 +59,9 @@ else
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
then
echo "-I @includedir@ -L @libdir@ -lpcap"
+ elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+ then
+ echo "-I @includedir@"
elif [ "$show_cflags" = 1 ]
then
echo "-I @includedir@"
Please sign in to comment.
Something went wrong with that request. Please try again.