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.
This commit is contained in:
parent
6cbbcee6b6
commit
4da1fd6159
|
@ -30,7 +30,7 @@ pcap-config \- write libpcap compiler and linker flags to standard output
|
||||||
.B \-\-static
|
.B \-\-static
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
.B \-\-cflags | \-\-libs
|
.B \-\-cflags | \-\-libs | \-\-additional-libs
|
||||||
]
|
]
|
||||||
.ad
|
.ad
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
@ -50,9 +50,20 @@ writes to the standard output the
|
||||||
.B \-L
|
.B \-L
|
||||||
and
|
and
|
||||||
.B \-l
|
.B \-l
|
||||||
linker required to link with libpcap, including
|
linker flags required to link with libpcap, including
|
||||||
.B \-l
|
.B \-l
|
||||||
flags for libraries required by libpcap.
|
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
|
.LP
|
||||||
By default, it writes flags appropriate for compiling with a
|
By default, it writes flags appropriate for compiling with a
|
||||||
dynamically-linked version of libpcap; the
|
dynamically-linked version of libpcap; the
|
||||||
|
|
|
@ -22,6 +22,10 @@ do
|
||||||
--libs)
|
--libs)
|
||||||
show_libs=1
|
show_libs=1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--additional-libs)
|
||||||
|
show_additional_libs=1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
@ -34,12 +38,18 @@ then
|
||||||
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
|
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
|
||||||
then
|
then
|
||||||
echo "-I @includedir@ -L @libdir@ -lpcap @DEPLIBS@"
|
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 ]
|
elif [ "$show_cflags" = 1 ]
|
||||||
then
|
then
|
||||||
echo "-I @includedir@"
|
echo "-I @includedir@"
|
||||||
elif [ "$show_libs" = 1 ]
|
elif [ "$show_libs" = 1 ]
|
||||||
then
|
then
|
||||||
echo "-L @libdir@ -lpcap @DEPLIBS@"
|
echo "-L @libdir@ -lpcap @DEPLIBS@"
|
||||||
|
elif [ "$show_additional_libs" = 1 ]
|
||||||
|
then
|
||||||
|
echo "@DEPLIBS@"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
#
|
#
|
||||||
|
@ -49,6 +59,9 @@ else
|
||||||
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
|
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
|
||||||
then
|
then
|
||||||
echo "-I @includedir@ -L @libdir@ -lpcap"
|
echo "-I @includedir@ -L @libdir@ -lpcap"
|
||||||
|
elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
|
||||||
|
then
|
||||||
|
echo "-I @includedir@"
|
||||||
elif [ "$show_cflags" = 1 ]
|
elif [ "$show_cflags" = 1 ]
|
||||||
then
|
then
|
||||||
echo "-I @includedir@"
|
echo "-I @includedir@"
|
||||||
|
|
Reference in New Issue