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