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