etc/protocols - sync with NetBSD-8
[minix.git] / external / bsd / libpcap / dist / pcap-config.in
blobf503f3a16f21e229430770868fbf45b9b0b75c11
1 #! /bin/sh
4 # Script to give the appropriate compiler flags and linker flags
5 # to use when building code that uses libpcap.
7 prefix="@prefix@"
8 exec_prefix="@exec_prefix@"
9 includedir="@includedir@"
10 libdir="@libdir@"
11 V_RPATH_OPT="@V_RPATH_OPT@"
12 LIBS="@LIBS@"
14 static=0
15 show_cflags=0
16 show_libs=0
17 while [ "$#" != 0 ]
19 case "$1" in
21 --static)
22 static=1
25 --cflags)
26 show_cflags=1
29 --libs)
30 show_libs=1
33 --additional-libs)
34 show_additional_libs=1
36 esac
37 shift
38 done
39 if [ "$V_RPATH_OPT" != "" ]
40 then
42 # If libdir isn't /usr/lib, add it to the run-time linker path.
44 if [ "$libdir" != "/usr/lib" ]
45 then
46 RPATH=$V_RPATH_OPT$libdir
49 if [ "@includedir@" != "/usr/include" ]
50 then
51 i="-I@includedir@"
53 if [ "@libdir@" != "/usr/lib" ]
54 then
55 l="-L@libdir@"
57 if [ -n "@LIBS@" ]
58 then
59 L="@LIBS@"
62 if [ "$static" = 1 ]
63 then
65 # Include LIBS so that the flags include libraries containing
66 # routines that libpcap uses.
68 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
69 then
70 echo "-I$includedir -L$libdir -lpcap $LIBS"
71 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
72 then
73 echo "-I$includedir -L$libdir $LIBS"
74 elif [ "$show_cflags" = 1 ]
75 then
76 echo "-I$includedir"
77 elif [ "$show_libs" = 1 ]
78 then
79 echo "-L$libdir -lpcap $LIBS"
80 elif [ "$show_additional_libs" = 1 ]
81 then
82 echo "$LIBS"
84 else
86 # Omit LIBS - libpcap is assumed to be linked with those
87 # libraries, so there's no need to do so explicitly.
89 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
90 then
91 echo "-I$includedir -L$libdir $RPATH -lpcap"
92 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
93 then
94 echo "-I$includedir"
95 elif [ "$show_cflags" = 1 ]
96 then
97 echo "-I$includedir"
98 elif [ "$show_libs" = 1 ]
99 then
100 echo "-L$libdir $RPATH -lpcap"