1 # $Id: configure.in,v 1.73 2000/01/15 00:22:29 gram Exp $
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
9 dnl which requires it to be defined - and there may be other problems
10 dnl with pre-2.13 "autoconf" as well.
16 AM_INIT_AUTOMAKE(ethereal, 0.8.1)
18 dnl Check for CPU / vendor / OS
21 dnl Checks for programs.
27 AC_PATH_PROG(PERL_PATH, perl)
28 AC_PATH_PROG(LEX, flex)
34 # If we're running gcc, add '-Wall' to CFLAGS.
35 AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
36 if test x$GCC != x ; then
37 CFLAGS="-Wall $CFLAGS"
44 # Arrange that we search for header files in the source directory
45 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
46 # as various packages we use ("libpcap", "zlib", an SNMP library)
47 # may have been installed under "/usr/local/include".
49 CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I/usr/local/include"
50 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I/usr/local/include"
53 # Arrange that we search for libraries in "/usr/local/lib", and set
54 # a "-R" flag as appropriate.
56 # XXX - IRIX, and other OSes, may require some flag equivalent to
59 LIBS="$LIBS -L/usr/local/lib"
62 LIBS="$LIBS -R/usr/local/lib"
66 # Create DATAFILE_DIR #define for config.h
67 DATAFILE_DIR=$sysconfdir
69 test "x$prefix" = xNONE && prefix=$ac_default_prefix
70 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
71 eval echo "$DATAFILE_DIR"
73 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
74 AC_SUBST(DATAFILE_DIR)
76 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
80 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
81 if test x$LD_LIBRARY_PATH != x ; then
82 LIBS="$LIBS -R$LD_LIBRARY_PATH"
83 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
85 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
91 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
92 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
93 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
94 # set when generating the Makefile, so we can make programs that require
95 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
96 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
97 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
98 # programs to be built with GLib.
100 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.))
103 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
104 # programs to be built with GTK+.
106 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS",
107 AC_MSG_ERROR(GTK+ distribution not found.))
111 [ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
113 AC_MSG_CHECKING(whether to use libpcap for packet capture)
114 if test "x$enable_pcap" = "xno" ; then
118 AC_ETHEREAL_PCAP_CHECK
123 [ --enable-zlib use zlib to read compressed data. [default=yes]],, [dnl
125 netbsd*) enable_zlib=no;;
129 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
130 if test "x$enable_zlib" = "xno" ; then
134 AC_ETHEREAL_ZLIB_CHECK
135 if test "x$enable_zlib" = "xno" ; then
136 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
143 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],,enable_ipv6=yes)
145 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
146 if test "x$enable_ipv6" = "xno" ; then
150 AC_ETHEREAL_IPV6_STACK
154 dnl Checks for header files.
156 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h dirent.h)
157 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h sys/socket.h)
158 AC_CHECK_HEADERS(sys/wait.h sys/param.h)
159 AC_CHECK_HEADERS(netinet/in.h net/if.h)
160 AC_CHECK_HEADERS(stddef.h)
161 AC_CHECK_HEADERS(dlfcn.h)
162 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
166 [ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
169 AC_MSG_CHECKING(whether to use SNMP library if available)
170 if test "x$enable_snmp" = "xno" ; then
174 AC_ETHEREAL_UCDSNMP_CHECK
175 AC_CHECK_HEADERS(ucd-snmp/snmp.h ucd-snmp/version.h snmp/snmp.h snmp/version.h)
176 AC_CHECK_LIB(snmp, sprint_objid,
183 dnl Checks for typedefs, structures, and compiler characteristics.
186 # We need to know whether "struct sockaddr" has an "sa_len" member
187 # for get_interface_list().
189 AC_ETHEREAL_STRUCT_SA_LEN
191 # We must know our byte order
194 dnl Checks for library functions.
195 AC_PROG_GCC_TRADITIONAL
196 AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
198 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
199 # then this won't work.
202 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
203 SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
204 if test "$ac_cv_func_snprintf" = no ; then
205 SNPRINTF_C="snprintf.c"
206 SNPRINTF_O="snprintf.o"
211 AC_CHECK_FUNC(strerror, STRERROR_O="",
212 STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
213 if test "$ac_cv_func_strerror" = no ; then
214 STRERROR_C="strerror.c"
215 STRERROR_O="strerror.o"
220 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
221 STRNCASECMP_O="strncasecmp.o")
222 if test "$ac_cv_func_strncasecmp" = no ; then
223 STRNCASECMP_C="strncasecmp.c"
224 STRNCASECMP_O="strncasecmp.o"
226 AC_SUBST(STRNCASECMP_C)
227 AC_SUBST(STRNCASECMP_O)
229 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
230 MKSTEMP_O="mkstemp.o")
231 if test "$ac_cv_func_mkstemp" = no ; then
232 MKSTEMP_C="mkstemp.c"
233 MKSTEMP_O="mkstemp.o"
234 AC_DEFINE(NEED_MKSTEMP)
239 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
240 INET_ATON_O="inet_aton.o")
241 if test "$ac_cv_func_inet_aton" = no ; then
242 INET_ATON_C="inet_aton.c"
243 INET_ATON_O="inet_aton.o"
245 AC_SUBST(INET_ATON_C)
246 AC_SUBST(INET_ATON_O)
248 AC_CHECK_FUNC(inet_pton, [
249 dnl check for pre-BIND82 inet_pton() bug.
250 AC_MSG_CHECKING(for broken inet_pton)
251 AC_TRY_RUN([#include <sys/types.h>
252 #include <sys/socket.h>
253 #include <netinet/in.h>
254 #include <arpa/inet.h>
259 /* this should return 0 (error) */
260 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
264 }], [AC_MSG_RESULT(ok);
265 have_inet_pton=yes], [AC_MSG_RESULT(broken);
266 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
267 have_inet_pton=no])],
269 if test "$have_inet_pton" = no; then
270 INET_PTON_C="inet_pton.c"
271 INET_PTON_O="inet_pton.o"
276 AC_SUBST(INET_PTON_C)
277 AC_SUBST(INET_PTON_O)
279 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
280 INET_NTOP_O="inet_ntop.o")
281 if test "$ac_cv_func_inet_ntop" = no ; then
282 INET_NTOP_C="inet_ntop.c"
283 INET_NTOP_O="inet_ntop.o"
284 AC_DEFINE(NEED_INET_V6DEFS_H)
286 AC_SUBST(INET_NTOP_C)
287 AC_SUBST(INET_NTOP_O)
289 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
291 dnl blank for now, but will be used in future
292 AC_SUBST(ethereal_SUBDIRS)
294 dnl check for plugins directory - stolen from Amanda's configure.in
295 AC_ARG_WITH(plugindir,
296 [ --with-plugindir=DIR install plugins in DIR],
299 "" | y | ye | yes | n | no)
300 AC_MSG_ERROR([*** You must supply an argument to the --with-plugindir option.])
302 *) PLUGIN_DIR="$withval"
305 : ${PLUGIN_DIR=$libdir/ethereal/plugins/0.8}
309 test "x$prefix" = xNONE && prefix=$ac_default_prefix
310 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
311 eval echo "$PLUGIN_DIR"
313 AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
317 AC_LIBLTDL_CONVENIENCE(libltdl)
321 AC_SUBST(LIBTOOL_DEPS)
323 AM_CONFIG_HEADER(config.h)
324 AC_CONFIG_SUBDIRS(wiretap libltdl)
332 plugins/gryphon/Makefile,
333 [chmod +x doc/dfilter2pod])