1 # $Id: configure.in,v 1.54 1999/10/20 18:11:52 gram Exp $
2 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(ethereal, 0.7.6)
7 dnl Check for CPU / vendor / OS
10 dnl Checks for programs.
16 AC_PATH_PROG(PERL_PATH, perl)
17 AC_PATH_PROG(LEX, flex)
23 # If we're running gcc, add '-Wall' to CFLAGS.
24 AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
25 if test x$GCC != x ; then
26 CFLAGS="-Wall $CFLAGS"
32 CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
34 # Create DATAFILE_DIR #define for config.h
35 DATAFILE_DIR=$sysconfdir
37 test "x$prefix" = xNONE && prefix=$ac_default_prefix
38 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
39 eval echo "$DATAFILE_DIR"
41 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
42 AC_SUBST(DATAFILE_DIR)
44 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
48 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
49 if test x$LD_LIBRARY_PATH != x ; then
50 LIBS="$LIBS -R$LD_LIBRARY_PATH"
51 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
53 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
59 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS",
60 AC_MSG_ERROR(GTK+ distribution not found.))
64 [ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
66 AC_MSG_CHECKING(whether to use libpcap for packet capture)
67 if test "x$enable_pcap" = "xno" ; then
71 AC_ETHEREAL_PCAP_CHECK
76 [ --enable-zlib use zlib to read compressed data. [default=yes]],, [dnl
78 netbsd*) enable_zlib=no;;
82 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
83 if test "x$enable_zlib" = "xno" ; then
87 AC_ETHEREAL_ZLIB_CHECK
88 if test "x$enable_zlib" = "xno" ; then
89 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
96 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],,enable_ipv6=yes)
98 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
99 if test "x$enable_ipv6" = "xno" ; then
103 AC_ETHEREAL_IPV6_STACK
107 dnl Checks for header files.
109 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h)
110 AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h netinet/in.h sys/socket.h net/if.h)
111 AC_CHECK_HEADERS(sys/wait.h)
115 [ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
120 AC_MSG_CHECKING(whether to use SNMP library if available)
121 if test "x$enable_snmp" = "xno" ; then
125 AC_ETHEREAL_UCDSNMP_CHECK
126 AC_CHECK_HEADERS(ucd-snmp/snmp.h snmp/snmp.h)
127 AC_CHECK_LIB(snmp, asn_parse_header,
138 dnl Checks for typedefs, structures, and compiler characteristics.
141 # We need to know whether "struct sockaddr" has an "sa_len" member
142 # for get_interface_list().
144 AC_ETHEREAL_STRUCT_SA_LEN
146 # We must know our byte order
149 dnl Checks for library functions.
150 AC_PROG_GCC_TRADITIONAL
151 AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
153 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
154 # then this won't work.
157 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
158 SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
159 if test "$ac_cv_func_snprintf" = no ; then
160 SNPRINTF_C="snprintf.c"
161 SNPRINTF_O="snprintf.o"
166 AC_CHECK_FUNC(strerror, STRERROR_O="",
167 STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
168 if test "$ac_cv_func_strerror" = no ; then
169 STRERROR_C="strerror.c"
170 STRERROR_O="strerror.o"
175 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
176 STRNCASECMP_O="strncasecmp.o")
177 if test "$ac_cv_func_strncasecmp" = no ; then
178 STRNCASECMP_C="strncasecmp.c"
179 STRNCASECMP_O="strncasecmp.o"
181 AC_SUBST(STRNCASECMP_C)
182 AC_SUBST(STRNCASECMP_O)
184 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
185 MKSTEMP_O="mkstemp.o")
186 if test "$ac_cv_func_mkstemp" = no ; then
187 MKSTEMP_C="mkstemp.c"
188 MKSTEMP_O="mkstemp.o"
193 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
194 INET_ATON_O="inet_aton.o")
195 if test "$ac_cv_func_inet_aton" = no ; then
196 INET_ATON_C="inet_aton.c"
197 INET_ATON_O="inet_aton.o"
199 AC_SUBST(INET_ATON_C)
200 AC_SUBST(INET_ATON_O)
202 AC_CHECK_FUNC(inet_pton, [
203 dnl check for pre-BIND82 inet_pton() bug.
204 AC_MSG_CHECKING(for broken inet_pton)
205 AC_TRY_RUN([#include <sys/types.h>
206 #include <sys/socket.h>
207 #include <netinet/in.h>
208 #include <arpa/inet.h>
213 /* this should return 0 (error) */
214 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
218 }], [AC_MSG_RESULT(ok);
219 have_inet_pton=yes], [AC_MSG_RESULT(broken);
220 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
221 have_inet_pton=no])],
223 if test "$have_inet_pton" = no; then
224 INET_PTON_C="inet_pton.c"
225 INET_PTON_O="inet_pton.o"
230 AC_SUBST(INET_PTON_C)
231 AC_SUBST(INET_PTON_O)
233 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
234 INET_NTOP_O="inet_ntop.o")
235 if test "$ac_cv_func_inet_ntop" = no ; then
236 INET_NTOP_C="inet_ntop.c"
237 INET_NTOP_O="inet_ntop.o"
238 AC_DEFINE(NEED_INET_V6DEFS_H)
240 AC_SUBST(INET_NTOP_C)
241 AC_SUBST(INET_NTOP_O)
243 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
245 dnl blank for now, but will be used in future
246 AC_SUBST(ethereal_SUBDIRS)
248 AM_CONFIG_HEADER(config.h)
249 AC_CONFIG_SUBDIRS(wiretap)
250 AC_OUTPUT(Makefile ethereal.spec doc/Makefile doc/dfilter2pod gtk/Makefile,
251 [chmod +x doc/dfilter2pod])