4 # Script to give the appropriate compiler flags and linker flags
5 # to use when building code that uses libpcap.
8 exec_prefix
="@exec_prefix@"
9 includedir
="@includedir@"
11 V_RPATH_OPT
="@V_RPATH_OPT@"
34 show_additional_libs
=1
39 if [ "$V_RPATH_OPT" != "" ]
42 # If libdir isn't /usr/lib, add it to the run-time linker path.
44 if [ "$libdir" != "/usr/lib" ]
46 RPATH
=$V_RPATH_OPT$libdir
49 if [ "@includedir@" != "/usr/include" ]
53 if [ "@libdir@" != "/usr/lib" ]
65 # Include LIBS so that the flags include libraries containing
66 # routines that libpcap uses.
68 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
70 echo "-I$includedir -L$libdir -lpcap $LIBS"
71 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
73 echo "-I$includedir -L$libdir $LIBS"
74 elif [ "$show_cflags" = 1 ]
77 elif [ "$show_libs" = 1 ]
79 echo "-L$libdir -lpcap $LIBS"
80 elif [ "$show_additional_libs" = 1 ]
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 ]
91 echo "-I$includedir -L$libdir $RPATH -lpcap"
92 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
95 elif [ "$show_cflags" = 1 ]
98 elif [ "$show_libs" = 1 ]
100 echo "-L$libdir $RPATH -lpcap"