forked from osmocom/wireshark
![Guy Harris](/assets/img/avatar_default.png)
even if it doesn't have "gzgets()", so one might think we could use it by using our own replacement for "gzgets()". One would be wrong to think so, however, as the "gzseek()" it has doesn't actually work when reading uncompressed files. zlib 1.0.9 has "gzgets()", and fixes that bug, so we rever to checking for "gzgets()" rather than "gzseek()", so that we don't accept pre-1.0.9 versions of zlib, and we get rid of our "gzgets()" replacement. svn path=/trunk/; revision=4702
175 lines
4.8 KiB
Text
175 lines
4.8 KiB
Text
# $Id: configure.in,v 1.35 2002/02/06 09:58:30 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
|
|
AC_INIT(wtap.c)
|
|
|
|
AC_PREREQ(2.13)
|
|
|
|
AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
dnl Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_CPP
|
|
AC_PROG_YACC
|
|
AM_PROG_LEX
|
|
AC_PROG_RANLIB
|
|
AC_PATH_PROG(LEX, flex)
|
|
|
|
AC_SUBST(FLEX_PATH)
|
|
|
|
# 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 -W -Wno-unused $CFLAGS"
|
|
AC_MSG_RESULT(yes)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
|
|
#
|
|
# Add any platform-specific compiler flags needed.
|
|
#
|
|
AC_MSG_CHECKING(for platform-specific compiler flags)
|
|
if test "x$GCC" = x
|
|
then
|
|
#
|
|
# Not GCC - assume it's the vendor's compiler.
|
|
#
|
|
case "$host_os" in
|
|
hpux*)
|
|
#
|
|
# HP's ANSI C compiler; flags suggested by Jost Martin.
|
|
# "-Ae" for ANSI C plus extensions such as "long long".
|
|
# "+O2", for optimization. XXX - works with "-g"?
|
|
#
|
|
CFLAGS="-Ae +O2 $CFLAGS"
|
|
AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
|
|
;;
|
|
darwin*)
|
|
#
|
|
# It may be called "cc", but it's really a GCC derivative
|
|
# with a problematic special precompiler and precompiled
|
|
# headers; turn off the special precompiler, as some
|
|
# apparently-legal code won't compile with its precompiled
|
|
# headers.
|
|
#
|
|
CFLAGS="-no-cpp-precomp $CFLAGS"
|
|
AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
|
|
;;
|
|
*)
|
|
AC_MSG_RESULT(none needed)
|
|
;;
|
|
esac
|
|
else
|
|
case "$host_os" in
|
|
darwin*)
|
|
#
|
|
# See comments above about Apple's lovely C compiler.
|
|
#
|
|
CFLAGS="-no-cpp-precomp $CFLAGS"
|
|
AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
|
|
;;
|
|
*)
|
|
AC_MSG_RESULT(none needed)
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
# Check for glib.
|
|
AM_PATH_GLIB(1.1.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS")
|
|
|
|
dnl Look in /usr/local for header files and libraries ?
|
|
AC_ARG_ENABLE(usr-local,
|
|
[ --enable-usr-local look for headers and libs in /usr/local tree. [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
|
|
|
|
AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
|
|
if test "x$enable_usr_local" = "xyes" ; then
|
|
AC_MSG_RESULT(yes)
|
|
#
|
|
# Arrange that we search for header files in "/usr/local/include",
|
|
# as various packages we use ("libpcap", "zlib") may have been installed
|
|
# under "/usr/local/include".
|
|
#
|
|
# We do this after checking for GLib, so that "-I/usr/local/include"
|
|
# comes after any "-I" flags added by "AM_PATH_GLIB"; if the user has
|
|
# installed a pre-1.2.9 version of GLib, it'd probably go under
|
|
# "/usr/local", and if they then install 1.2.9 or later without
|
|
# uninstalling the pre-1.2.9 version, 1.2.9's header files won't be
|
|
# in "/usr/local/include" (they're put in a separate directory so that
|
|
# GLib 1.2[.x] and 1.3[.x]/2.x can coexist), and if we search
|
|
# "/usr/local/include" before searching the directory "AM_PATH_GLIB"
|
|
# specifies, we may pick up headers from the older version.
|
|
#
|
|
CFLAGS="$CFLAGS -I/usr/local/include"
|
|
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
|
|
|
#
|
|
# Arrange that we search for libraries in "/usr/local/lib", as we'll
|
|
# be testing whether zlib has gzgets, and we need to be able to find
|
|
# zlib even if it's in "/usr/local/lib".
|
|
#
|
|
# We do this after checking for GLib; see above.
|
|
#
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
|
|
dnl Checks for header files
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(sys/time.h netinet/in.h unistd.h fcntl.h sys/stat.h sys/types.h)
|
|
|
|
# We must know our byte order
|
|
AC_C_BIGENDIAN
|
|
|
|
#
|
|
# Look for libpcap, so we can include <pcap.h> in libpcap.c if it's
|
|
# found.
|
|
#
|
|
# "--with-pcap" is merely done to allow the user to specify a directory
|
|
# in which to look for <pcap.h> (and so that specifying it to the
|
|
# top-level Ethereal configure script specifies it to the Wiretap
|
|
# configure script as well); we search for it regardless of whether
|
|
# "--without-pcap" was specified, as Wiretap isn't linked with it and
|
|
# there's no benefit to not looking for the header.
|
|
#
|
|
AC_ARG_WITH(pcap,
|
|
[ --with-pcap=DIR libpcap is located in directory DIR.],
|
|
[
|
|
if test $withval != yes -a $withval != no
|
|
then
|
|
pcap_dir=$withval
|
|
fi
|
|
],[
|
|
pcap_dir=
|
|
])
|
|
AC_WIRETAP_PCAP_CHECK
|
|
|
|
dnl zlib check
|
|
AC_ARG_ENABLE(zlib,
|
|
[ --enable-zlib use zlib to read compressed data. [default=yes]],,enable_zlib=yes)
|
|
|
|
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
|
|
if test "x$enable_zlib" = "xno" ; then
|
|
AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
|
|
fi
|
|
fi
|
|
|
|
AC_OUTPUT(Makefile)
|