Prep for the 0.9.14 release
[obnox/wireshark/wip.git] / configure.in
1 # $Id: configure.in,v 1.212 2003/07/23 02:06:24 gerald Exp $
2 dnl
3 dnl Process this file with autoconf 2.13 or later to produce a
4 dnl configure script; 2.12 doesn't generate a "configure" script that
5 dnl defines SHELL, and "Makefile.in" has
6 dnl
7 dnl     SHELL = @SHELL@
8 dnl
9 dnl which requires it to be defined - and there may be other problems
10 dnl with pre-2.13 "autoconf" as well.
11 dnl
12 AC_INIT(etypes.h)
13
14 AC_PREREQ(2.13)
15
16 dnl Check for CPU / vendor / OS
17 AC_CANONICAL_HOST
18 AC_CANONICAL_TARGET
19
20 AM_INIT_AUTOMAKE(ethereal, 0.9.14)
21
22 dnl Checks for programs.
23 AC_PROG_CC
24 AC_PROG_CPP
25 AM_DISABLE_STATIC
26 dnl Work around libtool bug (fixed in the version 1.5a?)
27 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
28 AC_LIBTOOL_DLOPEN
29 AC_PROG_LIBTOOL
30 AC_PROG_YACC
31 AM_PROG_LEX
32 AC_PATH_PROG(PERL, perl)
33 AC_PATH_PROG(POD2MAN, pod2man)
34 AC_PATH_PROG(LEX, flex)
35 AC_PATH_PROG(PYTHON, python)
36
37 AC_SUBST(PERL)
38 AC_SUBST(LEX)
39 AC_SUBST(PYTHON)
40
41 # Check for packaging utilities
42 # For now, we check to see if the various packaging utilites are in our
43 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
44 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
45 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
46 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
47
48 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
49      -a x$HAVE_PKGTRANS = xyes ; then
50   HAVE_SVR4_PACKAGING=yes
51 else
52   HAVE_SVR4_PACKAGING=no
53 fi
54 AC_SUBST(HAVE_SVR4_PACKAGING)
55
56 AC_ETHEREAL_RPM_CHECK
57 AC_SUBST(HAVE_RPM)
58
59 #
60 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
61 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
62 # flag unused function arguments and not get warnings about them.
63 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
64 # -Wcast-align" as well.  (Add more checks here in the future?)
65 #
66 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
67 # argument will compile with non-GCC compilers.
68 #
69 AC_ARG_WITH(extra-gcc-checks,
70 [  --with-extra-gcc-checks do additional -W checks in GCC.  [default=no]],
71 [
72         if test $withval != no
73         then
74                 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align"
75         fi
76 ],)
77 AC_MSG_CHECKING(to see if we can add '-Wall -W$ethereal_extra_gcc_flags' to CFLAGS)
78 if test x$GCC != x ; then
79   CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W$ethereal_extra_gcc_flags $CFLAGS"
80   AC_MSG_RESULT(yes)
81 else
82   CFLAGS="-D_U_=\"\" $CFLAGS"
83   AC_MSG_RESULT(no)
84 fi
85
86 #
87 # Add any platform-specific compiler flags needed.
88 #
89 AC_MSG_CHECKING(for platform-specific compiler flags)
90 if test "x$GCC" = x
91 then
92         #
93         # Not GCC - assume it's the vendor's compiler.
94         #
95         case "$host_os" in
96         hpux*)
97                 #
98                 # HP's ANSI C compiler; flags suggested by Jost Martin.
99                 # "-Ae" for ANSI C plus extensions such as "long long".
100                 # "+O2", for optimization.  XXX - works with "-g"?
101                 #
102                 CFLAGS="-Ae +O2 $CFLAGS"
103                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
104                 ;;
105         darwin*)
106                 #
107                 # It may be called "cc", but it's really a GCC derivative
108                 # with a problematic special precompiler and precompiled
109                 # headers; turn off the special precompiler, as some
110                 # apparently-legal code won't compile with its precompiled
111                 # headers.
112                 #
113                 CFLAGS="-no-cpp-precomp $CFLAGS"
114                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
115                 ;;
116         *)
117                 AC_MSG_RESULT(none needed)
118                 ;;
119         esac
120 else
121         case "$host_os" in
122         solaris*)
123                 # the X11 headers don't automatically include prototype info
124                 # and a lot don't include the return type
125                 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
126                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
127                 ;;
128         darwin*)
129                 #
130                 # See comments above about Apple's lovely C compiler.
131                 #
132                 CFLAGS="-no-cpp-precomp $CFLAGS"
133                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
134                 ;;
135         *)
136                 AC_MSG_RESULT(none needed)
137                 ;;
138         esac
139 fi
140
141 CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
142 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
143
144 dnl Look in /usr/local for header files and libraries ?
145 dnl XXX FIXME don't include /usr/local if it is already in the system
146 dnl search path as this causes gcc 3.2 on Linux to complain about a change
147 dnl of the system search order for includes
148 AC_ARG_ENABLE(usr-local,
149 [  --enable-usr-local      look for headers and libs in /usr/local tree.  [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
150
151 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
152 if test "x$enable_usr_local" = "xyes" ; then
153         AC_MSG_RESULT(yes)
154         #
155         # Arrange that we search for header files in the source directory
156         # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
157         # as various packages we use ("libpcap", "zlib", an SNMP library)
158         # may have been installed under "/usr/local/include".
159         #
160         CFLAGS="$CFLAGS -I/usr/local/include"
161         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
162
163         #
164         # Arrange that we search for libraries in "/usr/local/lib".
165         #
166         AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
167 else
168         AC_MSG_RESULT(no)
169 fi
170
171 #
172 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
173 # link directory.
174 #
175 case "$host_os" in
176   solaris*)
177     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
178     if test x$LD_LIBRARY_PATH != x ; then
179       LIBS="$LIBS -R$LD_LIBRARY_PATH"
180       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
181     else
182       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
183     fi
184   ;;
185 esac
186
187 #
188 # Check for versions of "sed" inadequate to handle, in libtool, a list
189 # of object files as large as the list in Ethereal.
190 #
191 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
192 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
193 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
194 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
195 # is the only "sed" that comes with Solaris that can handle Ethereal.
196 #
197 # Add any checks here that are necessary for other OSes.
198 #
199 AC_ETHEREAL_GNU_SED_CHECK
200 if test "$HAVE_GNU_SED" = no ; then
201         case "$host_os" in
202         solaris*)
203                 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
204                 case `which sed` in
205                         /bin/sed|/usr/bin/sed|/usr/ucb/sed)
206                         AC_MSG_RESULT(yes)              
207                         AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
208                         ;;
209
210                         *)
211                         AC_MSG_RESULT(no)
212                         ;;
213                 esac
214                 ;;
215
216         *)
217                 :
218                 ;;
219         esac
220 fi
221
222 # Enable/disable tethereal
223
224 AC_ARG_ENABLE(ethereal,
225 [  --enable-ethereal       build GTK+-based ethereal.  [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
226
227 AC_ARG_ENABLE(gtk2,
228 [  --enable-gtk2           build Glib2/Gtk2+-based (t)ethereal.  [default=no]],enable_gtk2=$enableval,enable_gtk2=no)
229 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
230
231 AC_ARG_ENABLE(threads,
232 [  --enable-threads        use threads in ethereal.  [default=no]],enable_threads=$enableval,enable_threads=no)
233 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
234
235 # GTK checks
236 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
237 # programs to be built with GTK+.
238 #
239 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
240         GTK_OK=two
241         AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
242 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
243         GTK_OK=one
244         AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
245 else
246         GTK_OK=no
247 fi
248
249 # GLib checks
250 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
251 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
252 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
253 # set when generating the Makefile, so we can make programs that require
254 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
255 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
256 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
257 # programs to be built with GLib.
258 #
259 if test "$GTK_OK" = "no" ; then
260         enable_ethereal="no"
261         ethereal_bin=""
262         ethereal_man=""
263         # Honor GLIB_CFLAGS
264         if test "x$enable_gtk2" = "xyes" ; then
265                 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
266         else
267                 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
268         fi
269 else
270         ethereal_bin="ethereal"
271         ethereal_man="ethereal.1"
272         ethereal_SUBDIRS="gtk"
273         # Honor GLIB_CFLAGS
274         if test "$GTK_OK" = "two" ; then
275                 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
276         else
277                 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
278         fi
279 fi
280
281 #
282 # Check whether GLib modules are supported, to determine whether we
283 # can support plugins.
284 #
285 AC_MSG_CHECKING(whether GLib supports loadable modules)
286 ac_save_CFLAGS="$CFLAGS"
287 ac_save_LIBS="$LIBS"
288 CFLAGS="$CFLAGS $GLIB_CFLAGS"
289 LIBS="$GLIB_LIBS $LIBS"
290 AC_TRY_RUN([
291 #include <glib.h>
292 #include <gmodule.h>
293 #include <stdio.h>
294 #include <stdlib.h>
295
296 int 
297 main ()
298 {
299   if (g_module_supported())
300     return 0;   /* success */
301   else
302     return 1;   /* failure */
303 }
304 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
305    [echo $ac_n "cross compiling; assumed OK... $ac_c"])
306 CFLAGS="$ac_save_CFLAGS"
307 LIBS="$ac_save_LIBS"
308 if test "$ac_cv_glib_supports_modules" = yes ; then
309   AC_MSG_RESULT(yes)
310   have_plugins=yes
311 else
312   AC_MSG_RESULT(no)
313   have_plugins=no
314 fi
315
316
317 AC_SUBST(ethereal_bin)
318 AC_SUBST(ethereal_man)
319
320
321
322 # Enable/disable tethereal
323
324 AC_ARG_ENABLE(tethereal,
325 [  --enable-tethereal      build tethereal.  [default=yes]],tethereal=$enableval,enable_tethereal=yes)
326
327 if test "x$enable_tethereal" = "xyes" ; then
328         tethereal_bin="tethereal"
329         tethereal_man="tethereal.1"
330 else
331         tethereal_bin=""
332         tethereal_man=""
333 fi
334 AC_SUBST(tethereal_bin)
335 AC_SUBST(tethereal_man)
336
337
338
339 # Enable/disable editcap
340
341 AC_ARG_ENABLE(editcap,
342 [  --enable-editcap        build editcap.  [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
343
344 if test "x$enable_editcap" = "xyes" ; then
345         editcap_bin="editcap"
346         editcap_man="editcap.1"
347 else
348         editcap_bin=""
349         editcap_man=""
350 fi
351 AC_SUBST(editcap_bin)
352 AC_SUBST(editcap_man)
353
354
355 # Enable/disable mergecap
356
357 AC_ARG_ENABLE(mergecap,
358 [  --enable-mergecap       build mergecap.  [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
359
360 if test "x$enable_mergecap" = "xyes" ; then
361         mergecap_bin="mergecap"
362         mergecap_man="mergecap.1"
363 else
364         mergecap_bin=""
365         mergecap_man=""
366 fi
367 AC_SUBST(mergecap_bin)
368 AC_SUBST(mergecap_man)
369
370
371 # Enable/disable text2pcap
372
373 AC_ARG_ENABLE(text2pcap,
374 [  --enable-text2pcap      build text2pcap.  [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
375
376 if test "x$enable_text2pcap" = "xyes" ; then
377         text2pcap_bin="text2pcap"
378         text2pcap_man="text2pcap.1"
379 else
380         text2pcap_bin=""
381         text2pcap_man=""
382 fi
383 AC_SUBST(text2pcap_bin)
384 AC_SUBST(text2pcap_man)
385
386 # Enable/disable idl2eth
387
388 AC_ARG_ENABLE(idl2eth,
389 [  --enable-idl2eth        build idl2eth.  [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
390
391 if test "x$enable_idl2eth" = "xyes" ; then
392         idl2eth_bin="idl2eth"
393         idl2eth_man="idl2eth.1"
394 else
395         idl2eth_bin=""
396         idl2eth_man=""
397 fi
398 AC_SUBST(idl2eth_bin)
399 AC_SUBST(idl2eth_man)
400
401
402 # Enable/disable dftest
403
404 AC_ARG_ENABLE(dftest,
405 [  --enable-dftest         build dftest.  [default=no]],enable_dftest=$enableval,enable_dftest=no)
406
407 if test "x$enable_dftest" = "xyes" ; then
408         dftest_bin="dftest"
409 else
410         dftest_bin=""
411 fi
412 AC_SUBST(dftest_bin)
413
414
415 # Enable/disable randpkt
416
417 AC_ARG_ENABLE(randpkt,
418 [  --enable-randpkt        build randpkt.  [default=no]],enable_randpkt=$enableval,enable_randpkt=no)
419
420 if test "x$enable_randpkt" = "xyes" ; then
421         randpkt_bin="randpkt"
422 else
423         randpkt_bin=""
424 fi
425 AC_SUBST(randpkt_bin)
426
427
428 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
429 dnl "gethostbyname()".
430 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
431
432 dnl Checks for "connect()", used as a proxy for "socket()" - and
433 dnl "-lsocket", if we need it to get "connect()".
434 AC_ETHEREAL_SOCKET_LIB_CHECK
435
436 dnl pcap check
437 AC_MSG_CHECKING(whether to use libpcap for packet capture)
438
439 AC_ARG_WITH(pcap,
440 [  --with-pcap[=DIR]       use libpcap for packet capturing.  [default=yes]],
441 [
442         if test $withval = no
443         then
444                 want_pcap=no
445         elif test $withval = yes
446         then
447                 want_pcap=yes
448         else
449                 want_pcap=yes
450                 pcap_dir=$withval
451         fi
452 ],[
453         want_pcap=yes
454         pcap_dir=
455 ])
456 if test "x$want_pcap" = "xno" ; then
457         AC_MSG_RESULT(no)
458 else
459         AC_MSG_RESULT(yes)
460         AC_ETHEREAL_PCAP_CHECK
461         AC_ETHEREAL_PCAP_VERSION_CHECK
462 fi
463
464 dnl zlib check
465 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
466
467 AC_ARG_WITH(zlib,
468 [  --with-zlib[=DIR]       use zlib (located in directory DIR, if supplied) to read compressed data.  [default=yes, if present]],
469 [
470         if test $withval = no
471         then
472                 want_zlib=no
473         elif test $withval = yes
474         then
475                 want_zlib=yes
476         else
477                 want_zlib=yes
478                 zlib_dir=$withval
479         fi
480 ],[
481         #
482         # Use zlib if it's present, otherwise don't.
483         #
484         want_zlib=ifpresent
485         zlib_dir=
486 ])
487 if test "x$want_zlib" = "xno" ; then
488         AC_MSG_RESULT(no)
489 else
490         AC_MSG_RESULT(yes)
491         AC_ETHEREAL_ZLIB_CHECK
492         if test "x$want_zlib" = "xno" ; then
493                 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
494         fi
495 fi
496
497
498 dnl ipv6 check
499 AC_ARG_ENABLE(ipv6,
500 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
501
502 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
503 if test "x$enable_ipv6" = "xno" ; then
504         AC_MSG_RESULT(no)
505 else
506         AC_MSG_RESULT(yes)
507         AC_ETHEREAL_IPV6_STACK
508 fi
509
510
511 dnl Check if ethereal should be installed setuid
512 AC_ARG_ENABLE(setuid-install,
513 [  --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
514
515 AC_MSG_CHECKING(whether to install ethereal setuid)
516 if test "x$enable_setuid_install" = "xno" ; then
517         AC_MSG_RESULT(no)
518 else
519         AC_MSG_RESULT(yes)
520 fi
521
522 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
523
524 dnl Checks for header files.
525 AC_HEADER_STDC
526 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h)
527 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h sys/socket.h)
528 AC_CHECK_HEADERS(sys/utsname.h sys/wait.h)
529 AC_CHECK_HEADERS(netinet/in.h)
530 AC_CHECK_HEADERS(stddef.h)
531 AC_CHECK_HEADERS(arpa/inet.h)
532 AC_CHECK_HEADERS(iconv.h)
533
534 dnl SSL Check
535 SSL_LIBS=''
536 AC_MSG_CHECKING(whether to use SSL library if available)
537 if test "x$enable_ssl" = "xno" ; then
538         AC_MSG_RESULT(no)
539 else
540         AC_MSG_RESULT(yes)
541         AC_ETHEREAL_SSL_CHECK
542 fi
543 AC_SUBST(SSL_LIBS)
544
545 dnl UCD SNMP Check
546 SNMP_LIBS=''
547
548 AC_ARG_WITH(net-snmp,
549 [  --with-net-snmp=PATH    use PATH as the location of the net-snmp-config shell script that comes with the net-snmp package.],
550 [netsnmpconfig=$withval]
551 )
552
553 AC_ARG_WITH(ucdsnmp,
554 [  --with-ucdsnmp[=DIR]    use UCD SNMP/NET-SNMP client library (located in directory DIR, if supplied).  [default=yes, if present]],
555 [
556         if test $withval = no
557         then
558                 want_ucdsnmp=no
559         elif test $withval = yes
560         then
561                 want_ucdsnmp=yes
562         else
563                 want_ucdsnmp=yes
564                 ucdsnmp_dir=$withval
565         fi
566 ],[
567         #
568         # Set "want_ucdsnmp" to "ifpresent" to make the default "use it
569         # if you find it, otherwise don't".
570         #
571         want_ucdsnmp=ifpresent
572         ucdsnmp_dir=
573 ])
574
575 dnl try net-snmp first
576 if test "x$netsnmpconfig" != "xno" ; then
577         dnl get the net-snmp-config binary
578         if test "x$netsnmpconfig" = "xyes" -o "x$netsnmpconfig" = "x" ; then
579                 dnl search for it
580                 AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config)
581         else
582                 NETSNMPCONFIG=$netsnmpconfig
583                 if test ! -x $NETSNMPCONFIG ; then
584                         AC_MSG_ERROR(Invalid net-snmp-config: $NETSNMPCONFIG)
585                 fi
586         fi
587 fi
588
589 AC_MSG_CHECKING(whether to use UCD SNMP/NET-SNMP library if available)
590 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
591         dnl other choices for flags to use here: could also use
592         dnl --prefix or --exec-prefix if you don't want the full list.
593
594         AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
595         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
596                 CFLAGS="$CFLAGS `net-snmp-config --cflags`"
597                 CPPFLAGS="$CPPLAGS `net-snmp-config --cflags`"
598                 SNMP_LIBS=`net-snmp-config --libs`
599                 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
600                 have_net_snmp="yes"
601                 AC_MSG_RESULT(yes (net-snmp))
602         else
603                 # technically, we should retry ucd-snmp but it's
604                 # unlikely they have installed net-snmp-config and not
605                 # the net-snmp headers but do have the ucd-snmp
606                 # headers.  This would likely be a broken system to
607                 # try and use anyway.
608                 NETSNMPCONFIG="no"
609                 AC_MSG_RESULT(no)
610         fi      
611 else
612         if test "x$want_ucdsnmp" = "xno" ; then
613                 AC_MSG_RESULT(no)
614         else
615                 AC_MSG_RESULT(yes (ucd-snmp))
616                 AC_ETHEREAL_UCDSNMP_CHECK
617         fi
618 fi
619
620 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
621         AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to if some SNMP support is to be used])
622 fi
623
624 AC_SUBST(SNMP_LIBS)
625
626 dnl ADNS Check
627 ADNS_LIBS=''
628 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
629 if test "x$enable_adns" = "xno" ; then
630         AC_MSG_RESULT(no)
631 else
632         AC_MSG_RESULT(yes)
633         AC_ETHEREAL_ADNS_CHECK
634 fi
635 AC_SUBST(ADNS_LIBS)
636
637 dnl Checks for typedefs, structures, and compiler characteristics.
638 # AC_C_CONST
639
640 # We need to know whether "struct sockaddr" has an "sa_len" member
641 # for get_interface_list().
642
643 AC_ETHEREAL_STRUCT_SA_LEN
644
645 # We must know our byte order
646 AC_C_BIGENDIAN
647
648 # Checks whether "-traditional" is needed when using "ioctl".
649 # XXX - do we need this?
650 AC_PROG_GCC_TRADITIONAL
651
652 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
653 # then this won't work.
654 SNPRINTF_C=""
655 SNPRINTF_O=""
656 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
657   [SNPRINTF_O="snprintf.o"
658    AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
659 ])
660 if test "$ac_cv_func_snprintf" = no ; then
661   SNPRINTF_C="snprintf.c"
662   SNPRINTF_O="snprintf.o"
663 fi
664 AC_SUBST(SNPRINTF_C)
665 AC_SUBST(SNPRINTF_O)
666
667 AC_CHECK_FUNC(strerror, STRERROR_O="",
668   [STRERROR_O="strerror.o"
669    AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
670 ])
671 if test "$ac_cv_func_strerror" = no ; then
672   STRERROR_C="strerror.c"
673   STRERROR_O="strerror.o"
674 fi
675 AC_SUBST(STRERROR_C)
676 AC_SUBST(STRERROR_O)
677
678 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
679   STRCASECMP_O="strcasecmp.o")
680 if test "$ac_cv_func_strcasecmp" = no ; then
681   STRCASECMP_C="strcasecmp.c"
682   STRCASECMP_O="strcasecmp.o"
683 fi
684 AC_SUBST(STRCASECMP_C)
685 AC_SUBST(STRCASECMP_O)
686
687 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
688   STRNCASECMP_O="strncasecmp.o")
689 if test "$ac_cv_func_strncasecmp" = no ; then
690   STRNCASECMP_C="strncasecmp.c"
691   STRNCASECMP_O="strncasecmp.o"
692 fi
693 AC_SUBST(STRNCASECMP_C)
694 AC_SUBST(STRNCASECMP_O)
695
696 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
697   MKSTEMP_O="mkstemp.o")
698 if test "$ac_cv_func_mkstemp" = no ; then
699   MKSTEMP_C="mkstemp.c"
700   MKSTEMP_O="mkstemp.o"
701 fi
702 AC_SUBST(MKSTEMP_C)
703 AC_SUBST(MKSTEMP_O)
704
705 AC_CHECK_FUNC(strptime, STRPTIME_O="",
706   [STRPTIME_O="strptime.o"
707    AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
708 ])
709 if test "$ac_cv_func_strptime" = no ; then
710   STRPTIME_C="strptime.c"
711   STRPTIME_O="strptime.o"
712 fi
713 AC_SUBST(STRPTIME_C)
714 AC_SUBST(STRPTIME_O)
715
716 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
717
718 dnl blank for now, but will be used in future
719 AC_SUBST(ethereal_SUBDIRS)
720
721 dnl
722 dnl check whether plugins should be enabled and, if they should be,
723 dnl check for plugins directory - stolen from Amanda's configure.in
724 dnl
725 plugindir="$libdir/ethereal/plugins/$VERSION"
726 AC_ARG_WITH(plugins,
727   [  --with-plugins[=DIR]    support plugins (installed in DIR, if supplied).],
728   [
729   case "$withval" in
730   "" | y | ye | yes )
731     if test x$have_plugins = xno
732     then
733       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
734     fi
735     ;;
736   n | no)
737     have_plugins=no
738     ;;
739   *)
740     if test x$have_plugins = xno
741     then
742       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
743     fi
744     plugindir="$withval"
745     ;;
746   esac
747   ]
748 )
749
750 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
751 if test x$have_plugins = xyes
752 then
753   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
754   plugindir=`(
755     test "x$prefix" = xNONE && prefix=$ac_default_prefix
756     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
757     eval echo "$plugindir"
758   )`
759   AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
760 else
761   AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
762 fi
763 AC_SUBST(plugindir)
764
765 dnl libtool defs
766 AM_PROG_LIBTOOL
767 AC_SUBST(LIBTOOL_DEPS)
768
769 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_shared = xno)
770 AM_CONFIG_HEADER(config.h)
771 AC_CONFIG_SUBDIRS(epan wiretap)
772 AC_OUTPUT(
773   Makefile
774   doc/Makefile
775   gtk/Makefile
776   packaging/Makefile
777   packaging/nsis/Makefile
778   packaging/rpm/Makefile
779   packaging/rpm/SPECS/Makefile
780   packaging/rpm/SPECS/ethereal.spec
781   packaging/svr4/Makefile
782   packaging/svr4/checkinstall
783   packaging/svr4/pkginfo
784   plugins/Makefile
785   plugins/artnet/Makefile
786   plugins/docsis/Makefile
787   plugins/giop/Makefile
788   plugins/gryphon/Makefile
789   plugins/megaco/Makefile
790   plugins/mgcp/Makefile
791   plugins/pcli/Makefile
792   plugins/rtnet/Makefile
793   tools/Makefile
794   tools/lemon/Makefile
795   ,)
796
797
798 # Pretty messages
799
800 if test "x$enable_setuid_install" = "xyes" ; then
801         setuid_message="yes (DANGEROUS!!!)"
802 else
803         setuid_message="no"
804 fi
805
806 if test "x$want_zlib" = "xno" ; then
807         zlib_message="no"
808 else
809         zlib_message="yes"
810 fi
811
812 if test "x$want_adns" = "xno" ; then
813         adns_message="no"
814 else
815         adns_message="yes"
816 fi
817
818 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
819         snmp_libs_message="yes (net-snmp)"
820 elif test "x$SNMP_LIBS" = "x" ; then
821         snmp_libs_message="no"
822 else
823         snmp_libs_message="yes (ucd-snmp)"
824 fi
825
826 echo ""
827 echo "The Ethereal package has been configured with the following options."
828 echo "                    Build ethereal : $enable_ethereal"
829 echo "                   Build tethereal : $enable_tethereal"
830 echo "                     Build editcap : $enable_editcap"
831 echo "                    Build mergecap : $enable_mergecap"
832 echo "                   Build text2pcap : $enable_text2pcap"
833 echo "                     Build idl2eth : $enable_idl2eth"
834 echo "                     Build randpkt : $enable_randpkt"
835 echo "                      Build dftest : $enable_dftest"
836 echo ""
837 echo "                    Install setuid : $setuid_message"
838 echo "                       Use plugins : $have_plugins"
839 echo "               Use GTK+ v2 library : $enable_gtk2"
840 if test "x$enable_gtk2" = "xyes" ; then
841 echo "                       Use threads : $enable_threads"
842 fi
843 echo "                  Use pcap library : $want_pcap"
844 echo "                  Use zlib library : $zlib_message"
845 echo "              Use GNU ADNS library : $adns_message"
846 echo "          Use IPv6 name resolution : $enable_ipv6"
847 echo "     Use UCD SNMP/NET-SNMP library : $snmp_libs_message"