1999-12-03 07:04:54 +00:00
|
|
|
# $Id: configure.in,v 1.17 1999/12/03 07:04:54 guy Exp $
|
|
|
|
dnl
|
|
|
|
dnl Process this file with autoconf 2.13 or later to produce a
|
|
|
|
dnl configure script; 2.12 doesn't generate a "configure" script that
|
|
|
|
dnl defines SHELL, and "Makefile.in" has
|
|
|
|
dnl
|
|
|
|
dnl SHELL = @SHELL@
|
|
|
|
dnl
|
|
|
|
dnl which requires it to be defined - and there may be other problems
|
|
|
|
dnl with pre-2.13 "autoconf" as well.
|
|
|
|
dnl
|
1998-11-12 00:06:47 +00:00
|
|
|
AC_INIT(wtap.c)
|
1999-12-03 07:04:54 +00:00
|
|
|
|
|
|
|
AC_PREREQ(2.13)
|
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
|
1998-11-12 21:39:22 +00:00
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
1999-07-13 02:53:26 +00:00
|
|
|
AC_PROG_CPP
|
1999-09-11 04:50:44 +00:00
|
|
|
AC_PROG_YACC
|
|
|
|
AM_PROG_LEX
|
1998-11-12 21:39:22 +00:00
|
|
|
AC_PROG_RANLIB
|
1999-09-11 04:50:44 +00:00
|
|
|
AC_PATH_PROG(LEX, flex)
|
|
|
|
|
|
|
|
AC_SUBST(FLEX_PATH)
|
1998-11-12 00:06:47 +00:00
|
|
|
|
1998-11-21 03:26:54 +00:00
|
|
|
# If we're running gcc, add '-Wall' to CFLAGS.
|
|
|
|
AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
|
|
|
|
if test x$GCC != x ; then
|
|
|
|
CFLAGS="-Wall $CFLAGS"
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
1999-03-01 18:57:07 +00:00
|
|
|
# Checks for glib first, or gtk+ if not present
|
1999-03-03 08:51:58 +00:00
|
|
|
AM_PATH_GLIB(1.1.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS")
|
1999-03-01 18:57:07 +00:00
|
|
|
|
|
|
|
if test "x$GLIB_CFLAGS" = x ; then
|
|
|
|
AM_PATH_GTK(1.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS",
|
|
|
|
AC_MSG_ERROR(GTK+ library not found.))
|
|
|
|
AC_DEFINE(HAVE_GLIB10)
|
|
|
|
fi
|
1998-11-13 03:21:20 +00:00
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
dnl Checks for header files
|
1999-09-24 06:38:22 +00:00
|
|
|
dnl WARNING: do *NOT* check for "unistd.h" unless you work around the
|
|
|
|
dnl following problem:
|
|
|
|
dnl
|
|
|
|
dnl At least on FreeBSD 3.2, "/usr/include/zlib.h" includes
|
|
|
|
dnl "/usr/include/zconf.h", which, if HAVE_UNISTD_H is defined,
|
|
|
|
dnl #defines "z_off_t" to be "off_t", and if HAVE_UNISTD_H is
|
|
|
|
dnl not defines, #defines "z_off_t" to be "long" if it's not
|
|
|
|
dnl already #defined.
|
|
|
|
dnl
|
|
|
|
dnl In 4.4-Lite-derived systems such as FreeBSD, "off_t" is
|
|
|
|
dnl "long long int", not "long int", so the definition of "z_off_t" -
|
|
|
|
dnl and therefore the types of the arguments to routines such as
|
|
|
|
dnl "gzseek()", as declared, with prototypes, in "zlib.h" - depends
|
|
|
|
dnl on whether HAVE_UNISTD_H is defined prior to including "zlib.h"!
|
|
|
|
dnl
|
|
|
|
dnl It's not defined in the FreeBSD 3.2 "zlib", so if we include "zlib.h"
|
|
|
|
dnl after defining HAVE_UNISTD_H, we get a misdeclaration of "gzseek()",
|
|
|
|
dnl and, if we're building with "zlib" support, anything that seeks
|
|
|
|
dnl on a file may not work.
|
|
|
|
dnl
|
|
|
|
dnl Other BSDs may have the same problem, if they haven't done something
|
|
|
|
dnl such as defining HAVE_UNISTD_H in "zconf.h".
|
|
|
|
dnl
|
|
|
|
dnl If "config.h" defines HAVE_UNISTD_H - which it will, on all systems
|
|
|
|
dnl that have it, if we test for it here, and all 4.4-Lite-derived
|
|
|
|
dnl BSDs have it - then, given that "zlib.h" is included by "file.h",
|
|
|
|
dnl that means that unless we include "zlib.h" before we include
|
|
|
|
dnl "config.h", we get a misdeclaration of "gzseek()".
|
|
|
|
dnl
|
|
|
|
dnl Unfortunately, it's "config.h" that tells us whether we have "zlib"
|
|
|
|
dnl in the first place, so we don't know whether to include "zlib.h"
|
|
|
|
dnl until we include "config.h"....
|
|
|
|
dnl
|
|
|
|
dnl Fortunately, we don't use "unistd.h", so we don't need to check
|
|
|
|
dnl for it.
|
|
|
|
dnl
|
|
|
|
dnl If we ever *do* end up requiring HAVE_UNISTD_H, a fix might be to
|
|
|
|
dnl turn "file_seek()" into a subroutine, at least if HAVE_ZLIB is
|
|
|
|
dnl defined, have it take an "off_t" as its second argument, and
|
|
|
|
dnl put it into a file that doesn't require HAVE_UNISTD_H.
|
|
|
|
dnl
|
1998-11-12 00:06:47 +00:00
|
|
|
AC_HEADER_STDC
|
1999-09-24 06:38:22 +00:00
|
|
|
AC_CHECK_HEADERS(sys/time.h netinet/in.h)
|
1998-11-12 00:06:47 +00:00
|
|
|
|
1999-10-14 03:50:51 +00:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
1999-09-22 01:26:50 +00:00
|
|
|
dnl zlib check
|
|
|
|
AC_ARG_ENABLE(zlib,
|
1999-10-14 03:50:51 +00:00
|
|
|
[ --enable-zlib use zlib to read compressed data. [default=yes]],, [dnl
|
|
|
|
case "$host_os" in
|
|
|
|
netbsd*) enable_zlib=no;;
|
|
|
|
*) enable_zlib=yes;;
|
|
|
|
esac])
|
1999-09-22 01:26:50 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
|
|
|
|
if test "x$enable_zlib" = "xno" ; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_WIRETAP_ZLIB_CHECK
|
|
|
|
fi
|
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
AC_OUTPUT(Makefile)
|