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