diff options
-rw-r--r-- | acconfig.h | 7 | ||||
-rw-r--r-- | acinclude.m4 | 43 | ||||
-rw-r--r-- | config.h.win32 | 3 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | gtk/main.c | 23 | ||||
-rw-r--r-- | tethereal.c | 22 | ||||
-rw-r--r-- | wiretap/acinclude.m4 | 9 |
7 files changed, 70 insertions, 40 deletions
diff --git a/acconfig.h b/acconfig.h index ebb82ac7ef..b7eed15861 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,12 +1,11 @@ /* acconfig.h * #ifdefs to be controlled by "configure" * - * $Id: acconfig.h,v 1.19 2001/06/02 06:21:13 guy Exp $ + * $Id: acconfig.h,v 1.20 2001/07/27 07:10:09 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.org> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -41,4 +40,6 @@ #undef HAVE_LIBPCAP +#undef HAVE_PCAP_VERSION + #undef PLUGIN_DIR diff --git a/acinclude.m4 b/acinclude.m4 index 08407f9fe7..d8dcc216d7 100644 --- a/acinclude.m4 +++ b/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.28 2001/07/09 23:42:39 guy Exp $ +dnl $Id: acinclude.m4,v 1.29 2001/07/27 07:10:09 guy Exp $ dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -284,8 +284,9 @@ AC_DEFUN(AC_ETHEREAL_PCAP_CHECK, else # # The user specified a directory in which libpcap resides, - # so add that directory to the include file and library - # search path. + # so add the "include" subdirectory of that directory to + # the include file search path and the "lib" subdirectory + # of that directory to the library search path. # # XXX - if there's also a libpcap in a directory that's # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't @@ -293,8 +294,8 @@ AC_DEFUN(AC_ETHEREAL_PCAP_CHECK, # 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" + CFLAGS="$CFLAGS -I$pcap_dir/include" + CPPFLAGS="$CPPFLAGS -I$pcap_dir/include" AC_ETHEREAL_ADD_DASH_L(LDFLAGS, $pcap_dir/lib) fi @@ -316,6 +317,38 @@ AC_DEFUN(AC_ETHEREAL_PCAP_CHECK, ]) # +# AC_ETHEREAL_PCAP_VERSION_CHECK +# +# Check whether "pcap_version" is defined by libpcap. +# +AC_DEFUN(AC_ETHEREAL_PCAP_VERSION_CHECK, +[ + AC_MSG_CHECKING(whether pcap_version is defined by libpcap) + ac_save_LIBS="$LIBS" + LIBS="$PCAP_LIBS $LIBS" + AC_TRY_LINK([], + [ +char * +return_pcap_version(void) +{ + extern char pcap_version[]; + + return pcap_version; +} + ], + ac_cv_pcap_version_defined=yes, + ac_cv_pcap_version_defined=no, + [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + LIBS="$ac_save_LIBS" + if test "$ac_cv_pcap_version_defined" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PCAP_VERSION) + else + AC_MSG_RESULT(no) + fi +]) + +# # AC_ETHEREAL_ZLIB_CHECK # AC_DEFUN(AC_ETHEREAL_ZLIB_CHECK, diff --git a/config.h.win32 b/config.h.win32 index aa783f3b31..9251395f1c 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -1,4 +1,4 @@ -/* $Id: config.h.win32,v 1.29 2001/06/02 08:07:47 guy Exp $ */ +/* $Id: config.h.win32,v 1.30 2001/07/27 07:10:09 guy Exp $ */ /* config.h.win32 Generated manually. :-) */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -44,7 +44,6 @@ #define NEED_MKSTEMP 1 #define HAVE_LIBPCAP 1 -#define WPCAP_STRING "0.5.2 (WinPcap 2.1)" /* Define if you have the gethostbyname2 function. */ /* #undef HAVE_GETHOSTBYNAME2 */ diff --git a/configure.in b/configure.in index 2c436add08..e83763e17c 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.136 2001/07/27 06:10:26 guy Exp $ +# $Id: configure.in,v 1.137 2001/07/27 07:10:09 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 @@ -375,6 +375,7 @@ if test "x$want_pcap" = "xno" ; then else AC_MSG_RESULT(yes) AC_ETHEREAL_PCAP_CHECK + AC_ETHEREAL_PCAP_VERSION_CHECK fi dnl zlib check diff --git a/gtk/main.c b/gtk/main.c index 1550e2b842..64e856136e 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.204 2001/07/26 07:25:48 guy Exp $ + * $Id: main.c,v 1.205 2001/07/27 07:10:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -834,18 +834,11 @@ main(int argc, char *argv[]) int opt; extern char *optarg; gboolean arg_error = FALSE; - #ifdef HAVE_LIBPCAP -#ifdef WIN32 - char pcap_version[] = WPCAP_STRING; -#else -#ifdef __APPLE__ - char pcap_version[] = "Unknown"; -#else +#ifdef HAVE_PCAP_VERSION extern char pcap_version[]; -#endif -#endif -#endif +#endif /* HAVE_PCAP_VERSION */ +#endif /* HAVE_LIBPCAP */ #ifdef WIN32 WSADATA wsaData; @@ -1004,10 +997,14 @@ main(int argc, char *argv[]) #ifdef HAVE_LIBPCAP g_string_append(comp_info_str, ", with libpcap "); +#ifdef HAVE_PCAP_VERSION g_string_append(comp_info_str, pcap_version); -#else +#else /* HAVE_PCAP_VERSION */ + g_string_append(comp_info_str, "(version unknown)"); +#endif /* HAVE_PCAP_VERSION */ +#else /* HAVE_LIBPCAP */ g_string_append(comp_info_str, ", without libpcap"); -#endif +#endif /* HAVE_LIBPCAP */ #ifdef HAVE_LIBZ g_string_append(comp_info_str, ", with libz "); diff --git a/tethereal.c b/tethereal.c index 0ab3ef5bd6..6e70ec3288 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.89 2001/07/26 07:25:44 guy Exp $ + * $Id: tethereal.c,v 1.90 2001/07/27 07:10:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -205,16 +205,10 @@ main(int argc, char *argv[]) extern char *optarg; gboolean arg_error = FALSE; #ifdef HAVE_LIBPCAP -#ifdef WIN32 - char pcap_version[] = WPCAP_STRING; -#else -#ifdef __APPLE__ - char pcap_version[] = "Unknown"; -#else +#ifdef HAVE_PCAP_VERSION extern char pcap_version[]; -#endif -#endif -#endif +#endif /* HAVE_PCAP_VERSION */ +#endif /* HAVE_LIBPCAP */ #ifdef WIN32 WSADATA wsaData; @@ -309,10 +303,14 @@ main(int argc, char *argv[]) #ifdef HAVE_LIBPCAP g_string_append(comp_info_str, ", with libpcap "); +#ifdef HAVE_PCAP_VERSION g_string_append(comp_info_str, pcap_version); -#else +#else /* HAVE_PCAP_VERSION */ + g_string_append(comp_info_str, "(version unknown)"); +#endif /* HAVE_PCAP_VERSION */ +#else /* HAVE_LIBPCAP */ g_string_append(comp_info_str, ", without libpcap"); -#endif +#endif /* HAVE_LIBPCAP */ #ifdef HAVE_LIBZ g_string_append(comp_info_str, ", with libz "); diff --git a/wiretap/acinclude.m4 b/wiretap/acinclude.m4 index 050ab0d51e..9b3ad08a80 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.8 2001/06/27 07:47:49 guy Exp $ +dnl $Id: acinclude.m4,v 1.9 2001/07/27 07:10:13 guy Exp $ dnl # Configure paths for GLIB @@ -239,7 +239,8 @@ AC_DEFUN(AC_WIRETAP_PCAP_CHECK, else # # The user specified a directory in which libpcap resides, - # so add that directory to the search path. + # so add the "include" subdirectory of that directory to + # the include file search path. # # XXX - if there's also a libpcap in a directory that's # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't @@ -247,8 +248,8 @@ AC_DEFUN(AC_WIRETAP_PCAP_CHECK, # 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" + CFLAGS="$CFLAGS -I$pcap_dir/include" + CPPFLAGS="$CPPFLAGS -I$pcap_dir/include" fi # Pcap header check |