diff options
author | Guy Harris <gharris@sonic.net> | 2020-07-19 20:12:32 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-07-19 20:12:32 -0700 |
commit | daff285ecf3cc42769075aa97b072116b9494494 (patch) | |
tree | ae966a170c8da571204f1969db68f17cdb985abc /aclocal.m4 | |
parent | 3af5630a29ebce1432ba13b59a597b86340604e6 (diff) | |
download | tcpdump-daff285ecf3cc42769075aa97b072116b9494494.tar.gz |
autoconf: replace --with-system-libpcap with --disable-local-libpcap.
--with-system-libpcap didn't work - it didn't prevent searching for a
local libpcap - and had a misleading name. Replace it with
--disable-local-libpcap.
This should address GitHub issue #823.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 93 |
1 files changed, 51 insertions, 42 deletions
@@ -472,52 +472,61 @@ AC_DEFUN(AC_LBL_LIBPCAP, fi fi libpcap=FAIL - AC_ARG_WITH([system-libpcap], - [AS_HELP_STRING([--with-system-libpcap], [don't use local pcap library])], - [ + AC_MSG_CHECKING([whether to look for a local libpcap]) + AC_ARG_ENABLE(local-libpcap, + AS_HELP_STRING([--disable-local-libpcap], + [don't look for a local libpcap @<:@default=check for a local libpcap@:>@]),, + enableval=yes) + case "$enableval" in + + no) + AC_MSG_RESULT(no) + # + # Don't look for a local libpcap. + # + using_local_libpcap=no + ;; + + *) + AC_MSG_RESULT(yes) + # + # Look for a local pcap library. + # + AC_MSG_CHECKING(for local pcap library) + lastdir=FAIL + places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'` + places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'` + for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do + basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \ + sed -e 's/-PRE-GIT$//' ` + if test $lastdir = $basedir ; then + dnl skip alphas when an actual release is present + continue; + fi + lastdir=$dir + if test -r $dir/libpcap.a ; then + libpcap=$dir/libpcap.a + local_pcap_dir=$dir + dnl continue and select the last one that exists + fi + done + if test $libpcap = FAIL ; then # - # Don't look for a local libpcap. + # We didn't find a local libpcap. # - using_local_libpcap=no - ], - [ + AC_MSG_RESULT(not found) + using_local_libpcap=no; + else # - # Look for a local pcap library. + # We found a local libpcap. # - AC_MSG_CHECKING(for local pcap library) - lastdir=FAIL - places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'` - places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'` - for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do - basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \ - sed -e 's/-PRE-GIT$//' ` - if test $lastdir = $basedir ; then - dnl skip alphas when an actual release is present - continue; - fi - lastdir=$dir - if test -r $dir/libpcap.a ; then - libpcap=$dir/libpcap.a - local_pcap_dir=$dir - dnl continue and select the last one that exists - fi - done - if test $libpcap = FAIL ; then - # - # We didn't find a local libpcap. - # - AC_MSG_RESULT(not found) - using_local_libpcap=no; - else - # - # We found a local libpcap. - # - AC_MSG_RESULT($libpcap) - using_local_libpcap=yes - fi - ]) + AC_MSG_RESULT($libpcap) + using_local_libpcap=yes + fi + ;; + esac if test $using_local_libpcap = no ; then # |