diff options
| author | guy <guy> | 2002-12-17 09:55:14 +0000 |
|---|---|---|
| committer | guy <guy> | 2002-12-17 09:55:14 +0000 |
| commit | c284d10cf4a5a2732b6a08036438f8b7611d67fb (patch) | |
| tree | 48b12e0fdb66a4eeb044b8a2199ee163e0bea8d9 | |
| parent | 46c77e78ffea6a3414fd38883c3b2ee20c3e9861 (diff) | |
| download | tcpdump-c284d10cf4a5a2732b6a08036438f8b7611d67fb.tar.gz | |
If we're not using a local libpcap, check to see whether "pcap.h" is
hidden in a "pcap" subdirectory of "/usr/include" or
"/usr/local/include" and, if so, add a "-I" flag to search in that
subdirectory, so we manage to find "pcap.h", as Red Hat decided to
"improve" things by putting "pcap.h" in "/usr/include/pcap" (that's
probably where libpcap should have put it originally, but moving it now
just breaks source compatibility).
| -rw-r--r-- | aclocal.m4 | 32 | ||||
| -rwxr-xr-x | configure | 141 |
2 files changed, 117 insertions, 56 deletions
@@ -1,4 +1,4 @@ -dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.89 2002-09-05 21:25:35 guy Exp $ (LBL) +dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.90 2002-12-17 09:55:14 guy Exp $ (LBL) dnl dnl Copyright (c) 1995, 1996, 1997, 1998 dnl The Regents of the University of California. All rights reserved. @@ -257,6 +257,36 @@ AC_DEFUN(AC_LBL_LIBPCAP, if test $libpcap = FAIL ; then AC_MSG_ERROR(see the INSTALL doc for more info) fi + # + # Good old Red Hat Linux puts "pcap.h" in + # "/usr/include/pcap"; had the LBL folks done so, + # that would have been a good idea, but for + # the Red Hat folks to do so just breaks source + # compatibility with other systems. + # + # We work around this by assuming that, as we didn't + # find a local libpcap, libpcap is in /usr/lib or + # /usr/local/lib and that the corresponding header + # file is under one of those directories; if we don't + # find it in either of those directories, we check to + # see if it's in a "pcap" subdirectory of them and, + # if so, add that subdirectory to the "-I" list. + # + AC_MSG_CHECKING(for extraneous pcap header directories) + if ! test \( -r /usr/local/include/pcap.h -o \ + -r /usr/include/pcap.h \); then + if test -r /usr/local/include/pcap/pcap.h; then + d="/usr/local/include/pcap" + elif test -r /usr/include/pcap/pcap.h; then + d="/usr/include/pcap" + fi + fi + if test -z $d ; then + AC_MSG_RESULT(not found) + else + $2="-I$d $$2" + AC_MSG_RESULT(found -- -I$d added) + fi else $1=$libpcap places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ @@ -3919,6 +3919,37 @@ fi if test $libpcap = FAIL ; then { echo "configure: error: see the INSTALL doc for more info" 1>&2; exit 1; } fi + # + # Good old Red Hat Linux puts "pcap.h" in + # "/usr/include/pcap"; had the LBL folks done so, + # that would have been a good idea, but for + # the Red Hat folks to do so just breaks source + # compatibility with other systems. + # + # We work around this by assuming that, as we didn't + # find a local libpcap, libpcap is in /usr/lib or + # /usr/local/lib and that the corresponding header + # file is under one of those directories; if we don't + # find it in either of those directories, we check to + # see if it's in a "pcap" subdirectory of them and, + # if so, add that subdirectory to the "-I" list. + # + echo $ac_n "checking for extraneous pcap header directories""... $ac_c" 1>&6 +echo "configure:3939: checking for extraneous pcap header directories" >&5 + if ! test \( -r /usr/local/include/pcap.h -o \ + -r /usr/include/pcap.h \); then + if test -r /usr/local/include/pcap/pcap.h; then + d="/usr/local/include/pcap" + elif test -r /usr/include/pcap/pcap.h; then + d="/usr/include/pcap" + fi + fi + if test -z $d ; then + echo "$ac_t""not found" 1>&6 + else + V_INCLS="-I$d $V_INCLS" + echo "$ac_t""found -- -I$d added" 1>&6 + fi else V_PCAPDEP=$libpcap places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ @@ -3938,7 +3969,7 @@ fi aix*) pseexe="/lib/pse.exp" echo $ac_n "checking for $pseexe""... $ac_c" 1>&6 -echo "configure:3942: checking for $pseexe" >&5 +echo "configure:3973: checking for $pseexe" >&5 if test -f $pseexe ; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -I:$pseexe" @@ -3949,12 +3980,12 @@ echo "configure:3942: checking for $pseexe" >&5 for ac_func in pcap_findalldevs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3953: checking for $ac_func" >&5 +echo "configure:3984: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3958 "configure" +#line 3989 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3977,7 +4008,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4002,9 +4033,9 @@ fi done echo $ac_n "checking whether pcap_version is defined by libpcap""... $ac_c" 1>&6 -echo "configure:4006: checking whether pcap_version is defined by libpcap" >&5 +echo "configure:4037: checking whether pcap_version is defined by libpcap" >&5 cat > conftest.$ac_ext <<EOF -#line 4008 "configure" +#line 4039 "configure" #include "confdefs.h" int main() { @@ -4019,7 +4050,7 @@ return_pcap_version(void) ; return 0; } EOF -if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_lbl_cv_pcap_version_defined=yes else @@ -4039,9 +4070,9 @@ else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether pcap_debug is defined by libpcap""... $ac_c" 1>&6 -echo "configure:4043: checking whether pcap_debug is defined by libpcap" >&5 +echo "configure:4074: checking whether pcap_debug is defined by libpcap" >&5 cat > conftest.$ac_ext <<EOF -#line 4045 "configure" +#line 4076 "configure" #include "confdefs.h" int main() { @@ -4056,7 +4087,7 @@ return_pcap_debug(void) ; return 0; } EOF -if { (eval echo configure:4060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_lbl_cv_pcap_debug_defined=yes else @@ -4078,9 +4109,9 @@ else # OK, what about "yydebug"? # echo $ac_n "checking whether yydebug is defined by libpcap""... $ac_c" 1>&6 -echo "configure:4082: checking whether yydebug is defined by libpcap" >&5 +echo "configure:4113: checking whether yydebug is defined by libpcap" >&5 cat > conftest.$ac_ext <<EOF -#line 4084 "configure" +#line 4115 "configure" #include "confdefs.h" int main() { @@ -4095,7 +4126,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_lbl_cv_yydebug_defined=yes else @@ -4118,12 +4149,12 @@ fi for ac_func in bpf_dump do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4122: checking for $ac_func" >&5 +echo "configure:4153: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4127 "configure" +#line 4158 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4146,7 +4177,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4203,12 +4234,12 @@ if test -f /dev/bpf0 ; then fi echo $ac_n "checking for int8_t using $CC""... $ac_c" 1>&6 -echo "configure:4207: checking for int8_t using $CC" >&5 +echo "configure:4238: checking for int8_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_int8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4212 "configure" +#line 4243 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4221,7 +4252,7 @@ int main() { int8_t i ; return 0; } EOF -if { (eval echo configure:4225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_int8_t=yes else @@ -4241,12 +4272,12 @@ EOF fi echo $ac_n "checking for u_int8_t using $CC""... $ac_c" 1>&6 -echo "configure:4245: checking for u_int8_t using $CC" >&5 +echo "configure:4276: checking for u_int8_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4250 "configure" +#line 4281 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4259,7 +4290,7 @@ int main() { u_int8_t i ; return 0; } EOF -if { (eval echo configure:4263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_u_int8_t=yes else @@ -4279,12 +4310,12 @@ EOF fi echo $ac_n "checking for int16_t using $CC""... $ac_c" 1>&6 -echo "configure:4283: checking for int16_t using $CC" >&5 +echo "configure:4314: checking for int16_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4288 "configure" +#line 4319 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4297,7 +4328,7 @@ int main() { int16_t i ; return 0; } EOF -if { (eval echo configure:4301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_int16_t=yes else @@ -4317,12 +4348,12 @@ EOF fi echo $ac_n "checking for u_int16_t using $CC""... $ac_c" 1>&6 -echo "configure:4321: checking for u_int16_t using $CC" >&5 +echo "configure:4352: checking for u_int16_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4326 "configure" +#line 4357 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4335,7 +4366,7 @@ int main() { u_int16_t i ; return 0; } EOF -if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_u_int16_t=yes else @@ -4355,12 +4386,12 @@ EOF fi echo $ac_n "checking for int32_t using $CC""... $ac_c" 1>&6 -echo "configure:4359: checking for int32_t using $CC" >&5 +echo "configure:4390: checking for int32_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4364 "configure" +#line 4395 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4373,7 +4404,7 @@ int main() { int32_t i ; return 0; } EOF -if { (eval echo configure:4377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_int32_t=yes else @@ -4393,12 +4424,12 @@ EOF fi echo $ac_n "checking for u_int32_t using $CC""... $ac_c" 1>&6 -echo "configure:4397: checking for u_int32_t using $CC" >&5 +echo "configure:4428: checking for u_int32_t using $CC" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4402 "configure" +#line 4433 "configure" #include "confdefs.h" # include "confdefs.h" @@ -4411,7 +4442,7 @@ int main() { u_int32_t i ; return 0; } EOF -if { (eval echo configure:4415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_have_u_int32_t=yes else @@ -4471,12 +4502,12 @@ EOF fi echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6 -echo "configure:4475: checking if sockaddr struct has sa_len member" >&5 +echo "configure:4506: checking if sockaddr struct has sa_len member" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4480 "configure" +#line 4511 "configure" #include "confdefs.h" # include <sys/types.h> @@ -4485,7 +4516,7 @@ int main() { u_int i = sizeof(((struct sockaddr *)0)->sa_len) ; return 0; } EOF -if { (eval echo configure:4489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_lbl_sockaddr_has_sa_len=yes else @@ -4506,7 +4537,7 @@ EOF fi echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 -echo "configure:4510: checking if unaligned accesses fail" >&5 +echo "configure:4541: checking if unaligned accesses fail" >&5 if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4571,12 +4602,12 @@ EOF echo $ac_n "checking for h_errno""... $ac_c" 1>&6 -echo "configure:4575: checking for h_errno" >&5 +echo "configure:4606: checking for h_errno" >&5 if eval "test \"`echo '$''{'ac_cv_var_h_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4580 "configure" +#line 4611 "configure" #include "confdefs.h" # include <sys/types.h> @@ -4585,7 +4616,7 @@ int main() { int foo = h_errno; ; return 0; } EOF -if { (eval echo configure:4589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_var_h_errno=yes else @@ -4613,7 +4644,7 @@ if test "${with_crypto+set}" = set; then else echo $ac_n "checking for SSLeay""... $ac_c" 1>&6 -echo "configure:4617: checking for SSLeay" >&5 +echo "configure:4648: checking for SSLeay" >&5 ac_cv_ssleay_path=no incdir=no for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do @@ -4641,7 +4672,7 @@ if test "$ac_cv_ssleay_path" != no; then LIBS="$LIBS -lrsaref" fi echo $ac_n "checking for des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6 -echo "configure:4645: checking for des_cbc_encrypt in -lcrypto" >&5 +echo "configure:4676: checking for des_cbc_encrypt in -lcrypto" >&5 ac_lib_var=`echo crypto'_'des_cbc_encrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4649,7 +4680,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <<EOF -#line 4653 "configure" +#line 4684 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4660,7 +4691,7 @@ int main() { des_cbc_encrypt() ; return 0; } EOF -if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4694,17 +4725,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4698: checking for $ac_hdr" >&5 +echo "configure:4729: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4703 "configure" +#line 4734 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4733,7 +4764,7 @@ done if test "$ac_cv_header_openssl_cast_h" = "yes"; then echo $ac_n "checking for buggy CAST128""... $ac_c" 1>&6 -echo "configure:4737: checking for buggy CAST128" >&5 +echo "configure:4768: checking for buggy CAST128" >&5 if eval "test \"`echo '$''{'td_cv_buggy_cast128'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4741,7 +4772,7 @@ else td_cv_buggy_cast128="cross-compiling, assume yes" else cat > conftest.$ac_ext <<EOF -#line 4745 "configure" +#line 4776 "configure" #include "confdefs.h" #include <openssl/cast.h> @@ -4760,7 +4791,7 @@ main() return 1; } EOF -if { (eval echo configure:4764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then td_cv_buggy_cast128=yes else @@ -4794,17 +4825,17 @@ for ac_hdr in openssl/rc5.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4798: checking for $ac_hdr" >&5 +echo "configure:4829: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4803 "configure" +#line 4834 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4849,7 +4880,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4853: checking for a BSD compatible install" >&5 +echo "configure:4884: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 |
