Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / libpcap / pcap-config
blobdf3d6556da4908f0b167e9ae1d808664fc7f4ce5
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="/usr"
8 exec_prefix="${prefix}"
9 includedir="${prefix}/include"
10 libdir="${exec_prefix}/lib"
11 V_RPATH_OPT="-Wl,-rpath,"
12 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 [ "$static" = 1 ]
50 then
52 # Include LIBS so that the flags include libraries containing
53 # routines that libpcap uses.
55 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
56 then
57 echo "-I$includedir -L$libdir -lpcap $LIBS"
58 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
59 then
60 echo "-I$includedir -L$libdir $LIBS"
61 elif [ "$show_cflags" = 1 ]
62 then
63 echo "-I$includedir"
64 elif [ "$show_libs" = 1 ]
65 then
66 echo "-L$libdir -lpcap $LIBS"
67 elif [ "$show_additional_libs" = 1 ]
68 then
69 echo "$LIBS"
71 else
73 # Omit LIBS - libpcap is assumed to be linked with those
74 # libraries, so there's no need to do so explicitly.
76 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
77 then
78 echo "-I$includedir -L$libdir $RPATH -lpcap"
79 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
80 then
81 echo "-I$includedir"
82 elif [ "$show_cflags" = 1 ]
83 then
84 echo "-I$includedir"
85 elif [ "$show_libs" = 1 ]
86 then
87 echo "-L$libdir $RPATH -lpcap"