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