aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/acinclude.m4
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-06-27 07:47:50 +0000
committerGuy Harris <guy@alum.mit.edu>2001-06-27 07:47:50 +0000
commitc9323454210aa2131ea32adef1cbe2e5dfa9fe5e (patch)
treedee8501a4f45ab0c42c252fb27d37a2b9bac7750 /wiretap/acinclude.m4
parent032f16e2ebfb529e6acb8d17dda834fd61fcea18 (diff)
Replace "--enable-pcap" with "--with-pcap", and if an argument is
specified to "--with-pcap", add that directory to the include file and library search paths, so that you can use "--with-pcap=DIR" to search for libpcap in a directory other than the standard ones (either because it was installed somewhere other than under "/usr" or "/usr/local", or because you want to use a special version you've installed rather than the standard one). svn path=/trunk/; revision=3611
Diffstat (limited to 'wiretap/acinclude.m4')
-rw-r--r--wiretap/acinclude.m456
1 files changed, 41 insertions, 15 deletions
diff --git a/wiretap/acinclude.m4 b/wiretap/acinclude.m4
index cb6c9b9b6e..050ab0d51e 100644
--- a/wiretap/acinclude.m4
+++ b/wiretap/acinclude.m4
@@ -2,7 +2,7 @@ dnl Macros that test for specific features.
dnl This file is part of the Autoconf packaging for Ethereal.
dnl Copyright (C) 1998-2000 by Gerald Combs.
dnl
-dnl $Id: acinclude.m4,v 1.7 2001/01/27 23:47:16 guy Exp $
+dnl $Id: acinclude.m4,v 1.8 2001/06/27 07:47:49 guy Exp $
dnl
# Configure paths for GLIB
@@ -207,22 +207,48 @@ main ()
#
AC_DEFUN(AC_WIRETAP_PCAP_CHECK,
[
- # Evidently, some systems have pcap.h, etc. in */include/pcap
- AC_MSG_CHECKING(for extraneous pcap header directories)
- found_pcap_dir=""
- for pcap_dir in /usr/include/pcap /usr/local/include/pcap $prefix/include
- do
- if test -d $pcap_dir ; then
- CFLAGS="$CFLAGS -I$pcap_dir"
- CPPFLAGS="$CPPFLAGS -I$pcap_dir"
- found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
- fi
- done
+ if test -z "$pcap_dir"
+ then
+ #
+ # The user didn't specify a directory in which libpcap resides;
+ # we assume that the current library search path will work,
+ # but we may have to look for the header in a "pcap"
+ # subdirectory of "/usr/include" or "/usr/local/include",
+ # as some systems apparently put "pcap.h" in a "pcap"
+ # subdirectory, and we also check "$prefix/include".
+ #
+ # XXX - should we just add "$prefix/include" to the include
+ # search path?
+ #
+ AC_MSG_CHECKING(for extraneous pcap header directories)
+ found_pcap_dir=""
+ for pcap_dir in /usr/include/pcap /usr/local/include/pcap $prefix/include
+ do
+ if test -d $pcap_dir ; then
+ CFLAGS="$CFLAGS -I$pcap_dir"
+ CPPFLAGS="$CPPFLAGS -I$pcap_dir"
+ found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
+ fi
+ done
- if test "$found_pcap_dir" != "" ; then
- AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
+ if test "$found_pcap_dir" != "" ; then
+ AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
+ else
+ AC_MSG_RESULT(not found)
+ fi
else
- AC_MSG_RESULT(not found)
+ #
+ # The user specified a directory in which libpcap resides,
+ # so add that directory to the search path.
+ #
+ # XXX - if there's also a libpcap in a directory that's
+ # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
+ # make us find the version in the specified directory,
+ # as the compiler and/or linker will search that other
+ # directory before it searches the specified directory.
+ #
+ CFLAGS="$CFLAGS -I$pcap_dir"
+ CPPFLAGS="$CPPFLAGS -I$pcap_dir"
fi
# Pcap header check