1 dnl aclocal.m4 generated automatically by aclocal 1.4a
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl Macros that test for specific features.
14 dnl This file is part of Autoconf.
15 dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
17 dnl This program is free software; you can redistribute it and/or modify
18 dnl it under the terms of the GNU General Public License as published by
19 dnl the Free Software Foundation; either version 2, or (at your option)
20 dnl any later version.
22 dnl This program is distributed in the hope that it will be useful,
23 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
24 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 dnl GNU General Public License for more details.
27 dnl You should have received a copy of the GNU General Public License
28 dnl along with this program; if not, write to the Free Software
29 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
32 dnl As a special exception, the Free Software Foundation gives unlimited
33 dnl permission to copy, distribute and modify the configure scripts that
34 dnl are the output of Autoconf. You need not follow the terms of the GNU
35 dnl General Public License when using or distributing such scripts, even
36 dnl though portions of the text of Autoconf appear in them. The GNU
37 dnl General Public License (GPL) does govern all other use of the material
38 dnl that constitutes the Autoconf program.
40 dnl Certain portions of the Autoconf source text are designed to be copied
41 dnl (in certain cases, depending on the input) into the output of
42 dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
43 dnl source text consists of comments plus executable code that decides which
44 dnl of the data portions to output in any given case. We call these
45 dnl comments and executable code the "non-data" portions. Autoconf never
46 dnl copies any of the non-data portions into its output.
48 dnl This special exception to the GPL applies to versions of Autoconf
49 dnl released by the Free Software Foundation. When you make and
50 dnl distribute a modified version of Autoconf, you may extend this special
51 dnl exception to the GPL to apply to your modified version as well, *unless*
52 dnl your modified version has the potential to copy into its output some
53 dnl of the text that was the non-data portion of the version that you started
54 dnl with. (In other words, unless your change moves or copies text from
55 dnl the non-data portions to the data portions.) If your modification has
56 dnl such potential, you must delete any notice of this special exception
57 dnl to the GPL from your modified version.
59 dnl Written by David MacKenzie, with help from
60 dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
61 dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
64 # AC_ETHEREAL_STRUCT_SA_LEN
66 dnl AC_STRUCT_ST_BLKSIZE extracted from the file in qustion,
67 dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
68 dnl AC_ETHEREAL_STRUCT_SA_LEN, which checks if "struct sockaddr"
69 dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
70 dnl what's in this file.
71 dnl Done by Guy Harris <guy@netapp.com> on 1998-11-14.
73 dnl ### Checks for structure members
75 AC_DEFUN(AC_ETHEREAL_STRUCT_SA_LEN,
76 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_ethereal_struct_sa_len,
77 [AC_TRY_COMPILE([#include <sys/types.h>
78 #include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
79 ac_cv_ethereal_struct_sa_len=yes, ac_cv_ethereal_struct_sa_len=no)])
80 if test $ac_cv_ethereal_struct_sa_len = yes; then
81 AC_DEFINE(HAVE_SA_LEN)
87 # AC_ETHEREAL_IPV6_STACK
89 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
91 AC_DEFUN(AC_ETHEREAL_IPV6_STACK,
96 AC_MSG_CHECKING([ipv6 stack type])
97 for i in v6d toshiba kame inria zeta linux; do
100 AC_EGREP_CPP(yes, [dnl
101 #include </usr/local/v6/include/sys/types.h>
105 [v6type=$i; v6lib=v6;
106 v6libdir=/usr/local/v6/lib;
107 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
110 AC_EGREP_CPP(yes, [dnl
111 #include <sys/param.h>
112 #ifdef _TOSHIBA_INET6
115 [v6type=$i; v6lib=inet6;
116 v6libdir=/usr/local/v6/lib;
117 CFLAGS="-DINET6 $CFLAGS"])
120 AC_EGREP_CPP(yes, [dnl
121 #include <netinet/in.h>
125 [v6type=$i; v6lib=inet6;
126 v6libdir=/usr/local/v6/lib;
127 CFLAGS="-DINET6 $CFLAGS"])
130 AC_EGREP_CPP(yes, [dnl
131 #include <netinet/in.h>
132 #ifdef IPV6_INRIA_VERSION
135 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
138 AC_EGREP_CPP(yes, [dnl
139 #include <sys/param.h>
140 #ifdef _ZETA_MINAMI_INET6
143 [v6type=$i; v6lib=inet6;
144 v6libdir=/usr/local/v6/lib;
145 CFLAGS="-DINET6 $CFLAGS"])
148 if test -d /usr/inet6; then
152 CFLAGS="-DINET6 $CFLAGS"
156 if test "$v6type" != "unknown"; then
161 if test "$v6lib" != "none"; then
162 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
163 if test -d $dir -a -f $dir/lib$v6lib.a; then
164 LIBS="-L$dir -l$v6lib $LIBS"
172 AC_MSG_RESULT(["$v6type, $v6lib"])
176 # AC_ETHEREAL_PCAP_CHECK
178 AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
180 # Evidently, some systems have pcap.h, etc. in */include/pcap
181 AC_MSG_CHECKING(for extraneous pcap header directories)
183 for pcap_dir in /usr/include/pcap /usr/local/include/pcap
185 if test -d $pcap_dir ; then
186 LIBS="$LIBS -L$pcap_dir"
187 CFLAGS="$CFLAGS -I$pcap_dir"
188 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
189 found_pcap_dir=" $found_pcap_dir -L$pcap_dir"
193 if test "$found_pcap_dir" != "" ; then
194 AC_MSG_RESULT(found --$found_pcap_dir added to LIBS)
196 AC_MSG_RESULT(not found)
200 AC_CHECK_HEADER(net/bpf.h,, AC_MSG_ERROR(Header file net/bpf.h not found.))
201 AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
202 AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
206 # Do all the work for Automake. This macro actually does too much --
207 # some checks are only needed if your package does certain things.
208 # But this isn't really a big deal.
213 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
215 AC_DEFUN(AM_INIT_AUTOMAKE,
216 [AC_REQUIRE([AC_PROG_INSTALL])
217 dnl We require 2.13 because we rely on SHELL being computed by configure.
223 dnl test to see if srcdir already configured
224 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
225 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
228 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
229 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
230 AC_REQUIRE([AM_SANITY_CHECK])
231 AC_REQUIRE([AC_ARG_PROGRAM])
232 dnl FIXME This is truly gross.
233 missing_dir=`cd $ac_aux_dir && pwd`
234 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
235 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
236 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
237 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
238 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
239 AC_REQUIRE([AC_PROG_MAKE_SET])])
242 # Check to make sure that the build environment is sane.
245 AC_DEFUN(AM_SANITY_CHECK,
246 [AC_MSG_CHECKING([whether build environment is sane])
249 echo timestamp > conftestfile
250 # Do `set' in a subshell so we don't clobber the current shell's
251 # arguments. Must try -L first in case configure is actually a
252 # symlink; some systems play weird games with the mod time of symlinks
253 # (eg FreeBSD returns the mod time of the symlink's containing
256 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
257 if test "[$]*" = "X"; then
259 set X `ls -t $srcdir/configure conftestfile`
261 if test "[$]*" != "X $srcdir/configure conftestfile" \
262 && test "[$]*" != "X conftestfile $srcdir/configure"; then
264 # If neither matched, then we have a broken ls. This can happen
265 # if, for instance, CONFIG_SHELL is bash and it inherits a
266 # broken ls alias from the environment. This has actually
267 # happened. Such a system could not be considered "sane".
268 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
269 alias in your environment])
272 test "[$]2" = conftestfile
278 AC_MSG_ERROR([newly created file is older than distributed files!
279 Check your system clock])
284 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
285 dnl The program must properly implement --version.
286 AC_DEFUN(AM_MISSING_PROG,
287 [AC_MSG_CHECKING(for working $2)
288 # Run test in a subshell; some versions of sh will print an error if
289 # an executable is not found, even if stderr is redirected.
290 # Redirect stdin to placate older versions of autoconf. Sigh.
291 if ($2 --version) < /dev/null > /dev/null 2>&1; then
296 AC_MSG_RESULT(missing)
300 # Configure paths for GTK+
301 # Owen Taylor 97-11-3
303 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
304 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
306 AC_DEFUN(AM_PATH_GTK,
308 dnl Get the cflags and libraries from the gtk-config script
310 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
311 gtk_config_prefix="$withval", gtk_config_prefix="")
312 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
313 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
314 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
315 , enable_gtktest=yes)
321 gtk_config_args="$gtk_config_args gthread"
326 if test x$gtk_config_exec_prefix != x ; then
327 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
328 if test x${GTK_CONFIG+set} != xset ; then
329 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
332 if test x$gtk_config_prefix != x ; then
333 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
334 if test x${GTK_CONFIG+set} != xset ; then
335 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
339 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
340 min_gtk_version=ifelse([$1], ,0.99.7,$1)
341 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
343 if test "$GTK_CONFIG" = "no" ; then
346 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
347 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
348 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
349 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
350 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
351 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
352 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
353 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
354 if test "x$enable_gtktest" = "xyes" ; then
355 ac_save_CFLAGS="$CFLAGS"
357 CFLAGS="$CFLAGS $GTK_CFLAGS"
358 LIBS="$GTK_LIBS $LIBS"
360 dnl Now check if the installed GTK is sufficiently new. (Also sanity
361 dnl checks the results of gtk-config to some extent
372 int major, minor, micro;
375 system ("touch conf.gtktest");
377 /* HP/UX 9 (%@#!) writes to sscanf strings */
378 tmp_version = g_strdup("$min_gtk_version");
379 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
380 printf("%s, bad version string\n", "$min_gtk_version");
384 if ((gtk_major_version != $gtk_config_major_version) ||
385 (gtk_minor_version != $gtk_config_minor_version) ||
386 (gtk_micro_version != $gtk_config_micro_version))
388 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
389 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
390 gtk_major_version, gtk_minor_version, gtk_micro_version);
391 printf ("*** was found! If gtk-config was correct, then it is best\n");
392 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
393 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
394 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
395 printf("*** required on your system.\n");
396 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
397 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
398 printf("*** before re-running configure\n");
400 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
401 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
402 (gtk_minor_version != GTK_MINOR_VERSION) ||
403 (gtk_micro_version != GTK_MICRO_VERSION))
405 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
406 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
407 printf("*** library (version %d.%d.%d)\n",
408 gtk_major_version, gtk_minor_version, gtk_micro_version);
410 #endif /* defined (GTK_MAJOR_VERSION) ... */
413 if ((gtk_major_version > major) ||
414 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
415 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
421 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
422 gtk_major_version, gtk_minor_version, gtk_micro_version);
423 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
424 major, minor, micro);
425 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
427 printf("*** If you have already installed a sufficiently new version, this error\n");
428 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
429 printf("*** being found. The easiest way to fix this is to remove the old version\n");
430 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
431 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
432 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
433 printf("*** so that the correct libraries are found at run-time))\n");
438 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
439 CFLAGS="$ac_save_CFLAGS"
443 if test "x$no_gtk" = x ; then
445 ifelse([$2], , :, [$2])
448 if test "$GTK_CONFIG" = "no" ; then
449 echo "*** The gtk-config script installed by GTK could not be found"
450 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
451 echo "*** your path, or set the GTK_CONFIG environment variable to the"
452 echo "*** full path to gtk-config."
454 if test -f conf.gtktest ; then
457 echo "*** Could not run GTK test program, checking why..."
458 CFLAGS="$CFLAGS $GTK_CFLAGS"
459 LIBS="$LIBS $GTK_LIBS"
463 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
464 [ echo "*** The test program compiled, but did not run. This usually means"
465 echo "*** that the run-time linker is not finding GTK or finding the wrong"
466 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
467 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
468 echo "*** to the installed location Also, make sure you have run ldconfig if that"
469 echo "*** is required on your system"
471 echo "*** If you have an old version installed, it is best to remove it, although"
472 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
474 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
475 echo "*** came with the system with the command"
477 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
478 [ echo "*** The test program failed to compile or link. See the file config.log for the"
479 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
480 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
481 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
482 CFLAGS="$ac_save_CFLAGS"
488 ifelse([$3], , :, [$3])
495 # Like AC_CONFIG_HEADER, but automatically create stamp file.
497 AC_DEFUN(AM_CONFIG_HEADER,
499 AC_CONFIG_HEADER([$1])
500 dnl When config.status generates a header, we must update the stamp-h file.
501 dnl This file resides in the same directory as the config header
502 dnl that is generated. We must strip everything past the first ":",
503 dnl and everything past the last "/".
504 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
505 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
506 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
508 for am_file in <<$1>>; do
509 case " <<$>>CONFIG_HEADERS " in
510 *" <<$>>am_file "*<<)>>
511 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
514 am_indx=`expr "<<$>>am_indx" + 1`