Actually, I think File/Reload is still used if you do a capture with
[obnox/wireshark/wip.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4a
2
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.
7
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.
12
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.
16 dnl
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.
21 dnl
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.
26 dnl
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
30 dnl 02111-1307, USA.
31 dnl
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.
39 dnl
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.
47 dnl
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.
58 dnl
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.
62
63 #
64 # AC_ETHEREAL_STRUCT_SA_LEN
65 #
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. 
72
73 dnl ### Checks for structure members
74
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)
82 fi
83 ])
84
85
86 #
87 # AC_ETHEREAL_IPV6_STACK
88 #
89 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
90
91 AC_DEFUN(AC_ETHEREAL_IPV6_STACK,
92 [
93         v6type=unknown
94         v6lib=none
95
96         AC_MSG_CHECKING([ipv6 stack type])
97         for i in v6d toshiba kame inria zeta linux; do
98                 case $i in
99                 v6d)
100                         AC_EGREP_CPP(yes, [dnl
101 #include </usr/local/v6/include/sys/types.h>
102 #ifdef __V6D__
103 yes
104 #endif],
105                                 [v6type=$i; v6lib=v6;
106                                 v6libdir=/usr/local/v6/lib;
107                                 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
108                         ;;
109                 toshiba)
110                         AC_EGREP_CPP(yes, [dnl
111 #include <sys/param.h>
112 #ifdef _TOSHIBA_INET6
113 yes
114 #endif],
115                                 [v6type=$i; v6lib=inet6;
116                                 v6libdir=/usr/local/v6/lib;
117                                 CFLAGS="-DINET6 $CFLAGS"])
118                         ;;
119                 kame)
120                         AC_EGREP_CPP(yes, [dnl
121 #include <netinet/in.h>
122 #ifdef __KAME__
123 yes
124 #endif],
125                                 [v6type=$i; v6lib=inet6;
126                                 v6libdir=/usr/local/v6/lib;
127                                 CFLAGS="-DINET6 $CFLAGS"])
128                         ;;
129                 inria)
130                         AC_EGREP_CPP(yes, [dnl
131 #include <netinet/in.h>
132 #ifdef IPV6_INRIA_VERSION
133 yes
134 #endif],
135                                 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
136                         ;;
137                 zeta)
138                         AC_EGREP_CPP(yes, [dnl
139 #include <sys/param.h>
140 #ifdef _ZETA_MINAMI_INET6
141 yes
142 #endif],
143                                 [v6type=$i; v6lib=inet6;
144                                 v6libdir=/usr/local/v6/lib;
145                                 CFLAGS="-DINET6 $CFLAGS"])
146                         ;;
147                 linux)
148                         if test -d /usr/inet6; then
149                                 v6type=$i
150                                 v6lib=inet6
151                                 v6libdir=/usr/inet6
152                                 CFLAGS="-DINET6 $CFLAGS"
153                         fi
154                         ;;
155                 esac
156                 if test "$v6type" != "unknown"; then
157                         break
158                 fi
159         done
160
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"
165                                 break
166                         fi
167                 done
168                 enable_ipv6="yes"
169         else
170                 enable_ipv6="no"
171         fi
172         AC_MSG_RESULT(["$v6type, $v6lib"])
173 ])
174
175 #
176 # AC_ETHEREAL_PCAP_CHECK
177 #
178 AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
179 [
180         # Evidently, some systems have pcap.h, etc. in */include/pcap
181         AC_MSG_CHECKING(for extraneous pcap header directories)
182         found_pcap_dir=""
183         for pcap_dir in /usr/include/pcap /usr/local/include/pcap
184         do
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"
190           fi
191         done
192
193         if test "$found_pcap_dir" != "" ; then
194           AC_MSG_RESULT(found --$found_pcap_dir added to LIBS)
195         else
196           AC_MSG_RESULT(not found)
197         fi
198
199         # Pcap checks
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.))
203 ])
204
205
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.
209
210 # serial 1
211
212 dnl Usage:
213 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
214
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.
218 AC_PREREQ([2.13])
219 PACKAGE=[$1]
220 AC_SUBST(PACKAGE)
221 VERSION=[$2]
222 AC_SUBST(VERSION)
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])
226 fi
227 ifelse([$3],,
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])])
240
241 #
242 # Check to make sure that the build environment is sane.
243 #
244
245 AC_DEFUN(AM_SANITY_CHECK,
246 [AC_MSG_CHECKING([whether build environment is sane])
247 # Just in case
248 sleep 1
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
254 # directory).
255 if (
256    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
257    if test "[$]*" = "X"; then
258       # -L didn't work.
259       set X `ls -t $srcdir/configure conftestfile`
260    fi
261    if test "[$]*" != "X $srcdir/configure conftestfile" \
262       && test "[$]*" != "X conftestfile $srcdir/configure"; then
263
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])
270    fi
271
272    test "[$]2" = conftestfile
273    )
274 then
275    # Ok.
276    :
277 else
278    AC_MSG_ERROR([newly created file is older than distributed files!
279 Check your system clock])
280 fi
281 rm -f conftest*
282 AC_MSG_RESULT(yes)])
283
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
292    $1=$2
293    AC_MSG_RESULT(found)
294 else
295    $1="$3/missing $2"
296    AC_MSG_RESULT(missing)
297 fi
298 AC_SUBST($1)])
299
300 # Configure paths for GTK+
301 # Owen Taylor     97-11-3
302
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
305 dnl
306 AC_DEFUN(AM_PATH_GTK,
307 [dnl 
308 dnl Get the cflags and libraries from the gtk-config script
309 dnl
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)
316
317   for module in . $4
318   do
319       case "$module" in
320          gthread) 
321              gtk_config_args="$gtk_config_args gthread"
322          ;;
323       esac
324   done
325
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
330      fi
331   fi
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
336      fi
337   fi
338
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)
342   no_gtk=""
343   if test "$GTK_CONFIG" = "no" ; then
344     no_gtk=yes
345   else
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"
356       ac_save_LIBS="$LIBS"
357       CFLAGS="$CFLAGS $GTK_CFLAGS"
358       LIBS="$GTK_LIBS $LIBS"
359 dnl
360 dnl Now check if the installed GTK is sufficiently new. (Also sanity
361 dnl checks the results of gtk-config to some extent
362 dnl
363       rm -f conf.gtktest
364       AC_TRY_RUN([
365 #include <gtk/gtk.h>
366 #include <stdio.h>
367 #include <stdlib.h>
368
369 int 
370 main ()
371 {
372   int major, minor, micro;
373   char *tmp_version;
374
375   system ("touch conf.gtktest");
376
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, &micro) != 3) {
380      printf("%s, bad version string\n", "$min_gtk_version");
381      exit(1);
382    }
383
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))
387     {
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");
399     } 
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))
404     {
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);
409     }
410 #endif /* defined (GTK_MAJOR_VERSION) ... */
411   else
412     {
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)))
416       {
417         return 0;
418        }
419      else
420       {
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");
426         printf("***\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");
434       }
435     }
436   return 1;
437 }
438 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
439        CFLAGS="$ac_save_CFLAGS"
440        LIBS="$ac_save_LIBS"
441      fi
442   fi
443   if test "x$no_gtk" = x ; then
444      AC_MSG_RESULT(yes)
445      ifelse([$2], , :, [$2])     
446   else
447      AC_MSG_RESULT(no)
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."
453      else
454        if test -f conf.gtktest ; then
455         :
456        else
457           echo "*** Could not run GTK test program, checking why..."
458           CFLAGS="$CFLAGS $GTK_CFLAGS"
459           LIBS="$LIBS $GTK_LIBS"
460           AC_TRY_LINK([
461 #include <gtk/gtk.h>
462 #include <stdio.h>
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"
470           echo "***"
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"
473           echo "***"
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"
476           echo "***"
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"
483           LIBS="$ac_save_LIBS"
484        fi
485      fi
486      GTK_CFLAGS=""
487      GTK_LIBS=""
488      ifelse([$3], , :, [$3])
489   fi
490   AC_SUBST(GTK_CFLAGS)
491   AC_SUBST(GTK_LIBS)
492   rm -f conf.gtktest
493 ])
494
495 # Like AC_CONFIG_HEADER, but automatically create stamp file.
496
497 AC_DEFUN(AM_CONFIG_HEADER,
498 [AC_PREREQ([2.12])
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>>,
507 <<am_indx=1
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
512     ;;
513   esac
514   am_indx=`expr "<<$>>am_indx" + 1`
515 done<<>>dnl>>)
516 changequote([,]))])
517