1 # $Id: configure.in,v 1.78 2000/01/16 00:13:24 guy 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".
55 AC_ETHEREAL_ADD_DASH_L(LIBS, /usr/local/lib)
57 # Create DATAFILE_DIR #define for config.h
58 DATAFILE_DIR=$sysconfdir
60 test "x$prefix" = xNONE && prefix=$ac_default_prefix
61 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
62 eval echo "$DATAFILE_DIR"
64 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
65 AC_SUBST(DATAFILE_DIR)
67 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
71 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
72 if test x$LD_LIBRARY_PATH != x ; then
73 LIBS="$LIBS -R$LD_LIBRARY_PATH"
74 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
76 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
82 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
83 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
84 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
85 # set when generating the Makefile, so we can make programs that require
86 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
87 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
88 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
89 # programs to be built with GLib.
91 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
94 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
95 # programs to be built with GTK+.
97 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS",
98 AC_MSG_ERROR(GTK+ distribution not found.))
100 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
101 dnl "gethostbyname()".
102 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
104 dnl Checks for "connect()", used as a proxy for "socket()" - and
105 dnl "-lsocket", if we need it to get "connect()".
106 AC_ETHEREAL_SOCKET_LIB_CHECK
110 [ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
112 AC_MSG_CHECKING(whether to use libpcap for packet capture)
113 if test "x$enable_pcap" = "xno" ; then
117 AC_ETHEREAL_PCAP_CHECK
122 [ --enable-zlib use zlib to read compressed data. [default=yes]],,enable_zlib=yes)
124 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
125 if test "x$enable_zlib" = "xno" ; then
129 AC_ETHEREAL_ZLIB_CHECK
130 if test "x$enable_zlib" = "xno" ; then
131 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
138 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],,enable_ipv6=yes)
140 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
141 if test "x$enable_ipv6" = "xno" ; then
145 AC_ETHEREAL_IPV6_STACK
149 dnl Checks for header files.
151 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h dirent.h)
152 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h sys/socket.h)
153 AC_CHECK_HEADERS(sys/wait.h sys/param.h)
154 AC_CHECK_HEADERS(netinet/in.h net/if.h)
155 AC_CHECK_HEADERS(stddef.h)
156 AC_CHECK_HEADERS(dlfcn.h)
157 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
161 [ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
164 AC_MSG_CHECKING(whether to use SNMP library if available)
165 if test "x$enable_snmp" = "xno" ; then
169 AC_ETHEREAL_UCDSNMP_CHECK
170 AC_CHECK_HEADERS(ucd-snmp/snmp.h ucd-snmp/version.h snmp/snmp.h snmp/version.h)
173 # This may require "-lkstat" on Solaris, sigh.
175 AC_CHECK_LIB(snmp, sprint_objid,
179 # Throw away the cached "we didn't find it" answer.
181 unset ac_cv_lib_snmp_sprint_objid
182 AC_CHECK_LIB(snmp, sprint_objid,
185 # Throw away the cached "we found it" answer, so that if
186 # we rerun "configure", we don't just blow off this check
187 # and blithely assume that we don't need "-lkstat".
189 # XXX - autoconf really needs a way to test for a given
190 # routine in a given library *and* to test whether additional
191 # "-L"/"-R"/whatever flags are needed *before* the "-l"
192 # flag for the library and to test whether additional libraries
193 # are needed after the library *and* to cache all that
196 unset ac_cv_lib_snmp_sprint_objid
197 SNMP_LIBS="-lsnmp -lkstat"
198 ],,$SOCKET_LIBS $NSL_LIBS -lkstat
200 ], $SOCKET_LIBS $NSL_LIBS
206 dnl Checks for typedefs, structures, and compiler characteristics.
209 # We need to know whether "struct sockaddr" has an "sa_len" member
210 # for get_interface_list().
212 AC_ETHEREAL_STRUCT_SA_LEN
214 # We must know our byte order
217 # Checks whether "-traditional" is needed when using "ioctl".
218 # XXX - do we need this?
219 AC_PROG_GCC_TRADITIONAL
221 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
222 # then this won't work.
225 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
226 SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
227 if test "$ac_cv_func_snprintf" = no ; then
228 SNPRINTF_C="snprintf.c"
229 SNPRINTF_O="snprintf.o"
234 AC_CHECK_FUNC(strerror, STRERROR_O="",
235 STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
236 if test "$ac_cv_func_strerror" = no ; then
237 STRERROR_C="strerror.c"
238 STRERROR_O="strerror.o"
243 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
244 STRNCASECMP_O="strncasecmp.o")
245 if test "$ac_cv_func_strncasecmp" = no ; then
246 STRNCASECMP_C="strncasecmp.c"
247 STRNCASECMP_O="strncasecmp.o"
249 AC_SUBST(STRNCASECMP_C)
250 AC_SUBST(STRNCASECMP_O)
252 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
253 MKSTEMP_O="mkstemp.o")
254 if test "$ac_cv_func_mkstemp" = no ; then
255 MKSTEMP_C="mkstemp.c"
256 MKSTEMP_O="mkstemp.o"
257 AC_DEFINE(NEED_MKSTEMP)
262 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
263 INET_ATON_O="inet_aton.o")
264 if test "$ac_cv_func_inet_aton" = no ; then
265 INET_ATON_C="inet_aton.c"
266 INET_ATON_O="inet_aton.o"
268 AC_SUBST(INET_ATON_C)
269 AC_SUBST(INET_ATON_O)
271 AC_CHECK_FUNC(inet_pton, [
272 dnl check for pre-BIND82 inet_pton() bug.
273 AC_MSG_CHECKING(for broken inet_pton)
274 AC_TRY_RUN([#include <sys/types.h>
275 #include <sys/socket.h>
276 #include <netinet/in.h>
277 #include <arpa/inet.h>
282 /* this should return 0 (error) */
283 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
287 }], [AC_MSG_RESULT(ok);
288 have_inet_pton=yes], [AC_MSG_RESULT(broken);
289 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
290 have_inet_pton=no])],
292 if test "$have_inet_pton" = no; then
293 INET_PTON_C="inet_pton.c"
294 INET_PTON_O="inet_pton.o"
299 AC_SUBST(INET_PTON_C)
300 AC_SUBST(INET_PTON_O)
302 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
303 INET_NTOP_O="inet_ntop.o")
304 if test "$ac_cv_func_inet_ntop" = no ; then
305 INET_NTOP_C="inet_ntop.c"
306 INET_NTOP_O="inet_ntop.o"
307 AC_DEFINE(NEED_INET_V6DEFS_H)
309 AC_SUBST(INET_NTOP_C)
310 AC_SUBST(INET_NTOP_O)
312 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
314 dnl blank for now, but will be used in future
315 AC_SUBST(ethereal_SUBDIRS)
317 dnl check for plugins directory - stolen from Amanda's configure.in
318 AC_ARG_WITH(plugindir,
319 [ --with-plugindir=DIR install plugins in DIR],
322 "" | y | ye | yes | n | no)
323 AC_MSG_ERROR([*** You must supply an argument to the --with-plugindir option.])
325 *) PLUGIN_DIR="$withval"
328 : ${PLUGIN_DIR=$libdir/ethereal/plugins/0.8}
332 test "x$prefix" = xNONE && prefix=$ac_default_prefix
333 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
334 eval echo "$PLUGIN_DIR"
336 AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
342 AC_SUBST(LIBTOOL_DEPS)
344 AM_CONFIG_HEADER(config.h)
345 AC_CONFIG_SUBDIRS(wiretap)
353 plugins/gryphon/Makefile,
354 [chmod +x doc/dfilter2pod])