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