Win32 bugfix: peeking the signal_pipe at capture_loop start seems to be unreliable
[metze/wireshark/wip.git] / configure.in
1 # $Id$
2 #
3 AC_INIT(cfile.h)
4
5 AC_PREREQ(2.52)
6
7 dnl Check for CPU / vendor / OS
8 AC_CANONICAL_HOST
9 AC_CANONICAL_TARGET
10
11 AM_INIT_AUTOMAKE(ethereal, 0.10.13)
12
13 AM_DISABLE_STATIC
14
15 dnl Checks for programs.
16 AC_PROG_CC
17 AC_PROG_CPP
18 dnl Work around libtool bug (fixed in the version 1.5a?)
19 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
20 AC_LIBTOOL_DLOPEN
21 AC_PROG_LIBTOOL
22 AC_PROG_YACC
23 AM_PROG_LEX
24 AC_PATH_PROG(PERL, perl)
25 AC_PATH_PROG(POD2MAN, pod2man)
26 if test "x$POD2MAN" = x
27 then
28         #
29         # The alternative is not to build the man pages....
30         #
31         AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
32 fi
33 AC_PATH_PROG(POD2HTML, pod2html)
34 if test "x$POD2HTML" = x
35 then
36         #
37         # The alternative is not to build the HTML man pages....
38         #
39         AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
40 fi
41 AC_PATH_PROG(HTML_VIEWER, htmlview)
42 if test "x$HTML_VIEWER" = x
43 then
44         AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
45 else
46         AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
47 fi
48
49 AC_PATH_PROG(LEX, flex)
50 AC_PATH_PROG(PYTHON, python)
51
52 AC_SUBST(PERL)
53 AC_SUBST(POD2MAN)
54 AC_SUBST(POD2HTML)
55 AC_SUBST(LEX)
56 AC_SUBST(FLEX_PATH)
57 AC_SUBST(PYTHON)
58 AC_SUBST(XSLTPROC)
59 AC_SUBST(XMLLINT)
60
61 # Check for doxygen
62 AC_PATH_PROG(DOXYGEN, doxygen)
63 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
64 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
65
66 # Check for xsltproc
67 AC_PATH_PROG(XSLTPROC, xsltproc)
68 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
69 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
70
71 # Check for xmllint
72 AC_PATH_PROG(XMLLINT, xmllint)
73 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
74 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
75
76 # Check for fop (translate .fo to e.g. pdf)
77 AC_PATH_PROG(FOP, fop)
78 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
79 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
80
81 # Check for hhc (html help compiler)
82 AC_PATH_PROG(HHC, hhc.exe)
83 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
84 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
85
86 # Check for packaging utilities
87 # For now, we check to see if the various packaging utilites are in our
88 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
89 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
90 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
91 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
92
93 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
94      -a x$HAVE_PKGTRANS = xyes ; then
95   HAVE_SVR4_PACKAGING=yes
96 else
97   HAVE_SVR4_PACKAGING=no
98 fi
99 AC_SUBST(HAVE_SVR4_PACKAGING)
100
101 AC_ETHEREAL_RPM_CHECK
102 AC_SUBST(HAVE_RPM)
103
104 #
105 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
106 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
107 # flag unused function arguments and not get warnings about them.
108 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
109 # -Wcast-align" as well.  (Add more checks here in the future?)
110 #
111 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
112 # argument will compile with non-GCC compilers.
113 #
114 AC_ARG_WITH(extra-gcc-checks,
115 [  --with-extra-gcc-checks Do additional -W checks in GCC.  [default=no]],
116 [
117         if test $withval != no
118         then
119                 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings"
120         fi
121 ],)
122 AC_MSG_CHECKING(to see if we can add '-Wall -W $ethereal_extra_gcc_flags' to CFLAGS)
123 if test x$GCC != x ; then
124   CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -Wpointer-arith -W $ethereal_extra_gcc_flags $CFLAGS"
125   AC_MSG_RESULT(yes)
126 else
127   CFLAGS="-D_U_=\"\" $CFLAGS"
128   AC_MSG_RESULT(no)
129 fi
130
131 #
132 # Add any platform-specific compiler flags needed.
133 #
134 AC_MSG_CHECKING(for platform-specific compiler flags)
135 if test "x$GCC" = x
136 then
137         #
138         # Not GCC - assume it's the vendor's compiler.
139         #
140         case "$host_os" in
141         hpux*)
142                 #
143                 # HP's ANSI C compiler; flags suggested by Jost Martin.
144                 # "-Ae" for ANSI C plus extensions such as "long long".
145                 # "+O2", for optimization.  XXX - works with "-g"?
146                 #
147                 CFLAGS="-Ae +O2 $CFLAGS"
148                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
149                 ;;
150         darwin*)
151                 #
152                 # It may be called "cc", but it's really a GCC derivative
153                 # with a problematic special precompiler and precompiled
154                 # headers; turn off the special precompiler, as some
155                 # apparently-legal code won't compile with its precompiled
156                 # headers.
157                 #
158                 CFLAGS="-no-cpp-precomp $CFLAGS"
159                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
160                 ;;
161         *)
162                 AC_MSG_RESULT(none needed)
163                 ;;
164         esac
165 else
166         case "$host_os" in
167         solaris*)
168                 # the X11 headers don't automatically include prototype info
169                 # and a lot don't include the return type
170                 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
171                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
172                 ;;
173         darwin*)
174                 #
175                 # See comments above about Apple's lovely C compiler.
176                 #
177                 CFLAGS="-no-cpp-precomp $CFLAGS"
178                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
179                 ;;
180         cygwin*)
181                 #
182                 # Shared libraries in cygwin/Win32 must never contain
183                 # undefined symbols.
184                 #
185                 LDFLAGS="$LDFLAGS -no-undefined"
186                 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
187                 ;;
188         *)
189                 AC_MSG_RESULT(none needed)
190                 ;;
191         esac
192 fi
193
194 #
195 # On OS X, if we find the headers for Core Foundation and Launch Services,
196 # add -framework options to link with Application Services (of which
197 # Launch Services is a subframework) and Core Foundation (required by
198 # the Launch Services APIs), so we can use that to launch a Web browser
199 # from the Help menu.
200 #
201 # (Do those headers exist on pure Darwin?  If so, does the CoreFoundation
202 # *and* Launch Services code exist there, or are those headers just stubs?
203 # If the frameworks aren't present on Darwin, how *should* we check for
204 # their existence?)
205 #
206 case "$host_os" in
207
208 darwin*)
209         AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
210         ac_save_LIBS="$LIBS"
211         ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
212         LIBS="$LIBS $ac_frameworks"
213         AC_TRY_LINK(
214            [
215 #       include <CoreFoundation/CFBase.h>
216 #       include <CoreFoundation/CFString.h>
217 #       include <CoreFoundation/CFURL.h>
218 #       include <ApplicationServices/ApplicationServices.h>
219            ],
220            [
221         CFStringRef url_CFString;
222         CFURLRef url_CFURL;
223         OSStatus status;
224
225         url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
226         url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
227         status = LSOpenCFURLRef(url_CFURL, NULL);
228            ],
229            ac_cv_can_use_cf_and_ls=yes,
230            ac_cv_can_use_cf_and_ls=no,
231            [echo $ac_n "cross compiling; assumed OK... $ac_c"])
232         if test "$ac_cv_can_use_cf_and_ls" = yes ; then
233                 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
234                 FRAMEWORKS="$ac_frameworks"
235                 AC_MSG_RESULT(yes)
236         else
237                 AC_MSG_RESULT(no)
238         fi
239         LIBS="$ac_save_LIBS"
240         ;;
241 esac
242 AC_SUBST(FRAMEWORKS)
243
244 dnl Look in /usr/local for header files and libraries ?
245 dnl XXX FIXME don't include /usr/local if it is already in the system
246 dnl search path as this causes gcc 3.2 on Linux to complain about a change
247 dnl of the system search order for includes
248 AC_ARG_ENABLE(usr-local,
249 [  --enable-usr-local      look for headers and libs in /usr/local tree.  [default=yes]],ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
250
251 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
252 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
253         AC_MSG_RESULT(yes)
254         #
255         # Arrange that we search for header files in the source directory
256         # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
257         # as various packages we use ("libpcap", "zlib", an SNMP library)
258         # may have been installed under "/usr/local/include".
259         #
260         CFLAGS="$CFLAGS -I/usr/local/include"
261         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
262
263         #
264         # Arrange that we search for libraries in "/usr/local/lib".
265         #
266         AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
267 else
268         AC_MSG_RESULT(no)
269 fi
270
271 #
272 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
273 # link directory.
274 #
275 case "$host_os" in
276   solaris*)
277     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
278     if test x$LD_LIBRARY_PATH != x ; then
279       LIBS="$LIBS -R$LD_LIBRARY_PATH"
280       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
281     else
282       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
283     fi
284   ;;
285 esac
286
287 #
288 # Check for versions of "sed" inadequate to handle, in libtool, a list
289 # of object files as large as the list in Ethereal.
290 #
291 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
292 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
293 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
294 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
295 # is the only "sed" that comes with Solaris that can handle Ethereal.
296 #
297 # Add any checks here that are necessary for other OSes.
298 #
299 AC_ETHEREAL_GNU_SED_CHECK
300 if test "$HAVE_GNU_SED" = no ; then
301         case "$host_os" in
302         solaris*)
303                 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
304                 case `which sed` in
305                         /bin/sed|/usr/bin/sed|/usr/ucb/sed)
306                         AC_MSG_RESULT(yes)              
307                         AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
308                         ;;
309
310                         *)
311                         AC_MSG_RESULT(no)
312                         ;;
313                 esac
314                 ;;
315
316         *)
317                 :
318                 ;;
319         esac
320 fi
321
322 # Enable/disable tethereal
323
324 AC_ARG_ENABLE(ethereal,
325 [  --enable-ethereal       build GTK+-based ethereal.  [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
326
327 AC_ARG_ENABLE(gtk2,
328 [  --disable-gtk2          build Glib1/Gtk1+-based (t)ethereal.  [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
329 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
330
331 AC_ARG_ENABLE(threads,
332 [  --enable-threads        use threads in ethereal.  [default=no]],enable_threads=$enableval,enable_threads=no)
333 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
334
335 AC_ARG_ENABLE(profile-build,
336 [  --enable-profile-build  build profile-ready binaries.  [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
337 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
338 AC_MSG_CHECKING(if profile builds must be generated)
339 if test "x$enable_profile_build" = "xyes" ; then
340         if test -n "$GCC" ; then
341                 AC_MSG_RESULT(yes)
342                 CFLAGS=" -pg $CFLAGS"
343         else
344                 AC_MSG_RESULT(no)
345                 echo "Building profile binaries currently only supported for GCC."
346         fi
347 else
348         AC_MSG_RESULT(no)
349 fi
350
351 # Create DATAFILE_DIR #define for config.h
352 datafiledir=$datadir/ethereal
353 datafiledir=`(
354     test "x$prefix" = xNONE && prefix=$ac_default_prefix
355     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
356     eval echo "$datafiledir"
357 )`
358 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
359
360 # GTK checks
361 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
362 # programs to be built with GTK+.
363 #
364 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
365         GTK_OK=two
366         AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
367 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
368         GTK_OK=one
369         AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
370 else
371         GTK_OK=no
372 fi
373
374 # GLib checks
375 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
376 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
377 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
378 # set when generating the Makefile, so we can make programs that require
379 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
380 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
381 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
382 # programs to be built with GLib.
383 #
384 if test "$GTK_OK" = "no" ; then
385         enable_ethereal="no"
386         ethereal_bin=""
387         ethereal_man=""
388         # Honor GLIB_CFLAGS
389         if test "x$enable_gtk2" = "xyes" ; then
390                 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
391         else
392                 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
393         fi
394 else
395         ethereal_bin="ethereal\$(EXEEXT)"
396         ethereal_man="ethereal.1"
397         ethereal_SUBDIRS="gtk"
398         # Honor GLIB_CFLAGS
399         if test "$GTK_OK" = "two" ; then
400                 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
401         else
402                 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
403         fi
404 fi
405
406 #
407 # Check whether GLib modules are supported, to determine whether we
408 # can support plugins.
409 #
410 AC_MSG_CHECKING(whether GLib supports loadable modules)
411 ac_save_CFLAGS="$CFLAGS"
412 ac_save_LIBS="$LIBS"
413 CFLAGS="$CFLAGS $GLIB_CFLAGS"
414 LIBS="$GLIB_LIBS $LIBS"
415 AC_TRY_RUN([
416 #include <glib.h>
417 #include <gmodule.h>
418 #include <stdio.h>
419 #include <stdlib.h>
420
421 int 
422 main ()
423 {
424   if (g_module_supported())
425     return 0;   /* success */
426   else
427     return 1;   /* failure */
428 }
429 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
430    [echo $ac_n "cross compiling; assumed OK... $ac_c"
431     ac_cv_glib_supports_modules=yes])
432 CFLAGS="$ac_save_CFLAGS"
433 LIBS="$ac_save_LIBS"
434 if test "$ac_cv_glib_supports_modules" = yes ; then
435   AC_MSG_RESULT(yes)
436   have_plugins=yes
437 else
438   AC_MSG_RESULT(no)
439   have_plugins=no
440 fi
441
442 #
443 # We can't just check for <inttypes.h> - some systems have one that
444 # doesn't define all the PRI[doxu]64 macros.
445 #
446 AC_CHECK_HEADERS(inttypes.h,
447   [
448     #
449     # OK, we have inttypes.h, but does it define those macros?
450     #
451     AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
452     AC_COMPILE_IFELSE(
453       [
454         AC_LANG_SOURCE(
455           [[
456             #include <inttypes.h>
457             #include <glib.h>
458             #include <stdio.h>
459             #include <sys/types.h>
460
461             main()
462             {
463               printf("%" PRId64 "\n", (gint64)1);
464               printf("%" PRIo64 "\n", (guint64)1);
465               printf("%" PRIx64 "\n", (guint64)1);
466               printf("%" PRIX64 "\n", (guint64)1);
467               printf("%" PRIu64 "\n", (guint64)1);
468             }
469           ]])
470       ],
471       [
472         AC_MSG_RESULT(yes)
473         ac_ethereal_inttypes_h_defines_formats=yes
474       ],
475       [
476         AC_MSG_RESULT(no)
477         ac_ethereal_inttypes_h_defines_formats=no
478       ])
479   ],
480   [
481     #
482     # We don't have inttypes.h, so it obviously can't define those
483     # macros.
484     #
485     ac_ethereal_inttypes_h_defines_formats=no
486   ])
487 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
488   AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
489 else
490   AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
491     [
492       AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
493         [
494           AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
495             [
496               AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
497             ])
498         ])
499     ])
500 fi
501
502 AC_SUBST(ethereal_bin)
503 AC_SUBST(ethereal_man)
504
505 rdps_bin="rdps\$(EXEEXT)"
506 AC_SUBST(rdps_bin)
507
508
509 # Enable/disable tethereal
510
511 AC_ARG_ENABLE(tethereal,
512 [  --enable-tethereal      build tethereal.  [default=yes]],tethereal=$enableval,enable_tethereal=yes)
513
514 if test "x$enable_tethereal" = "xyes" ; then
515         tethereal_bin="tethereal\$(EXEEXT)"
516         tethereal_man="tethereal.1"
517         etherealfilter_man="ethereal-filter.4"
518 else
519         tethereal_bin=""
520         tethereal_man=""
521 fi
522 AC_SUBST(tethereal_bin)
523 AC_SUBST(tethereal_man)
524 AC_SUBST(etherealfilter_man)
525
526
527
528 # Enable/disable editcap
529
530 AC_ARG_ENABLE(editcap,
531 [  --enable-editcap        build editcap.  [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
532
533 if test "x$enable_editcap" = "xyes" ; then
534         editcap_bin="editcap\$(EXEEXT)"
535         editcap_man="editcap.1"
536 else
537         editcap_bin=""
538         editcap_man=""
539 fi
540 AC_SUBST(editcap_bin)
541 AC_SUBST(editcap_man)
542
543
544 # Enable/disable dumpcap
545
546 AC_ARG_ENABLE(dumpcap,
547 [  --enable-dumpcap        build dumpcap.  [default=no]],enable_dumpcap=$enableval,enable_dumpcap=no)
548
549 if test "x$enable_dumpcap" = "xyes" ; then
550         dumpcap_bin="dumpcap\$(EXEEXT)"
551         dumpcap_man="dumpcap.1"
552 else
553         dumpcap_bin=""
554         dumpcap_man=""
555 fi
556 AC_SUBST(dumpcap_bin)
557 AC_SUBST(dumpcap_man)
558
559
560 # Enable/disable capinfos
561
562 AC_ARG_ENABLE(capinfos,
563 [  --enable-capinfos       build capinfos.  [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
564
565 if test "x$enable_capinfos" = "xyes" ; then
566         capinfos_bin="capinfos\$(EXEEXT)"
567         capinfos_man="capinfos.1"
568 else
569         capinfos_bin=""
570         capinfos_man=""
571 fi
572 AC_SUBST(capinfos_bin)
573 AC_SUBST(capinfos_man)
574
575
576 # Enable/disable mergecap
577
578 AC_ARG_ENABLE(mergecap,
579 [  --enable-mergecap       build mergecap.  [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
580
581 if test "x$enable_mergecap" = "xyes" ; then
582         mergecap_bin="mergecap\$(EXEEXT)"
583         mergecap_man="mergecap.1"
584 else
585         mergecap_bin=""
586         mergecap_man=""
587 fi
588 AC_SUBST(mergecap_bin)
589 AC_SUBST(mergecap_man)
590
591
592 # Enable/disable text2pcap
593
594 AC_ARG_ENABLE(text2pcap,
595 [  --enable-text2pcap      build text2pcap.  [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
596
597 if test "x$enable_text2pcap" = "xyes" ; then
598         text2pcap_bin="text2pcap\$(EXEEXT)"
599         text2pcap_man="text2pcap.1"
600 else
601         text2pcap_bin=""
602         text2pcap_man=""
603 fi
604 AC_SUBST(text2pcap_bin)
605 AC_SUBST(text2pcap_man)
606
607 # Enable/disable idl2eth
608
609 AC_ARG_ENABLE(idl2eth,
610 [  --enable-idl2eth        build idl2eth.  [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
611
612 if test "x$enable_idl2eth" = "xyes" ; then
613         idl2eth_bin="idl2eth"
614         idl2eth_man="idl2eth.1"
615 else
616         idl2eth_bin=""
617         idl2eth_man=""
618 fi
619 AC_SUBST(idl2eth_bin)
620 AC_SUBST(idl2eth_man)
621
622
623 # Enable/disable dftest
624
625 AC_ARG_ENABLE(dftest,
626 [  --enable-dftest         build dftest.  [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
627
628 if test "x$enable_dftest" = "xyes" ; then
629         dftest_bin="dftest\$(EXEEXT)"
630 else
631         dftest_bin=""
632 fi
633 AC_SUBST(dftest_bin)
634
635
636 # Enable/disable randpkt
637
638 AC_ARG_ENABLE(randpkt,
639 [  --enable-randpkt        build randpkt.  [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
640
641 if test "x$enable_randpkt" = "xyes" ; then
642         randpkt_bin="randpkt\$(EXEEXT)"
643 else
644         randpkt_bin=""
645 fi
646 AC_SUBST(randpkt_bin)
647
648
649 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
650 dnl "gethostbyname()".
651 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
652
653 dnl Checks for "connect()", used as a proxy for "socket()" - and
654 dnl "-lsocket", if we need it to get "connect()".
655 AC_ETHEREAL_SOCKET_LIB_CHECK
656
657 dnl pcap check
658 AC_MSG_CHECKING(whether to use libpcap for packet capture)
659
660 AC_ARG_WITH(pcap,
661 [  --with-pcap[[=DIR]]       use libpcap for packet capturing.  [[default=yes]]],
662 [
663         if test $withval = no
664         then
665                 want_pcap=no
666         elif test $withval = yes
667         then
668                 want_pcap=yes
669         else
670                 want_pcap=yes
671                 pcap_dir=$withval
672         fi
673 ],[
674         want_pcap=yes
675         pcap_dir=
676 ])
677 if test "x$want_pcap" = "xno" ; then
678         AC_MSG_RESULT(no)
679 else
680         AC_MSG_RESULT(yes)
681         AC_ETHEREAL_PCAP_CHECK
682 fi
683
684 dnl zlib check
685 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
686
687 AC_ARG_WITH(zlib,
688 [  --with-zlib[[=DIR]]       use zlib (located in directory DIR, if supplied) to read compressed data.  [[default=yes, if available]]],
689 [
690         if test $withval = no
691         then
692                 want_zlib=no
693         elif test $withval = yes
694         then
695                 want_zlib=yes
696         else
697                 want_zlib=yes
698                 zlib_dir=$withval
699         fi
700 ],[
701         #
702         # Use zlib if it's present, otherwise don't.
703         #
704         want_zlib=ifavailable
705         zlib_dir=
706 ])
707 if test "x$want_zlib" = "xno" ; then
708         AC_MSG_RESULT(no)
709 else
710         AC_MSG_RESULT(yes)
711         AC_ETHEREAL_ZLIB_CHECK
712         if test "x$want_zlib" = "xno" ; then
713                 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
714         fi
715 fi
716
717
718 dnl pcre check
719 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
720
721 AC_ARG_WITH(pcre,
722 [  --with-pcre[[=DIR]]       use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions.  [[default=yes, if available]]],
723 [
724         if test $withval = no
725         then
726                 want_pcre=no
727         elif test $withval = yes
728         then
729                 want_pcre=yes
730         else
731                 want_pcre=yes
732                 pcre_dir=$withval
733         fi
734 ],[
735         #
736         # Use libpcre if it's present, otherwise don't.
737         #
738         want_pcre=ifavailable
739         pcre_dir=
740 ])
741 if test "x$want_pcre" = "xno" ; then
742         AC_MSG_RESULT(no)
743 else
744         AC_MSG_RESULT(yes)
745         AC_ETHEREAL_LIBPCRE_CHECK
746         if test "x$want_pcre" = "xno" ; then
747                 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
748         fi
749 fi
750
751
752 dnl ipv6 check
753 AC_ARG_ENABLE(ipv6,
754 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
755
756 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
757 if test "x$enable_ipv6" = "xno" ; then
758         AC_MSG_RESULT(no)
759 else
760         AC_MSG_RESULT(yes)
761         AC_ETHEREAL_IPV6_STACK
762 fi
763
764
765 dnl Check if ethereal should be installed setuid
766 AC_ARG_ENABLE(setuid-install,
767 [  --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
768
769 AC_MSG_CHECKING(whether to install ethereal setuid)
770 if test "x$enable_setuid_install" = "xno" ; then
771         AC_MSG_RESULT(no)
772 else
773         AC_MSG_RESULT(yes)
774 fi
775
776 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
777
778 dnl Checks for header files.
779 AC_HEADER_STDC
780 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
781 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
782 AC_CHECK_HEADERS(netinet/in.h)
783 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
784 AC_CHECK_HEADERS(iconv.h)
785
786 dnl SSL Check
787 SSL_LIBS=''
788 AC_MSG_CHECKING(whether to use SSL library)
789
790 AC_ARG_WITH(ssl,
791 [  --with-ssl[[=DIR]]        use SSL crypto library (located in directory DIR, if supplied).   [[default=no]]],
792 [
793 if test "x$withval" = "xno";  then
794         want_ssl=no
795 elif test "x$withval" = "xyes"; then
796         want_ssl=yes
797 elif test -d "$withval"; then
798         want_ssl=yes
799         AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
800 fi
801 ],[
802         want_ssl=no
803 ])
804 if test "x$want_ssl" = "xyes"; then
805         AC_MSG_RESULT(yes)
806         AC_CHECK_LIB(crypto,EVP_md5,
807             [
808                 SSL_LIBS=-lcrypto
809             ],
810             [
811                 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
812             ])
813 else
814         AC_MSG_RESULT(no)
815 fi
816 AC_SUBST(SSL_LIBS)
817
818 dnl UCD SNMP/Net-SNMP Check
819 SNMP_LIBS=''
820
821 AC_ARG_WITH(net-snmp,
822 [  --with-net-snmp[[=PATH]]  use Net-SNMP library (with PATH as the location of the net-snmp-config shell script that comes with the net-snmp package, if supplied)  [[default=yes, if available]]],
823 [
824         if test $withval = no
825         then
826                 want_netsnmp=no
827         elif test $withval = yes
828         then
829                 want_netsnmp=yes
830         else
831                 want_netsnmp=yes
832                 netsnmpconfig="$withval"
833         fi
834 ],[
835         #
836         # Set "want_netsnmp" to "ifavailable" to make the default "use it
837         # if you find it, otherwise don't".
838         #
839         want_netsnmp=ifavailable
840 ])
841
842 AC_ARG_WITH(ucd-snmp,
843 [  --with-ucd-snmp[[=DIR]]   use UCD SNMP client library (located in directory DIR, if supplied).  [[default=yes, if available]]],
844 [
845         if test $withval = no
846         then
847                 want_ucdsnmp=no
848         elif test $withval = yes
849         then
850                 want_ucdsnmp=yes
851         else
852                 want_ucdsnmp=yes
853                 ucdsnmp_dir=$withval
854         fi
855 ],[
856         #
857         # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
858         # if you find it, otherwise don't".
859         #
860         want_ucdsnmp=ifavailable
861         ucdsnmp_dir=
862 ])
863
864 #
865 # Try Net-SNMP first.
866 #
867 AC_MSG_CHECKING(whether to use Net-SNMP library)
868 if test "x$want_netsnmp" = "xno" ; then
869         AC_MSG_RESULT(no)
870 else
871         if test "x$want_netsnmp" = "xifavailable" ; then
872                 AC_MSG_RESULT([yes, if available])
873         else
874                 AC_MSG_RESULT(yes)
875         fi
876         AC_ETHEREAL_NETSNMP_CHECK
877 fi
878
879 #
880 # If that didn't find Net-SNMP, try UCD SNMP.
881 #
882 if test "x$have_net_snmp" != "xyes" ; then
883         AC_MSG_CHECKING(whether to use UCD SNMP library)
884         if test "x$want_ucdsnmp" = "xno" ; then
885                 AC_MSG_RESULT(no)
886         else
887                 if test "x$want_ucdsnmp" = "xifavailable" ; then
888                         AC_MSG_RESULT([yes, if available])
889                 else
890                         AC_MSG_RESULT(yes)
891                 fi
892                 AC_ETHEREAL_UCDSNMP_CHECK
893         fi
894 fi
895
896 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
897         AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
898 fi
899
900 AC_SUBST(SNMP_LIBS)
901
902
903 dnl kerberos check
904 AC_MSG_CHECKING(whether to use kerberos)
905
906 AC_ARG_WITH(krb5,
907 [  --with-krb5[[=DIR]]       use kerberos (located in directory DIR, if supplied) to use in kerberos dissection  [[default=yes]]],
908 [
909         if test $withval = no
910         then
911                 want_krb5=no
912         elif test $withval = yes
913         then
914                 want_krb5=yes
915         else
916                 want_krb5=yes
917                 krb5_dir=$withval
918         fi
919 ],[
920         #
921         # Use kerberos if specified, otherwise don't.
922         #
923         want_krb5=ifavailable
924         krb5_dir=
925 ])
926 if test "x$want_krb5" = "xno" ; then
927         AC_MSG_RESULT(no)
928 else
929         AC_MSG_RESULT(yes)
930         AC_ETHEREAL_KRB5_CHECK
931 fi
932
933
934 dnl ADNS Check
935 ADNS_LIBS=''
936 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
937
938 AC_ARG_WITH(adns,
939 [  --with-adns[[=DIR]]       use GNU ADNS (located in directory DIR, if supplied).   [[default=yes, if present]]],
940 [
941 if   test "x$withval" = "xno";  then
942         want_adns=no
943 elif test "x$withval" = "xyes"; then
944         want_adns=yes
945 elif test -d "$withval"; then
946         want_adns=yes
947         AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
948 fi
949 ])
950 if test "x$with_adns" = "xno" ; then
951         AC_MSG_RESULT(no)
952 else
953         AC_MSG_RESULT(yes)
954         AC_ETHEREAL_ADNS_CHECK
955 fi
956 AC_SUBST(ADNS_LIBS)
957
958 #
959 # Define ETH_VAR_IMPORT appropriately for declarations of external
960 # variables exported from dynamically-linked libraries.
961 #
962 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
963
964 dnl Checks for typedefs, structures, and compiler characteristics.
965 # AC_C_CONST
966
967 # We need to know whether "struct sockaddr" has an "sa_len" member
968 # for get_interface_list().
969
970 AC_ETHEREAL_STRUCT_SA_LEN
971
972 # We must know our byte order
973 AC_C_BIGENDIAN
974
975 # Checks whether "-traditional" is needed when using "ioctl".
976 # XXX - do we need this?
977 AC_PROG_GCC_TRADITIONAL
978
979 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
980 # then this won't work.
981 SNPRINTF_C=""
982 SNPRINTF_O=""
983 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
984   [SNPRINTF_O="snprintf.o"
985    AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
986 ])
987 if test "$ac_cv_func_snprintf" = no ; then
988   SNPRINTF_C="snprintf.c"
989   SNPRINTF_O="snprintf.o"
990 fi
991 AC_SUBST(SNPRINTF_C)
992 AC_SUBST(SNPRINTF_O)
993
994 AC_CHECK_FUNC(strerror, STRERROR_O="",
995   [STRERROR_O="strerror.o"
996    AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
997 ])
998 if test "$ac_cv_func_strerror" = no ; then
999   STRERROR_C="strerror.c"
1000   STRERROR_O="strerror.o"
1001 fi
1002 AC_SUBST(STRERROR_C)
1003 AC_SUBST(STRERROR_O)
1004
1005 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1006   STRCASECMP_O="strcasecmp.o")
1007 if test "$ac_cv_func_strcasecmp" = no ; then
1008   STRCASECMP_C="strcasecmp.c"
1009   STRCASECMP_O="strcasecmp.o"
1010 fi
1011 AC_SUBST(STRCASECMP_C)
1012 AC_SUBST(STRCASECMP_O)
1013
1014 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1015   STRNCASECMP_O="strncasecmp.o")
1016 if test "$ac_cv_func_strncasecmp" = no ; then
1017   STRNCASECMP_C="strncasecmp.c"
1018   STRNCASECMP_O="strncasecmp.o"
1019 fi
1020 AC_SUBST(STRNCASECMP_C)
1021 AC_SUBST(STRNCASECMP_O)
1022
1023 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1024   MKSTEMP_O="mkstemp.o")
1025 if test "$ac_cv_func_mkstemp" = no ; then
1026   MKSTEMP_C="mkstemp.c"
1027   MKSTEMP_O="mkstemp.o"
1028 fi
1029 AC_SUBST(MKSTEMP_C)
1030 AC_SUBST(MKSTEMP_O)
1031
1032 ac_save_LIBS="$LIBS"
1033 LIBS="$GLIB_LIBS $LIBS"
1034 G_ASCII_STRTOULL_C=""
1035 G_ASCII_STRTOULL_O=""
1036 G_ASCII_STRTOULL_LO=""
1037 AC_CHECK_FUNC(g_ascii_strtoull,
1038   [G_ASCII_STRTOULL_O=""
1039    G_ASCII_STRTOULL_LO=""],
1040   [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1041    G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1042    AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1043 ])
1044 LIBS="$ac_save_LIBS"
1045 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1046   G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1047   G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1048   G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1049 fi
1050 AC_SUBST(G_ASCII_STRTOULL_C)
1051 AC_SUBST(G_ASCII_STRTOULL_O)
1052 AC_SUBST(G_ASCII_STRTOULL_LO)
1053
1054 AC_CHECK_FUNC(inet_aton,
1055   [INET_ATON_O=""
1056    INET_ATON_LO=""],
1057   [INET_ATON_O="inet_aton.o"
1058    INET_ATON_LO="inet_aton.lo"
1059 ])
1060 if test "$ac_cv_func_inet_aton" = no ; then
1061   INET_ATON_C="inet_aton.c"
1062   INET_ATON_O="inet_aton.o"
1063   INET_ATON_LO="inet_aton.lo"
1064   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1065 fi
1066 AC_SUBST(INET_ATON_C)
1067 AC_SUBST(INET_ATON_O)
1068 AC_SUBST(INET_ATON_LO)
1069
1070 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1071   dnl check for pre-BIND82 inet_pton() bug.
1072   AC_MSG_CHECKING(for broken inet_pton)
1073   AC_TRY_RUN([#include <sys/types.h>
1074 #include <sys/socket.h>
1075 #include <netinet/in.h>
1076 #include <arpa/inet.h>
1077 int main()
1078 {
1079 #ifdef AF_INET6
1080   char buf[16];
1081   /* this should return 0 (error) */
1082   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1083 #else
1084   return 1;
1085 #endif
1086 }], [AC_MSG_RESULT(ok);
1087 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1088 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1089 have_inet_pton=no])],
1090 have_inet_pton=no)
1091 if test "$have_inet_pton" = no; then
1092   INET_PTON_C="inet_pton.c"
1093   INET_PTON_O="inet_pton.o"
1094   INET_PTON_LO="inet_pton.lo"
1095 else
1096   INET_PTON_C=""
1097   INET_PTON_O=""
1098   INET_PTON_LO=""
1099 fi
1100 AC_SUBST(INET_PTON_C)
1101 AC_SUBST(INET_PTON_O)
1102 AC_SUBST(INET_PTON_LO)
1103
1104 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1105   AC_MSG_CHECKING([for inet_ntop prototype])
1106   AC_TRY_COMPILE([#include <stdio.h>
1107 #include <sys/types.h>
1108 #include <sys/socket.h>
1109 #include <netinet/in.h>
1110 #include <arpa/inet.h>
1111
1112 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1113     AC_MSG_RESULT(yes)
1114     AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1115     [Define if inet_ntop() prototype exists])], [
1116     AC_TRY_COMPILE([#include <stdio.h>
1117 #include <sys/types.h>
1118 #include <sys/socket.h>
1119 #include <netinet/in.h>
1120 #include <arpa/inet.h>
1121
1122 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1123       AC_MSG_RESULT(yes)
1124       AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1125       [Define if inet_ntop() prototype exists])], [
1126       AC_MSG_RESULT(no)])])
1127   INET_NTOP_O=""
1128   INET_NTOP_LO=""], [
1129   INET_NTOP_C="inet_ntop.c"
1130   INET_NTOP_O="inet_ntop.o"
1131   INET_NTOP_LO="inet_ntop.lo"
1132   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1133   [Define if inet/v6defs.h needs to be included])])
1134 AC_SUBST(INET_NTOP_C)
1135 AC_SUBST(INET_NTOP_O)
1136 AC_SUBST(INET_NTOP_LO)
1137
1138 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1139   [STRPTIME_O="strptime.o"
1140    AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1141 ])
1142 if test "$ac_cv_func_strptime" = no ; then
1143   STRPTIME_C="strptime.c"
1144   STRPTIME_O="strptime.o"
1145 fi
1146 AC_SUBST(STRPTIME_C)
1147 AC_SUBST(STRPTIME_O)
1148
1149 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1150
1151 dnl blank for now, but will be used in future
1152 AC_SUBST(ethereal_SUBDIRS)
1153
1154 dnl
1155 dnl check whether plugins should be enabled and, if they should be,
1156 dnl check for plugins directory - stolen from Amanda's configure.in
1157 dnl
1158 plugindir="$libdir/ethereal/plugins/$VERSION"
1159 AC_ARG_WITH(plugins,
1160 [  --with-plugins[[=DIR]]    support plugins (installed in DIR, if supplied).],
1161 [
1162   case "$withval" in
1163   "" | y | ye | yes )
1164     if test x$have_plugins = xno
1165     then
1166       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1167     fi
1168     ;;
1169   n | no)
1170     have_plugins=no
1171     ;;
1172   *)
1173     if test x$have_plugins = xno
1174     then
1175       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1176     fi
1177     plugindir="$withval"
1178     ;;
1179   esac
1180 ])
1181
1182 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1183 if test x$have_plugins = xyes
1184 then
1185   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1186   plugindir=`(
1187     test "x$prefix" = xNONE && prefix=$ac_default_prefix
1188     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1189     eval echo "$plugindir"
1190   )`
1191   AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1192 else
1193   AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1194 fi
1195 AC_SUBST(plugindir)
1196
1197 #
1198 # The plugin dissectors reside in ./plugins/PROTO/
1199 #
1200 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
1201 AC_SUBST(PLUGIN_LIBS)
1202
1203 dnl libtool defs
1204 #
1205 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1206 # (autoconf?  automake?  libtool?) - with the newer version(s), it's
1207 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1208 #
1209 # With older version(s) of those tool(s), however, it's not just an
1210 # alias, and the configure scripts don't work without it.
1211 #
1212 AM_PROG_LIBTOOL
1213 AC_SUBST(LIBTOOL_DEPS)
1214
1215 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1216 if test x$enable_static = xyes -a x$have_plugins = xyes
1217 then
1218   AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
1219 fi
1220 AC_SUBST(ENABLE_STATIC)
1221
1222 dnl Save the cacheable configure results to config.cache before recursing
1223 AC_CACHE_SAVE
1224
1225 AM_CONFIG_HEADER(config.h)
1226 AC_CONFIG_SUBDIRS(wiretap)
1227 AC_OUTPUT(
1228   Makefile
1229   doxygen.cfg
1230   doc/Makefile
1231   epan/Makefile
1232   epan/doxygen.cfg
1233   epan/dfilter/Makefile
1234   epan/dissectors/Makefile
1235   epan/ftypes/Makefile
1236   gtk/Makefile
1237   gtk/doxygen.cfg
1238   help/Makefile
1239   packaging/Makefile
1240   packaging/nsis/Makefile
1241   packaging/rpm/Makefile
1242   packaging/rpm/SPECS/Makefile
1243   packaging/rpm/SPECS/ethereal.spec
1244   packaging/svr4/Makefile
1245   packaging/svr4/checkinstall
1246   packaging/svr4/pkginfo
1247   plugins/Makefile
1248   plugins/acn/Makefile
1249   plugins/agentx/Makefile
1250   plugins/artnet/Makefile
1251   plugins/asn1/Makefile
1252   plugins/ciscosm/Makefile
1253   plugins/docsis/Makefile
1254   plugins/enttec/Makefile
1255   plugins/giop/Makefile
1256   plugins/gryphon/Makefile
1257   plugins/h223/Makefile
1258   plugins/irda/Makefile
1259   plugins/lwres/Makefile
1260   plugins/mate/Makefile
1261   plugins/megaco/Makefile
1262   plugins/mgcp/Makefile
1263   plugins/opsi/Makefile
1264   plugins/pcli/Makefile
1265   plugins/profinet/Makefile
1266   plugins/rdm/Makefile
1267   plugins/rlm/Makefile
1268   plugins/rtnet/Makefile
1269   plugins/rudp/Makefile
1270   plugins/stats_tree/Makefile
1271   plugins/v5ua/Makefile
1272   tools/Makefile
1273   tools/lemon/Makefile
1274   ,)
1275
1276
1277 # Pretty messages
1278
1279 if test "x$enable_setuid_install" = "xyes" ; then
1280         setuid_message="yes (DANGEROUS!!!)"
1281 else
1282         setuid_message="no"
1283 fi
1284
1285 if test "x$want_zlib" = "xno" ; then
1286         zlib_message="no"
1287 else
1288         zlib_message="yes"
1289 fi
1290
1291 if test "x$want_pcre" = "xno" ; then
1292         pcre_message="no"
1293 else
1294         pcre_message="yes"
1295 fi
1296
1297 if test "x$want_ssl" = "xno" ; then
1298         ssl_message="no"
1299 else
1300         ssl_message="yes"
1301 fi
1302
1303 if test "x$want_krb5" = "xno" ; then
1304         krb5_message="no"
1305 else
1306         krb5_message="yes ($ac_krb5_version)"
1307 fi
1308
1309 if test "x$have_good_adns" = "xyes" ; then
1310         adns_message="yes"
1311 else
1312         adns_message="no"
1313 fi
1314
1315 if test "x$have_net_snmp" = "xyes" ; then
1316         snmp_libs_message="yes (net-snmp)"
1317 elif test "x$have_ucdsnmp" = "xyes" ; then
1318         snmp_libs_message="yes (ucd-snmp)"
1319 else
1320         snmp_libs_message="no"
1321 fi
1322
1323 echo ""
1324 echo "The Ethereal package has been configured with the following options."
1325 echo "                    Build ethereal : $enable_ethereal"
1326 echo "                   Build tethereal : $enable_tethereal"
1327 echo "                    Build capinfos : $enable_capinfos"
1328 echo "                     Build editcap : $enable_editcap"
1329 echo "                     Build dumpcap : $enable_dumpcap"
1330 echo "                    Build mergecap : $enable_mergecap"
1331 echo "                   Build text2pcap : $enable_text2pcap"
1332 echo "                     Build idl2eth : $enable_idl2eth"
1333 echo "                     Build randpkt : $enable_randpkt"
1334 echo "                      Build dftest : $enable_dftest"
1335 echo ""
1336 echo "                    Install setuid : $setuid_message"
1337 echo "                       Use plugins : $have_plugins"
1338 echo "               Use GTK+ v2 library : $enable_gtk2"
1339 if test "x$enable_gtk2" = "xyes" ; then
1340 echo "                       Use threads : $enable_threads"
1341 echo "            Build profile binaries : $enable_profile_build"
1342 fi
1343 echo "                  Use pcap library : $want_pcap"
1344 echo "                  Use zlib library : $zlib_message"
1345 echo "                  Use pcre library : $pcre_message"
1346 echo "              Use kerberos library : $krb5_message"
1347 echo "              Use GNU ADNS library : $adns_message"
1348 echo "            Use SSL crypto library : $ssl_message"
1349 echo "          Use IPv6 name resolution : $enable_ipv6"
1350 echo "     Use UCD SNMP/Net-SNMP library : $snmp_libs_message"