1 # $Id: configure.in,v 1.56 1999/10/27 05:34:39 guy Exp $
2 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(ethereal, 0.7.7)
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)
112 AC_CHECK_HEADERS(stddef.h)
116 [ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
121 AC_MSG_CHECKING(whether to use SNMP library if available)
122 if test "x$enable_snmp" = "xno" ; then
126 AC_ETHEREAL_UCDSNMP_CHECK
127 AC_CHECK_HEADERS(ucd-snmp/snmp.h snmp/snmp.h)
128 AC_CHECK_LIB(snmp, asn_parse_header,
139 dnl Checks for typedefs, structures, and compiler characteristics.
142 # We need to know whether "struct sockaddr" has an "sa_len" member
143 # for get_interface_list().
145 AC_ETHEREAL_STRUCT_SA_LEN
147 # We must know our byte order
150 dnl Checks for library functions.
151 AC_PROG_GCC_TRADITIONAL
152 AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
154 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
155 # then this won't work.
158 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
159 SNPRINTF_O="snprintf.o" [AC_DEFINE(NEED_SNPRINTF_H)])
160 if test "$ac_cv_func_snprintf" = no ; then
161 SNPRINTF_C="snprintf.c"
162 SNPRINTF_O="snprintf.o"
167 AC_CHECK_FUNC(strerror, STRERROR_O="",
168 STRERROR_O="strerror.o" [AC_DEFINE(NEED_STRERROR_H)])
169 if test "$ac_cv_func_strerror" = no ; then
170 STRERROR_C="strerror.c"
171 STRERROR_O="strerror.o"
176 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
177 STRNCASECMP_O="strncasecmp.o")
178 if test "$ac_cv_func_strncasecmp" = no ; then
179 STRNCASECMP_C="strncasecmp.c"
180 STRNCASECMP_O="strncasecmp.o"
182 AC_SUBST(STRNCASECMP_C)
183 AC_SUBST(STRNCASECMP_O)
185 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
186 MKSTEMP_O="mkstemp.o")
187 if test "$ac_cv_func_mkstemp" = no ; then
188 MKSTEMP_C="mkstemp.c"
189 MKSTEMP_O="mkstemp.o"
194 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
195 INET_ATON_O="inet_aton.o")
196 if test "$ac_cv_func_inet_aton" = no ; then
197 INET_ATON_C="inet_aton.c"
198 INET_ATON_O="inet_aton.o"
200 AC_SUBST(INET_ATON_C)
201 AC_SUBST(INET_ATON_O)
203 AC_CHECK_FUNC(inet_pton, [
204 dnl check for pre-BIND82 inet_pton() bug.
205 AC_MSG_CHECKING(for broken inet_pton)
206 AC_TRY_RUN([#include <sys/types.h>
207 #include <sys/socket.h>
208 #include <netinet/in.h>
209 #include <arpa/inet.h>
214 /* this should return 0 (error) */
215 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
219 }], [AC_MSG_RESULT(ok);
220 have_inet_pton=yes], [AC_MSG_RESULT(broken);
221 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
222 have_inet_pton=no])],
224 if test "$have_inet_pton" = no; then
225 INET_PTON_C="inet_pton.c"
226 INET_PTON_O="inet_pton.o"
231 AC_SUBST(INET_PTON_C)
232 AC_SUBST(INET_PTON_O)
234 AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
235 INET_NTOP_O="inet_ntop.o")
236 if test "$ac_cv_func_inet_ntop" = no ; then
237 INET_NTOP_C="inet_ntop.c"
238 INET_NTOP_O="inet_ntop.o"
239 AC_DEFINE(NEED_INET_V6DEFS_H)
241 AC_SUBST(INET_NTOP_C)
242 AC_SUBST(INET_NTOP_O)
244 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
246 dnl blank for now, but will be used in future
247 AC_SUBST(ethereal_SUBDIRS)
249 AM_CONFIG_HEADER(config.h)
250 AC_CONFIG_SUBDIRS(wiretap)
251 AC_OUTPUT(Makefile ethereal.spec doc/Makefile doc/dfilter2pod gtk/Makefile,
252 [chmod +x doc/dfilter2pod])