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