Moved to version 0.7.6 and updated NEWS file. We have done _a lot_ in
[obnox/wireshark/wip.git] / configure.in
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.
3 AC_INIT(etypes.h)
4
5 AM_INIT_AUTOMAKE(ethereal, 0.7.6)
6
7 dnl Check for CPU / vendor / OS
8 AC_CANONICAL_HOST
9
10 dnl Checks for programs.
11 AC_PROG_CC
12 AC_PROG_CPP
13 AC_PROG_RANLIB
14 AC_PROG_YACC
15 AM_PROG_LEX
16 AC_PATH_PROG(PERL_PATH, perl)
17 AC_PATH_PROG(LEX, flex)
18
19 AC_SUBST(PERL_PATH)
20 AC_SUBST(FLEX_PATH)
21
22
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"
27   AC_MSG_RESULT(yes)
28 else
29   AC_MSG_RESULT(no)
30 fi
31
32 CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
33
34 # Create DATAFILE_DIR #define for config.h
35 DATAFILE_DIR=$sysconfdir
36 DATAFILE_DIR=`(
37     test "x$prefix" = xNONE && prefix=$ac_default_prefix
38     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
39     eval echo "$DATAFILE_DIR"
40 )`
41 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR")
42 AC_SUBST(DATAFILE_DIR)
43
44 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
45 # link directory.
46 case "$host_os" in
47   solaris*)
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)
52     else
53       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
54     fi
55   ;;
56 esac
57
58 # GTK checks
59 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS",
60                    AC_MSG_ERROR(GTK+ distribution not found.))
61
62 dnl pcap check
63 AC_ARG_ENABLE(pcap,
64 [  --enable-pcap           use libpcap for packet capturing.  [default=yes]],,enable_pcap=yes)
65
66 AC_MSG_CHECKING(whether to use libpcap for packet capture)
67 if test "x$enable_pcap" = "xno" ; then
68         AC_MSG_RESULT(no)
69 else
70         AC_MSG_RESULT(yes)
71         AC_ETHEREAL_PCAP_CHECK
72 fi
73
74 dnl zlib check
75 AC_ARG_ENABLE(zlib,
76 [  --enable-zlib           use zlib to read compressed data.  [default=yes]],, [dnl
77 case "$host_os" in
78 netbsd*)        enable_zlib=no;;
79 *)              enable_zlib=yes;;
80 esac])
81
82 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
83 if test "x$enable_zlib" = "xno" ; then
84         AC_MSG_RESULT(no)
85 else
86         AC_MSG_RESULT(yes)
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)
90         fi
91 fi
92
93
94 dnl ipv6 check
95 AC_ARG_ENABLE(ipv6,
96 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],,enable_ipv6=yes)
97
98 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
99 if test "x$enable_ipv6" = "xno" ; then
100         AC_MSG_RESULT(no)
101 else
102         AC_MSG_RESULT(yes)
103         AC_ETHEREAL_IPV6_STACK
104 fi
105
106
107 dnl Checks for header files.
108 AC_HEADER_STDC
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
113 dnl SNMP Check
114 AC_ARG_ENABLE(snmp,
115 [  --enable-snmp           use SNMP library, if available.  [default=yes]],,enable_snmp=yes)
116
117 SNMP_A=''
118 SNMP_C=''
119 SNMP_O=''
120 AC_MSG_CHECKING(whether to use SNMP library if available)
121 if test "x$enable_snmp" = "xno" ; then
122         AC_MSG_RESULT(no)
123 else
124         AC_MSG_RESULT(yes)
125         AC_ETHEREAL_UCDSNMP_CHECK
126         AC_CHECK_HEADERS(ucd-snmp/snmp.h snmp/snmp.h)
127         AC_CHECK_LIB(snmp, asn_parse_header,
128                 [
129                 SNMP_A=-lsnmp
130                 SNMP_C=packet-snmp.c
131                 SNMP_O=packet-snmp.o
132                 ], )
133 fi
134 AC_SUBST(SNMP_A)
135 AC_SUBST(SNMP_C)
136 AC_SUBST(SNMP_O)
137
138 dnl Checks for typedefs, structures, and compiler characteristics.
139 # AC_C_CONST
140
141 # We need to know whether "struct sockaddr" has an "sa_len" member
142 # for get_interface_list().
143
144 AC_ETHEREAL_STRUCT_SA_LEN
145
146 # We must know our byte order
147 AC_C_BIGENDIAN
148
149 dnl Checks for library functions.
150 AC_PROG_GCC_TRADITIONAL
151 AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
152
153 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
154 # then this won't work.
155 SNPRINTF_C=""
156 SNPRINTF_O=""
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"
162 fi
163 AC_SUBST(SNPRINTF_C)
164 AC_SUBST(SNPRINTF_O)
165
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"
171 fi
172 AC_SUBST(STRERROR_C)
173 AC_SUBST(STRERROR_O)
174
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"
180 fi
181 AC_SUBST(STRNCASECMP_C)
182 AC_SUBST(STRNCASECMP_O)
183
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"
189 fi
190 AC_SUBST(MKSTEMP_C)
191 AC_SUBST(MKSTEMP_O)
192
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"
198 fi
199 AC_SUBST(INET_ATON_C)
200 AC_SUBST(INET_ATON_O)
201
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>
209 int main()
210 {
211 #ifdef AF_INET6
212   char buf[16];
213   /* this should return 0 (error) */
214   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
215 #else
216   return 1;
217 #endif
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])],
222 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"
226 else
227   INET_PTON_C=""
228   INET_PTON_O=""
229 fi
230 AC_SUBST(INET_PTON_C)
231 AC_SUBST(INET_PTON_O)
232
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)
239 fi
240 AC_SUBST(INET_NTOP_C)
241 AC_SUBST(INET_NTOP_O)
242
243 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
244
245 dnl blank for now, but will be used in future
246 AC_SUBST(ethereal_SUBDIRS)
247
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])