1 # $Id: configure.in,v 1.65 1999/12/11 05:30:31 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.7.9)
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 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS",
92 AC_MSG_ERROR(GTK+ distribution not found.))
96 [ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
98 AC_MSG_CHECKING(whether to use libpcap for packet capture)
99 if test "x$enable_pcap" = "xno" ; then
103 AC_ETHEREAL_PCAP_CHECK
108 [ --enable-zlib use zlib to read compressed data. [default=yes]],, [dnl
110 netbsd*) enable_zlib=no;;
114 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
115 if test "x$enable_zlib" = "xno" ; then
119 AC_ETHEREAL_ZLIB_CHECK
120 if test "x$enable_zlib" = "xno" ; then
121 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
128 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],,enable_ipv6=yes)
130 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
131 if test "x$enable_ipv6" = "xno" ; then
135 AC_ETHEREAL_IPV6_STACK
139 dnl Checks for header files.
141 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h)
142 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h netinet/in.h sys/socket.h net/if.h)
143 AC_CHECK_HEADERS(sys/wait.h)
144 AC_CHECK_HEADERS(stddef.h)
145 AC_CHECK_HEADERS(dlfcn.h)
149 [ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
152 AC_MSG_CHECKING(whether to use SNMP library if available)
153 if test "x$enable_snmp" = "xno" ; then
157 AC_ETHEREAL_UCDSNMP_CHECK
158 AC_CHECK_HEADERS(ucd-snmp/snmp.h ucd-snmp/version.h snmp/snmp.h snmp/version.h)
159 AC_CHECK_LIB(snmp, sprint_objid,
166 dnl Checks for typedefs, structures, and compiler characteristics.
169 # We need to know whether "struct sockaddr" has an "sa_len" member
170 # for get_interface_list().
172 AC_ETHEREAL_STRUCT_SA_LEN
174 # We must know our byte order
177 dnl Checks for library functions.
178 AC_PROG_GCC_TRADITIONAL
179 AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
181 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
182 # then this won't work.
185 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
186 SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
187 if test "$ac_cv_func_snprintf" = no ; then
188 SNPRINTF_C="snprintf.c"
189 SNPRINTF_O="snprintf.o"
194 AC_CHECK_FUNC(strerror, STRERROR_O="",
195 STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
196 if test "$ac_cv_func_strerror" = no ; then
197 STRERROR_C="strerror.c"
198 STRERROR_O="strerror.o"
203 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
204 STRNCASECMP_O="strncasecmp.o")
205 if test "$ac_cv_func_strncasecmp" = no ; then
206 STRNCASECMP_C="strncasecmp.c"
207 STRNCASECMP_O="strncasecmp.o"
209 AC_SUBST(STRNCASECMP_C)
210 AC_SUBST(STRNCASECMP_O)
212 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
213 MKSTEMP_O="mkstemp.o")
214 if test "$ac_cv_func_mkstemp" = no ; then
215 MKSTEMP_C="mkstemp.c"
216 MKSTEMP_O="mkstemp.o"
221 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
222 INET_ATON_O="inet_aton.o")
223 if test "$ac_cv_func_inet_aton" = no ; then
224 INET_ATON_C="inet_aton.c"
225 INET_ATON_O="inet_aton.o"
227 AC_SUBST(INET_ATON_C)
228 AC_SUBST(INET_ATON_O)
230 AC_CHECK_FUNC(inet_pton, [
231 dnl check for pre-BIND82 inet_pton() bug.
232 AC_MSG_CHECKING(for broken inet_pton)
233 AC_TRY_RUN([#include <sys/types.h>
234 #include <sys/socket.h>
235 #include <netinet/in.h>
236 #include <arpa/inet.h>
241 /* this should return 0 (error) */
242 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
246 }], [AC_MSG_RESULT(ok);
247 have_inet_pton=yes], [AC_MSG_RESULT(broken);
248 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
249 have_inet_pton=no])],
251 if test "$have_inet_pton" = no; then
252 INET_PTON_C="inet_pton.c"
253 INET_PTON_O="inet_pton.o"
258 AC_SUBST(INET_PTON_C)
259 AC_SUBST(INET_PTON_O)
261 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
262 INET_NTOP_O="inet_ntop.o")
263 if test "$ac_cv_func_inet_ntop" = no ; then
264 INET_NTOP_C="inet_ntop.c"
265 INET_NTOP_O="inet_ntop.o"
266 AC_DEFINE(NEED_INET_V6DEFS_H)
268 AC_SUBST(INET_NTOP_C)
269 AC_SUBST(INET_NTOP_O)
271 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
273 dnl blank for now, but will be used in future
274 AC_SUBST(ethereal_SUBDIRS)
276 AM_CONFIG_HEADER(config.h)
277 AC_CONFIG_SUBDIRS(wiretap)
278 AC_OUTPUT(Makefile ethereal.spec doc/Makefile doc/dfilter2pod gtk/Makefile,
279 [chmod +x doc/dfilter2pod])