Ethereal-dev: Re: [Ethereal-dev] autoconf patches to 0.8.16
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
Date: Thu, 8 Mar 2001 02:10:55 -0600
On Thu, Mar 08, 2001 at 12:03:32AM -0800, Guy Harris wrote:
> On Thu, Mar 08, 2001 at 01:57:22AM -0600, ethereal-dev@xxxxxxxxxxxxxxxxxx wrote:
> > BTW, should I AC_MSG_ERROR for --with-pcap=no in the top-level
> > ./configure?
>
> If by that you mean "should I cause the configure script to fail with an
> error message if the user specified '--with-pcap=no'", the answer is
> "no". As the autoconf documentation says:
>
> `--without-PACKAGE' is equivalent to `--with-PACKAGE=no'.
>
> and that would mean there'd be no way to force Ethereal *not* to be
> built with libpcap or libz.
Ok, here's a new acinclude.m4 and wiretap/acinclude.m4. Patches
against the original 0.8.16 versions.
--
albert chin (china@xxxxxxxxxxxxxxxxxx)
-- snip snip
--- acinclude.m4.orig Wed Mar 7 20:20:40 2001
+++ acinclude.m4 Thu Mar 8 01:45:39 2001
@@ -242,39 +242,67 @@
#
AC_DEFUN(AC_ETHEREAL_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 "$found_pcap_dir" != "" ; then
- AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
- else
- AC_MSG_RESULT(not found)
+ AC_ARG_WITH(pcap,
+ [ --with-pcap[=DIR] use libpcap for packet capturing (and
+ search DIR for includes/libraries) [default=yes]],[
+ case "${with_pcap}" in
+ no)
+ use_pcap=no
+ ;;
+ yes)
+ use_pcap=yes
+ ;;
+ *)
+ use_pcap=yes
+ if test -d "${with_pcap}"; then
+ CPPFLAGS="${CPPFLAGS} -I${with_pcap}/include"
+ LDFLAGS="${LDFLAGS} -L${with_pcap}/lib"
+ fi
+ ;;
+ esac
+ ],[
+ use_pcap=yes
+ ])
+
+ # if --with-pcap not set to a path, search in pre-defined locations
+ if test "${with_pcap}" = "yes"; then
+ # 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
+ CPPFLAGS="$CPPFLAGS -I$pcap_dir"
+ found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
+ break
+ fi
+ done
+
+ if test "$found_pcap_dir" != "" ; then
+ AC_MSG_RESULT([$found_pcap_dir added to CPPFLAGS])
+ else
+ AC_MSG_RESULT([not found])
+ fi
fi
- # Pcap header checks
- AC_CHECK_HEADER(net/bpf.h,,
- AC_MSG_ERROR([[Header file net/bpf.h not found; if you installed libpcap from source, did you also do \"make install-incl\"?]]))
- AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
-
- #
- # Check to see if we find "pcap_open_live" in "-lpcap".
- #
- AC_CHECK_LIB(pcap, pcap_open_live,
- [
- PCAP_LIBS=-lpcap
- AC_DEFINE(HAVE_LIBPCAP)
- ], AC_MSG_ERROR(Library libpcap not found.),
- $SOCKET_LIBS $NSL_LIBS)
- AC_SUBST(PCAP_LIBS)
+ if test "${use_pcap}" = "yes"; then
+ # Pcap header checks
+ AC_CHECK_HEADER(net/bpf.h, ,
+ AC_MSG_ERROR([[Header file net/bpf.h not found; if you installed libpcap from source, did you also do \"make install-incl\"?]]))
+ AC_CHECK_HEADER(pcap.h, ,
+ AC_MSG_ERROR([Header file pcap.h not found]))
+
+ #
+ # Check to see if we find "pcap_open_live" in "-lpcap".
+ #
+ AC_CHECK_LIB(pcap, pcap_open_live,[
+ PCAP_LIBS=-lpcap
+ AC_DEFINE(HAVE_LIBPCAP)],
+ AC_MSG_ERROR([Library libpcap not found]),
+ $SOCKET_LIBS $NSL_LIBS)
+ AC_SUBST(PCAP_LIBS)
+ fi
])
#
@@ -282,16 +310,42 @@
#
AC_DEFUN(AC_ETHEREAL_ZLIB_CHECK,
[
- AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
+ _cppflags=${CPPFLAGS}
+ _ldflags=${LDFLAGS}
+
+ AC_ARG_WITH(zlib,
+ [ --with-zlib[=DIR] use zlib to read compressed data (and
+ search in DIR for includes/libraries) [default=yes]],[
+ case "${with_zlib}" in
+ no)
+ use_zlib=no
+ ;;
+ yes)
+ use_zlib=yes
+ ;;
+ *)
+ use_zlib=yes
+ if test -d "$with_zlib"; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+ ;;
+ esac
+ ],[
+ use_zlib=yes
+ ])
- dnl
- dnl Check for "gzgets()" in zlib, because we need it, but
- dnl some older versions of zlib don't have it. It appears
- dnl from the ChangeLog that any released version of zlib
- dnl with "gzgets()" should have the other routines we
- dnl depend on, such as "gzseek()", "gztell()", and "zError()".
- dnl
- AC_CHECK_LIB(z, gzgets,,enable_zlib=no)
+ if test "${use_zlib}" = "yes"; then
+ AC_CHECK_HEADER(zlib.h,
+ AC_CHECK_LIB(z, gzread, , use_zlib=no),
+ use_zlib=no)
+
+ if test "${use_zlib}" = "no"; then
+ CPPFLAGS=${_cppflags}
+ LDFLAGS=${_ldflags}
+ AC_MSG_WARN([zlib not found -- disabling compressed capture file support])
+ fi
+ fi
])
#
--- wiretap/acinclude.m4.orig Wed Mar 7 20:44:55 2001
+++ wiretap/acinclude.m4 Thu Mar 8 01:46:12 2001
@@ -207,26 +207,56 @@
#
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 "$found_pcap_dir" != "" ; then
- AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
- else
- AC_MSG_RESULT(not found)
+ _cppflags=${CPPFLAGS}
+
+ AC_ARG_WITH(pcap,
+ [ --with-pcap[=DIR] use libpcap for packet capturing (and
+ search DIR for includes) [default=yes]],[
+ case "${with_pcap}" in
+ no)
+ use_pcap=no
+ ;;
+ yes)
+ use_pcap=yes
+ ;;
+ *)
+ use_pcap=yes
+ if test -d "$withval"; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ fi
+ ;;
+ esac
+ ],[
+ use_pcap=yes
+ ])
+
+ # if --with-pcap not set to a path, search in pre-defined locations
+ if test "${with_pcap}" = "yes"; then
+ # 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
+ CPPFLAGS="$CPPFLAGS -I$pcap_dir"
+ found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
+ break
+ fi
+ done
+
+ if test "$found_pcap_dir" != "" ; then
+ AC_MSG_RESULT([$found_pcap_dir added to CPPFLAGS])
+ else
+ AC_MSG_RESULT([not found])
+ fi
fi
- # Pcap header check
- AC_CHECK_HEADERS(pcap.h)
+ if test "${use_pcap}" = "yes"; then
+ # Pcap header checks
+ AC_CHECK_HEADERS(pcap.h, ,
+ test -n "${_cppflags}" && CPPFLAGS=${_cppflags})
+ fi
])
#
@@ -234,14 +264,40 @@
#
AC_DEFUN(AC_WIRETAP_ZLIB_CHECK,
[
- AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
+ _cppflags=${CPPFLAGS}
+ _ldflags=${LDFLAGS}
+
+ AC_ARG_WITH(zlib,
+ [ --with-zlib[=DIR] use zlib to read compressed data (and
+ search in DIR for includes/libraries) [default=yes]],[
+ case "${with_zlib}" in
+ no)
+ use_zlib=no
+ ;;
+ yes)
+ use_zlib=yes
+ ;;
+ *)
+ use_zlib=yes
+ if test -d "$with_zlib"; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+ ;;
+ esac
+ ],[
+ use_zlib=yes
+ ])
- dnl
- dnl Check for "gzgets()" in zlib, because we need it, but
- dnl some older versions of zlib don't have it. It appears
- dnl from the ChangeLog that any released version of zlib
- dnl with "gzgets()" should have the other routines we
- dnl depend on, such as "gzseek()", "gztell()", and "zError()".
- dnl
- AC_CHECK_LIB(z, gzgets,,enable_zlib=no)
+ if test "${use_zlib}" = "yes"; then
+ AC_CHECK_HEADER(zlib.h,
+ AC_CHECK_LIB(z, gzread, , use_zlib=no),
+ use_zlib=no)
+
+ if test "${use_zlib}" = "no"; then
+ CPPFLAGS=${_cppflags}
+ LDFLAGS=${_ldflags}
+ AC_MSG_WARN([zlib not found -- disabling compressed capture file support])
+ fi
+ fi
])
- References:
- [Ethereal-dev] autoconf patches to 0.8.16
- From: ethereal-dev
- Re: [Ethereal-dev] autoconf patches to 0.8.16
- From: ethereal-dev
- Re: [Ethereal-dev] autoconf patches to 0.8.16
- From: Guy Harris
- Re: [Ethereal-dev] autoconf patches to 0.8.16
- From: ethereal-dev
- Re: [Ethereal-dev] autoconf patches to 0.8.16
- From: Guy Harris
- [Ethereal-dev] autoconf patches to 0.8.16
- Prev by Date: Re: [Ethereal-dev] autoconf patches to 0.8.16
- Next by Date: Re: [Ethereal-dev] autoconf patches to 0.8.16
- Previous by thread: Re: [Ethereal-dev] autoconf patches to 0.8.16
- Next by thread: [Ethereal-dev] autoconf AC_ETHEREAL_ADD_DASH_L macro
- Index(es):





