Use "proto_tree_add_item()" whenever possible; this fixes some bugs
[obnox/wireshark/wip.git] / configure.in
1 # $Id: configure.in,v 1.144 2002/01/09 23:21:54 gram 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 AM_INIT_AUTOMAKE(ethereal, 0.9.0)
17
18 dnl Check for CPU / vendor / OS
19 AC_CANONICAL_HOST
20
21 dnl Checks for programs.
22 AC_PROG_CC
23 AC_PROG_CPP
24 AC_PROG_RANLIB
25 AC_PROG_YACC
26 AM_PROG_LEX
27 AC_PATH_PROG(PERL, perl)
28 AC_PATH_PROG(LEX, flex)
29 AC_PATH_PROG(PYTHON, python)
30
31 AC_SUBST(PERL)
32 AC_SUBST(LEX)
33 AC_SUBST(PYTHON)
34
35 # Check for packaging utilities
36 # For now, we check to see if the various packaging utilites are in our
37 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
38 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
39 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
40 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
41 AC_CHECK_PROG(HAVE_RPM, rpm, "yes", "no")
42
43 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
44      -a x$HAVE_PKGTRANS = xyes ; then
45   HAVE_SVR4_PACKAGING=yes
46 else
47   HAVE_SVR4_PACKAGING=no
48 fi
49 AC_SUBST(HAVE_SVR4_PACKAGING)
50
51 # Grr.  Rpm 2.x has a nifty "--showrc" flag that lists all of the current
52 # configuration values.  Version 3.x took the niftiness away by returning
53 # the values in their raw, unexpanded, macro-embedded form.  We can either
54 # try to expand the values we get from 3.x, or poke around for popular build
55 # directories.
56 HAVE_RPM_PACKAGING=no
57 if test x$HAVE_RPM = xyes ; then
58   AC_MSG_CHECKING(for rpm build directories)
59   RPM_SOURCESDIR=`rpm --showrc | grep "^sourcedir" | \
60     sed -e 's/.*: //' 2> /dev/null`
61   if test x$RPM_SPECDIR = x ; then
62     # Red Hat  : /usr/src/redhat
63     # Mandrake : /usr/scr/rpm
64     # SuSE     : /usr/src/packages
65     for TEST_DIR in /usr/src/redhat /usr/src/rpm /usr/src/packages ; do
66       if test -d $TEST_DIR/SPECS -a -d $TEST_DIR/SOURCES -a \
67               -d $TEST_DIR/RPMS -a -d $TEST_DIR/SRPMS -a \
68               -d $TEST_DIR/BUILD ; then
69         RPM_SOURCESDIR=$TEST_DIR/SOURCES
70       fi
71     done
72   fi
73   if test x$RPM_SOURCESDIR = x ; then
74     AC_MSG_RESULT(not found)
75     RPM_SOURCESDIR=""
76   else
77     AC_MSG_RESULT(found)
78     HAVE_RPM_PACKAGING=yes
79   fi
80 fi
81 AC_SUBST(HAVE_RPM_PACKAGING)
82
83
84 # If we're running gcc, add '-Wall' to CFLAGS.
85 AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
86 if test x$GCC != x ; then
87   CFLAGS="-Wall -W -Wno-unused $CFLAGS"
88   AC_MSG_RESULT(yes)
89 else
90   AC_MSG_RESULT(no)
91 fi
92
93 #
94 # Add any platform-specific compiler flags needed.
95 #
96 AC_MSG_CHECKING(for platform-specific compiler flags)
97 if test "x$GCC" = x
98 then
99         #
100         # Not GCC - assume it's the vendor's compiler.
101         #
102         case "$host_os" in
103         hpux*)
104                 #
105                 # HP's ANSI C compiler; flags suggested by Jost Martin.
106                 # "-Ae" for ANSI C plus extensions such as "long long".
107                 # "+O2", for optimization.  XXX - works with "-g"?
108                 #
109                 CFLAGS="-Ae +O2 $CFLAGS"
110                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
111                 ;;
112         darwin*)
113                 #
114                 # It may be called "cc", but it's really a GCC derivative
115                 # with a problematic special precompiler and precompiled
116                 # headers; turn off the special precompiler, as some
117                 # apparently-legal code won't compile with its precompiled
118                 # headers.
119                 #
120                 CFLAGS="-no-cpp-precomp $CFLAGS"
121                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
122                 ;;
123         *)
124                 AC_MSG_RESULT(none needed)
125                 ;;
126         esac
127 else
128         case "$host_os" in
129         solaris*)
130                 # the X11 headers don't automatically include prototype info
131                 # and a lot don't include the return type
132                 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
133                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
134                 ;;
135         darwin*)
136                 #
137                 # See comments above about Apple's lovely C compiler.
138                 #
139                 CFLAGS="-no-cpp-precomp $CFLAGS"
140                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
141                 ;;
142         *)
143                 AC_MSG_RESULT(none needed)
144                 ;;
145         esac
146 fi
147
148 CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan"
149 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan"
150
151 dnl Look in /usr/local for header files and libraries ?
152 AC_ARG_ENABLE(usr-local,
153 [  --enable-usr-local      look for headers and libs in /usr/local tree.  [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
154
155 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
156 if test "x$enable_usr_local" = "xyes" ; then
157         AC_MSG_RESULT(yes)
158         #
159         # Arrange that we search for header files in the source directory
160         # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
161         # as various packages we use ("libpcap", "zlib", an SNMP library)
162         # may have been installed under "/usr/local/include".
163         #
164         CFLAGS="$CFLAGS -I/usr/local/include"
165         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
166
167         #
168         # Arrange that we search for libraries in "/usr/local/lib".
169         #
170         AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
171 else
172         AC_MSG_RESULT(no)
173 fi
174
175 # Create DATAFILE_DIR #define for config.h
176 DATAFILE_DIR=$sysconfdir
177 DATAFILE_DIR=`(
178     test "x$prefix" = xNONE && prefix=$ac_default_prefix
179     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
180     eval echo "$DATAFILE_DIR"
181 )`
182 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
183 AC_SUBST(DATAFILE_DIR)
184
185 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
186 # link directory.
187 case "$host_os" in
188   solaris*)
189     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
190     if test x$LD_LIBRARY_PATH != x ; then
191       LIBS="$LIBS -R$LD_LIBRARY_PATH"
192       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
193     else
194       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
195     fi
196   ;;
197 esac
198
199
200 # Enable/disable tethereal
201
202 GTK_OK=yes
203
204 AC_ARG_ENABLE(ethereal,
205 [  --enable-ethereal       build GTK+-based ethereal.  [default=yes]],,enable_ethereal=yes)
206
207 # GTK checks
208 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
209 # programs to be built with GTK+.
210 #
211 if test "x$enable_ethereal" = "xyes" ; then
212         AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
213 fi
214
215 # GLib checks
216 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
217 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
218 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
219 # set when generating the Makefile, so we can make programs that require
220 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
221 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
222 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
223 # programs to be built with GLib.
224 #
225 if test "$GTK_OK" = "yes" -a "x$enable_ethereal" = "xyes" ; then
226         ethereal_bin="ethereal"
227         ethereal_man="ethereal.1"
228         ethereal_SUBDIRS="gtk"
229
230         # Ignore GLIB_CFLAGS
231         AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
232 else
233         enable_ethereal="no"
234         ethereal_bin=""
235         ethereal_man=""
236         # Honor GLIB_CFLAGS
237         AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
238 fi
239
240 #
241 # Check whether GLib modules are supported, to determine whether we
242 # can support plugins.
243 #
244 AC_MSG_CHECKING(whether GLib supports loadable modules)
245 ac_save_CFLAGS="$CFLAGS"
246 ac_save_LIBS="$LIBS"
247 CFLAGS="$CFLAGS $GLIB_CFLAGS"
248 LIBS="$GLIB_LIBS $LIBS"
249 AC_TRY_RUN([
250 #include <glib.h>
251 #include <gmodule.h>
252 #include <stdio.h>
253 #include <stdlib.h>
254
255 int 
256 main ()
257 {
258   if (g_module_supported())
259     return 0;   /* success */
260   else
261     return 1;   /* failure */
262 }
263 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
264    [echo $ac_n "cross compiling; assumed OK... $ac_c"])
265 CFLAGS="$ac_save_CFLAGS"
266 LIBS="$ac_save_LIBS"
267 if test "$ac_cv_glib_supports_modules" = yes ; then
268   AC_MSG_RESULT(yes)
269   have_plugins=yes
270 else
271   AC_MSG_RESULT(no)
272   have_plugins=no
273 fi
274
275
276 AC_SUBST(ethereal_bin)
277 AC_SUBST(ethereal_man)
278
279
280
281 # Enable/disable tethereal
282
283 AC_ARG_ENABLE(tethereal,
284 [  --enable-tethereal      build tethereal.  [default=yes]],,enable_tethereal=yes)
285
286 if test "x$enable_tethereal" = "xyes" ; then
287         tethereal_bin="tethereal"
288         tethereal_man="tethereal.1"
289 else
290         tethereal_bin=""
291         tethereal_man=""
292 fi
293 AC_SUBST(tethereal_bin)
294 AC_SUBST(tethereal_man)
295
296
297
298 # Enable/disable editcap
299
300 AC_ARG_ENABLE(editcap,
301 [  --enable-editcap        build editcap.  [default=yes]],,enable_editcap=yes)
302
303 if test "x$enable_editcap" = "xyes" ; then
304         editcap_bin="editcap"
305         editcap_man="editcap.1"
306 else
307         editcap_bin=""
308         editcap_man=""
309 fi
310 AC_SUBST(editcap_bin)
311 AC_SUBST(editcap_man)
312
313
314 # Enable/disable mergecap
315
316 AC_ARG_ENABLE(mergecap,
317 [  --enable-mergecap       build mergecap.  [default=yes]],,enable_mergecap=yes)
318
319 if test "x$enable_mergecap" = "xyes" ; then
320         mergecap_bin="mergecap"
321         mergecap_man="mergecap.1"
322 else
323         mergecap_bin=""
324         mergecap_man=""
325 fi
326 AC_SUBST(mergecap_bin)
327 AC_SUBST(mergecap_man)
328
329
330 # Enable/disable text2pcap
331
332 AC_ARG_ENABLE(text2pcap,
333 [  --enable-text2pcap      build text2pcap.  [default=yes]],,enable_text2pcap=yes)
334
335 if test "x$enable_text2pcap" = "xyes" ; then
336         text2pcap_bin="text2pcap"
337         text2pcap_man="text2pcap.1"
338 else
339         text2pcap_bin=""
340         text2pcap_man=""
341 fi
342 AC_SUBST(text2pcap_bin)
343 AC_SUBST(text2pcap_man)
344
345 # Enable/disable idl2eth
346
347 AC_ARG_ENABLE(idl2eth,
348 [  --enable-idl2eth      build idl2eth.  [default=yes]],,enable_idl2eth=yes)
349
350 if test "x$enable_idl2eth" = "xyes" ; then
351         idl2eth_bin="idl2eth"
352         idl2eth_man="idl2eth.1"
353 else
354         idl2eth_bin=""
355         idl2eth_man=""
356 fi
357 AC_SUBST(idl2eth_bin)
358 AC_SUBST(idl2eth_man)
359
360
361 # Enable/disable dftest
362
363 AC_ARG_ENABLE(dftest,
364 [  --enable-dftest         build dftest.  [default=no]],,enable_dftest=no)
365
366 if test "x$enable_dftest" = "xyes" ; then
367         dftest_bin="dftest"
368 else
369         dftest_bin=""
370 fi
371 AC_SUBST(dftest_bin)
372
373
374 # Enable/disable randpkt
375
376 AC_ARG_ENABLE(randpkt,
377 [  --enable-randpkt        build randpkt.  [default=no]],,enable_randpkt=no)
378
379 if test "x$enable_randpkt" = "xyes" ; then
380         randpkt_bin="randpkt"
381 else
382         randpkt_bin=""
383 fi
384 AC_SUBST(randpkt_bin)
385
386
387 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
388 dnl "gethostbyname()".
389 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
390
391 dnl Checks for "connect()", used as a proxy for "socket()" - and
392 dnl "-lsocket", if we need it to get "connect()".
393 AC_ETHEREAL_SOCKET_LIB_CHECK
394
395 dnl pcap check
396 AC_MSG_CHECKING(whether to use libpcap for packet capture)
397
398 AC_ARG_WITH(pcap,
399 [  --with-pcap[=DIR]       use libpcap for packet capturing.  [default=yes]],
400 [
401         if test $withval = no
402         then
403                 want_pcap=no
404         elif test $withval = yes
405         then
406                 want_pcap=yes
407         else
408                 want_pcap=yes
409                 pcap_dir=$withval
410         fi
411 ],[
412         want_pcap=yes
413         pcap_dir=
414 ])
415 if test "x$want_pcap" = "xno" ; then
416         AC_MSG_RESULT(no)
417 else
418         AC_MSG_RESULT(yes)
419         AC_ETHEREAL_PCAP_CHECK
420         AC_ETHEREAL_PCAP_VERSION_CHECK
421 fi
422
423 dnl zlib check
424 AC_ARG_ENABLE(zlib,
425 [  --enable-zlib           use zlib to read compressed data.  [default=yes]],,enable_zlib=yes)
426
427 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
428 if test "x$enable_zlib" = "xno" ; then
429         AC_MSG_RESULT(no)
430 else
431         AC_MSG_RESULT(yes)
432         AC_ETHEREAL_ZLIB_CHECK
433         if test "x$enable_zlib" = "xno" ; then
434                 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
435         fi
436 fi
437
438
439 dnl ipv6 check
440 AC_ARG_ENABLE(ipv6,
441 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],,enable_ipv6=yes)
442
443 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
444 if test "x$enable_ipv6" = "xno" ; then
445         AC_MSG_RESULT(no)
446 else
447         AC_MSG_RESULT(yes)
448         AC_ETHEREAL_IPV6_STACK
449 fi
450
451
452 dnl Check if ethereal should be installed setuid
453 AC_ARG_ENABLE(setuid-install,
454 [  --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],,enable_setuid_install=no)
455
456 AC_MSG_CHECKING(whether to install ethereal setuid)
457 if test "x$enable_setuid_install" = "xno" ; then
458         AC_MSG_RESULT(no)
459 else
460         AC_MSG_RESULT(yes)
461 fi
462
463 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
464
465 dnl Checks for header files.
466 AC_HEADER_STDC
467 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h)
468 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h sys/socket.h)
469 AC_CHECK_HEADERS(sys/wait.h)
470 AC_CHECK_HEADERS(netinet/in.h)
471 AC_CHECK_HEADERS(stddef.h)
472 AC_CHECK_HEADERS(arpa/inet.h)
473 AC_CHECK_HEADERS(iconv.h)
474
475 dnl SSL Check
476 SSL_LIBS=''
477 AC_MSG_CHECKING(whether to use SSL library if available)
478 if test "x$enable_ssl" = "xno" ; then
479         AC_MSG_RESULT(no)
480 else
481         AC_MSG_RESULT(yes)
482         AC_ETHEREAL_SSL_CHECK
483 fi
484 AC_SUBST(SSL_LIBS)
485
486 dnl SNMP Check
487 AC_ARG_ENABLE(snmp,
488 [  --enable-snmp           use SNMP library, if available.  [default=yes]],,enable_snmp=yes)
489
490 SNMP_LIBS=''
491 AC_MSG_CHECKING(whether to use SNMP library if available)
492 if test "x$enable_snmp" = "xno" ; then
493         AC_MSG_RESULT(no)
494 else
495         AC_MSG_RESULT(yes)
496         AC_ETHEREAL_UCDSNMP_CHECK
497         AC_CHECK_HEADERS(ucd-snmp/snmp.h ucd-snmp/version.h snmp/snmp.h snmp/version.h)
498
499         #
500         # If we found both UCD and CMU SNMP headers, die, as both
501         # packages install the SNMP library as "libsnmp", so either
502         # only one of them is present or they're in different
503         # directories, and we run the risk of picking up the headers
504         # from one and the library from another.
505         #
506         if test "$ac_cv_header_ucd_snmp_snmp_h" = yes -a \
507            "$ac_cv_header_snmp_snmp_h" = yes ; then
508             AC_MSG_ERROR([Both UCD and CMU SNMP libraries found - uninstall one of them.])
509         fi
510         
511         #
512         # Look for the string 'sbuf' in ucd-snmp/mib.h.  If found, assume
513         # we've encountered a Red Hat-modified version of UCD SNMP.
514         #
515         # XXX - Check for 'binit()' in parse.h
516         #
517         AC_EGREP_HEADER(sprint_objid.*sbuf, ucd-snmp/mib.h, 
518           AC_DEFINE(RED_HAT_MODIFIED_UCD_SNMP))
519
520
521         #
522         # This may require "-lkstat" on Solaris, sigh.
523         #
524         AC_CHECK_LIB(snmp, sprint_objid,
525           SNMP_LIBS=-lsnmp,
526           [
527             #
528             # Throw away the cached "we didn't find it" answer.
529             #
530             unset ac_cv_lib_snmp_sprint_objid
531             AC_CHECK_LIB(snmp, sprint_objid,
532               [
533                 #
534                 # Throw away the cached "we found it" answer, so that if
535                 # we rerun "configure", we don't just blow off this check
536                 # and blithely assume that we don't need "-lkstat".
537                 #
538                 # XXX - autoconf really needs a way to test for a given
539                 # routine in a given library *and* to test whether additional
540                 # "-L"/"-R"/whatever flags are needed *before* the "-l"
541                 # flag for the library and to test whether additional libraries
542                 # are needed after the library *and* to cache all that
543                 # information.
544                 #
545                 unset ac_cv_lib_snmp_sprint_objid
546                 SNMP_LIBS="-lsnmp -lkstat"
547               ],,$SOCKET_LIBS $NSL_LIBS $SSL_LIBS -lkstat
548             )
549           ], $SOCKET_LIBS $NSL_LIBS $SSL_LIBS
550         )
551
552         #
553         # If we have SNMP header files but didn't find "sprint_objid()",
554         # fail, as there's something wrong (perhaps the user needs to
555         # specify "--with-ssl").
556         #
557         if test '(' "$ac_cv_header_ucd_snmp_snmp_h" = yes -o \
558            "$ac_cv_header_snmp_snmp_h" = yes ')' -a \
559            "$ac_cv_lib_snmp_sprint_objid" = no; then
560             AC_MSG_ERROR([SNMP header files found, but sprint_objid not found in SNMP library.])
561         fi
562 fi
563 AC_SUBST(SNMP_LIBS)
564
565 dnl Checks for typedefs, structures, and compiler characteristics.
566 # AC_C_CONST
567
568 # We need to know whether "struct sockaddr" has an "sa_len" member
569 # for get_interface_list().
570
571 AC_ETHEREAL_STRUCT_SA_LEN
572
573 # We must know our byte order
574 AC_C_BIGENDIAN
575
576 # Checks whether "-traditional" is needed when using "ioctl".
577 # XXX - do we need this?
578 AC_PROG_GCC_TRADITIONAL
579
580 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
581 # then this won't work.
582 SNPRINTF_C=""
583 SNPRINTF_O=""
584 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
585   SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
586 if test "$ac_cv_func_snprintf" = no ; then
587   SNPRINTF_C="snprintf.c"
588   SNPRINTF_O="snprintf.o"
589 fi
590 AC_SUBST(SNPRINTF_C)
591 AC_SUBST(SNPRINTF_O)
592
593 AC_CHECK_FUNC(strerror, STRERROR_O="",
594   STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
595 if test "$ac_cv_func_strerror" = no ; then
596   STRERROR_C="strerror.c"
597   STRERROR_O="strerror.o"
598 fi
599 AC_SUBST(STRERROR_C)
600 AC_SUBST(STRERROR_O)
601
602 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
603   STRCASECMP_O="strcasecmp.o")
604 if test "$ac_cv_func_strcasecmp" = no ; then
605   STRCASECMP_C="strcasecmp.c"
606   STRCASECMP_O="strcasecmp.o"
607 fi
608 AC_SUBST(STRCASECMP_C)
609 AC_SUBST(STRCASECMP_O)
610
611 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
612   STRNCASECMP_O="strncasecmp.o")
613 if test "$ac_cv_func_strncasecmp" = no ; then
614   STRNCASECMP_C="strncasecmp.c"
615   STRNCASECMP_O="strncasecmp.o"
616 fi
617 AC_SUBST(STRNCASECMP_C)
618 AC_SUBST(STRNCASECMP_O)
619
620 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
621   MKSTEMP_O="mkstemp.o")
622 if test "$ac_cv_func_mkstemp" = no ; then
623   MKSTEMP_C="mkstemp.c"
624   MKSTEMP_O="mkstemp.o"
625 fi
626 AC_SUBST(MKSTEMP_C)
627 AC_SUBST(MKSTEMP_O)
628
629 AC_CHECK_FUNC(strptime, STRPTIME_O="",
630   STRPTIME_O="strptime.o" [AC_DEFINE(NEED_STRPTIME_H)])
631 if test "$ac_cv_func_strptime" = no ; then
632   STRPTIME_C="strptime.c"
633   STRPTIME_O="strptime.o"
634 fi
635 AC_SUBST(STRPTIME_C)
636 AC_SUBST(STRPTIME_O)
637
638 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
639
640 dnl blank for now, but will be used in future
641 AC_SUBST(ethereal_SUBDIRS)
642
643 dnl
644 dnl check whether plugins should be enabled and, if they should be,
645 dnl check for plugins directory - stolen from Amanda's configure.in
646 dnl
647 PLUGIN_DIR="$libdir/ethereal/plugins/$VERSION"
648 AC_ARG_WITH(plugins,
649   [  --with-plugins[=DIR]    support plugins (installed in DIR, if supplied).],
650   [
651   case "$withval" in
652   "" | y | ye | yes )
653     if test x$have_plugins = xno
654     then
655       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
656     fi
657     ;;
658   n | no)
659     have_plugins=no
660     ;;
661   *)
662     if test x$have_plugins = xno
663     then
664       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
665     fi
666     PLUGIN_DIR="$withval"
667     ;;
668   esac
669   ]
670 )
671
672 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
673 if test x$have_plugins = xyes
674 then
675   AC_DEFINE(HAVE_PLUGINS)
676   PLUGIN_DIR=`(
677     test "x$prefix" = xNONE && prefix=$ac_default_prefix
678     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
679     eval echo "$PLUGIN_DIR"
680   )`
681   AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
682 else
683   AC_DEFINE(PLUGIN_DIR,NULL)
684 fi
685 AC_SUBST(PLUGIN_DIR)
686
687 dnl libtool defs
688 AC_LIBTOOL_DLOPEN
689 AM_PROG_LIBTOOL
690 AC_SUBST(LIBTOOL_DEPS)
691
692 AM_CONFIG_HEADER(config.h)
693 AC_CONFIG_SUBDIRS(epan wiretap)
694 AC_OUTPUT(
695   Makefile
696   doc/Makefile
697   gtk/Makefile
698   packaging/Makefile
699   packaging/nsis/Makefile
700   packaging/rpm/Makefile
701   packaging/rpm/ethereal.spec
702   packaging/svr4/Makefile
703   packaging/svr4/checkinstall
704   packaging/svr4/pkginfo
705   plugins/Makefile
706   plugins/gryphon/Makefile
707   plugins/mgcp/Makefile
708   plugins/giop/Makefile
709   tools/Makefile
710   tools/lemon/Makefile
711   ,)
712
713
714 # Pretty messages
715
716 if test "x$enable_setuid_install" = "xyes" ; then
717         setuid_message="yes (DANGEROUS!!!)"
718 else
719         setuid_message="no"
720 fi
721
722 if test "x$SNMP_LIBS" = "x" ; then
723         snmp_libs_message="no"
724 else
725         snmp_libs_message="yes"
726 fi
727
728
729
730 echo ""
731 echo "The Ethereal package has been configured with the following options."
732 echo "                    Build ethereal : $enable_ethereal"
733 echo "                   Build tethereal : $enable_tethereal"
734 echo "                     Build editcap : $enable_editcap"
735 echo "                    Build mergecap : $enable_mergecap"
736 echo "                   Build text2pcap : $enable_text2pcap"
737 echo "                     Build idl2eth : $enable_idl2eth"
738 echo "                     Build randpkt : $enable_randpkt"
739 echo "                      Build dftest : $enable_dftest"
740 echo ""
741 echo "                    Install setuid : $setuid_message"
742 echo "                       Use plugins : $have_plugins"
743 echo "                  Use pcap library : $want_pcap"
744 echo "                  Use zlib library : $enable_zlib"
745 echo "          Use IPv6 name resolution : $enable_ipv6"
746 echo "                  Use SNMP library : $snmp_libs_message"