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