2004-07-18 00:24:25 +00:00
|
|
|
# $Id$
|
2004-03-04 06:30:14 +00:00
|
|
|
#
|
1998-11-12 00:06:47 +00:00
|
|
|
AC_INIT(wtap.c)
|
1999-12-03 07:04:54 +00:00
|
|
|
|
2004-03-04 06:30:14 +00:00
|
|
|
AC_PREREQ(2.52)
|
1999-12-03 07:04:54 +00:00
|
|
|
|
2002-10-09 22:58:53 +00:00
|
|
|
AC_CANONICAL_HOST
|
2002-10-06 18:18:45 +00:00
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
|
2004-02-07 05:44:08 +00:00
|
|
|
AM_DISABLE_STATIC
|
|
|
|
|
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
|
2002-08-14 14:42:42 +00:00
|
|
|
AC_PROG_LIBTOOL
|
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
|
|
|
|
2002-02-27 09:42:52 +00:00
|
|
|
#
|
2002-11-27 22:24:27 +00:00
|
|
|
# If we're running gcc, add '-Wall -W -Wcast-qual' to CFLAGS, and add
|
2002-03-02 20:41:08 +00:00
|
|
|
# '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
|
|
|
|
# flag unused function arguments and not get warnings about them.
|
2002-11-28 04:21:31 +00:00
|
|
|
# If "--with-extra-gcc-checks" was specified, add "-Wcast-align"
|
|
|
|
# as well. (Add more checks here in the future?)
|
2002-02-27 09:42:52 +00:00
|
|
|
#
|
|
|
|
# Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
|
|
|
|
# argument will compile with non-GCC compilers.
|
|
|
|
#
|
2002-11-28 04:21:31 +00:00
|
|
|
AC_ARG_WITH(extra-gcc-checks,
|
|
|
|
[ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
|
|
|
|
[
|
|
|
|
if test $withval != no
|
|
|
|
then
|
2006-06-06 23:09:20 +00:00
|
|
|
wireshark_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wmissing-declarations -Wwrite-strings"
|
2002-11-28 04:21:31 +00:00
|
|
|
fi
|
|
|
|
],)
|
2006-06-06 23:09:20 +00:00
|
|
|
AC_MSG_CHECKING(to see if we can add '-Wall -W -Wcast-qual $wireshark_extra_gcc_flags' to CFLAGS)
|
1998-11-21 03:26:54 +00:00
|
|
|
if test x$GCC != x ; then
|
2006-06-06 23:09:20 +00:00
|
|
|
CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $wireshark_extra_gcc_flags $CFLAGS"
|
1998-11-21 03:26:54 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
2002-02-27 09:42:52 +00:00
|
|
|
CFLAGS="-D_U_=\"\" $CFLAGS"
|
1998-11-21 03:26:54 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2000-10-17 07:30:35 +00:00
|
|
|
#
|
|
|
|
# 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)
|
|
|
|
;;
|
2001-12-07 22:56:58 +00:00
|
|
|
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)
|
|
|
|
;;
|
2000-10-17 07:30:35 +00:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(none needed)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
2001-12-07 22:56:58 +00:00
|
|
|
case "$host_os" in
|
MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
plugin directory optional - this allows plugins to be disabled;
add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
requires it, for some annoying reason, even though it is, as far
as I know, GCC-based, and other GCC's don't require it);
on MacOS X, don't use "pcap_version[]", as, for some annoying
reason, libpcap on MacOS X doesn't define it.
Clean up some whitespace in the help messages for the configure script.
Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".
svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
|
|
|
darwin*)
|
2001-12-07 22:56:58 +00:00
|
|
|
#
|
|
|
|
# See comments above about Apple's lovely C compiler.
|
|
|
|
#
|
|
|
|
CFLAGS="-no-cpp-precomp $CFLAGS"
|
|
|
|
AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
|
MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
plugin directory optional - this allows plugins to be disabled;
add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
requires it, for some annoying reason, even though it is, as far
as I know, GCC-based, and other GCC's don't require it);
on MacOS X, don't use "pcap_version[]", as, for some annoying
reason, libpcap on MacOS X doesn't define it.
Clean up some whitespace in the help messages for the configure script.
Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".
svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
|
|
|
;;
|
|
|
|
*)
|
2000-10-17 07:30:35 +00:00
|
|
|
AC_MSG_RESULT(none needed)
|
MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
plugin directory optional - this allows plugins to be disabled;
add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
requires it, for some annoying reason, even though it is, as far
as I know, GCC-based, and other GCC's don't require it);
on MacOS X, don't use "pcap_version[]", as, for some annoying
reason, libpcap on MacOS X doesn't define it.
Clean up some whitespace in the help messages for the configure script.
Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".
svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
|
|
|
;;
|
|
|
|
esac
|
2000-10-17 07:30:35 +00:00
|
|
|
fi
|
|
|
|
|
2007-01-05 07:36:30 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Add any platform-specific linker flags needed.
|
|
|
|
#
|
|
|
|
AC_MSG_CHECKING(for platform-specific linker flags)
|
|
|
|
case "$host_os" in
|
|
|
|
darwin*)
|
|
|
|
#
|
|
|
|
# Add -Wl,-single_module to the LDFLAGS used with shared
|
|
|
|
# libraries, to fix some error that show up in some cases;
|
|
|
|
# some Apple documentation recommends it for most shared
|
|
|
|
# libraries.
|
|
|
|
#
|
|
|
|
SHAREDLIB_LDFLAGS="-Wl,-single_module"
|
|
|
|
#
|
|
|
|
# Add -Wl,-search_paths_first to make sure that if we search
|
|
|
|
# directories A and B, in that order, for a given library, a
|
|
|
|
# non-shared version in directory A, rather than a shared
|
|
|
|
# version in directory B, is chosen (so we can use
|
|
|
|
# --with-pcap=/usr/local to force all programs to be linked
|
|
|
|
# with a static version installed in /usr/local/lib rather than
|
|
|
|
# the system version in /usr/lib).
|
|
|
|
#
|
|
|
|
LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
|
|
|
|
AC_MSG_RESULT(Apple linker - added -Wl,-single_module and -Wl,-search_paths_first)
|
|
|
|
;;
|
|
|
|
cygwin*)
|
|
|
|
#
|
|
|
|
# Shared libraries in cygwin/Win32 must never contain
|
|
|
|
# undefined symbols.
|
|
|
|
#
|
|
|
|
LDFLAGS="$LDFLAGS -no-undefined"
|
|
|
|
AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(none needed)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(SHAREDLIB_LDFLAGS)
|
|
|
|
|
2003-11-18 08:13:10 +00:00
|
|
|
AC_ARG_ENABLE(profile-build,
|
|
|
|
[ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
|
|
|
|
AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
|
|
|
|
AC_MSG_CHECKING(if profile builds must be generated)
|
|
|
|
if test "x$enable_profile_build" = "xyes" ; then
|
|
|
|
if test -n "$GCC" ; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
CFLAGS=" -pg $CFLAGS"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
echo "Building profile binaries currently only supported for GCC."
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2002-08-28 00:37:31 +00:00
|
|
|
AC_ARG_ENABLE(gtk2,
|
2006-06-06 23:09:20 +00:00
|
|
|
[ --disable-gtk2 build Glib1/Gtk1+-based wireshark/tshark. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
|
2002-08-28 00:37:31 +00:00
|
|
|
|
|
|
|
if test "x$enable_gtk2" = "xyes" ; then
|
|
|
|
AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS", , gmodule)
|
|
|
|
else
|
|
|
|
AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS", , gmodule)
|
|
|
|
fi
|
1999-03-01 18:57:07 +00:00
|
|
|
|
2002-01-09 23:21:55 +00:00
|
|
|
dnl Look in /usr/local for header files and libraries ?
|
|
|
|
AC_ARG_ENABLE(usr-local,
|
2003-07-23 20:32:37 +00:00
|
|
|
[ --enable-usr-local look for headers and libs in /usr/local tree. [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
|
2001-04-17 22:47:37 +00:00
|
|
|
|
2002-01-09 23:21:55 +00:00
|
|
|
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
|
2002-02-06 09:58:30 +00:00
|
|
|
# be testing whether zlib has gzgets, and we need to be able to find
|
2002-01-09 23:21:55 +00:00
|
|
|
# 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
|
2001-04-17 22:47:37 +00:00
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
dnl Checks for header files
|
|
|
|
AC_HEADER_STDC
|
2000-08-11 13:37:21 +00:00
|
|
|
AC_CHECK_HEADERS(sys/time.h netinet/in.h unistd.h fcntl.h sys/stat.h sys/types.h)
|
1998-11-12 00:06:47 +00:00
|
|
|
|
2006-06-20 18:30:54 +00:00
|
|
|
#
|
|
|
|
# Define WS_VAR_IMPORT appropriately for declarations of external
|
|
|
|
# variables exported from dynamically-linked libraries.
|
|
|
|
#
|
|
|
|
AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
|
|
|
|
|
1999-12-04 05:14:39 +00:00
|
|
|
# We must know our byte order
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
2006-05-15 05:28:56 +00:00
|
|
|
#
|
|
|
|
# Does GLib define G_GINT64_MODIFIER?
|
|
|
|
#
|
|
|
|
AC_MSG_CHECKING([[whether glib.h defines the G_GINT64_MODIFIER macro]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[
|
|
|
|
AC_LANG_SOURCE(
|
|
|
|
[[
|
|
|
|
#include <glib.h>
|
2006-05-15 22:21:51 +00:00
|
|
|
#if GTK_MAJOR_VERSION >= 2
|
2006-05-15 05:28:56 +00:00
|
|
|
#include <glib/gprintf.h>
|
2006-05-15 22:21:51 +00:00
|
|
|
#endif
|
2006-05-15 05:28:56 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
char strbuf[16+1];
|
2006-05-15 22:21:51 +00:00
|
|
|
g_snprintf(strbuf, sizeof strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
|
2006-05-15 05:28:56 +00:00
|
|
|
}
|
|
|
|
]])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_WIRETAP_CHECK_64BIT_FORMAT(ll,
|
|
|
|
[
|
|
|
|
AC_WIRETAP_CHECK_64BIT_FORMAT(L,
|
|
|
|
[
|
|
|
|
AC_WIRETAP_CHECK_64BIT_FORMAT(q,
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2000-08-25 06:25:21 +00:00
|
|
|
#
|
|
|
|
# Look for libpcap, so we can include <pcap.h> in libpcap.c if it's
|
|
|
|
# found.
|
|
|
|
#
|
2001-06-27 07:47:50 +00:00
|
|
|
# "--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
|
2006-06-06 23:09:20 +00:00
|
|
|
# top-level Wireshark configure script specifies it to the Wiretap
|
2001-06-27 07:47:50 +00:00
|
|
|
# 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,
|
2003-08-21 07:25:22 +00:00
|
|
|
[ --with-pcap=DIR libpcap is located in directory DIR.],
|
2001-06-27 07:47:50 +00:00
|
|
|
[
|
|
|
|
if test $withval != yes -a $withval != no
|
|
|
|
then
|
|
|
|
pcap_dir=$withval
|
|
|
|
fi
|
|
|
|
],[
|
|
|
|
pcap_dir=
|
|
|
|
])
|
2000-08-25 06:25:21 +00:00
|
|
|
AC_WIRETAP_PCAP_CHECK
|
|
|
|
|
1999-09-22 01:26:50 +00:00
|
|
|
dnl zlib check
|
|
|
|
AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
|
2002-04-08 01:34:39 +00:00
|
|
|
|
|
|
|
AC_ARG_WITH(zlib,
|
|
|
|
[ --with-zlib[=DIR] use zlib (located in directory DIR, if supplied) to read compressed data. [default=yes, if present]],
|
|
|
|
[
|
|
|
|
if test $withval = no
|
|
|
|
then
|
|
|
|
want_zlib=no
|
|
|
|
elif test $withval = yes
|
|
|
|
then
|
|
|
|
want_zlib=yes
|
|
|
|
else
|
|
|
|
want_zlib=yes
|
|
|
|
zlib_dir=$withval
|
|
|
|
fi
|
|
|
|
],[
|
|
|
|
#
|
|
|
|
# Use zlib if it's present, otherwise don't.
|
|
|
|
#
|
|
|
|
want_zlib=ifpresent
|
|
|
|
zlib_dir=
|
|
|
|
])
|
|
|
|
if test "x$want_zlib" = "xno" ; then
|
|
|
|
AC_MSG_RESULT(no)
|
1999-09-22 01:26:50 +00:00
|
|
|
else
|
2002-04-08 01:34:39 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
1999-09-22 01:26:50 +00:00
|
|
|
AC_WIRETAP_ZLIB_CHECK
|
2002-04-08 01:34:39 +00:00
|
|
|
if test "x$want_zlib" = "xno" ; then
|
2000-02-12 08:54:32 +00:00
|
|
|
AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
|
|
|
|
fi
|
1999-09-22 01:26:50 +00:00
|
|
|
fi
|
|
|
|
|
1998-11-12 00:06:47 +00:00
|
|
|
AC_OUTPUT(Makefile)
|