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