source: configure.in @ 1e66c64

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 1e66c64 was 1e66c64, checked in by Daniel Lawson <dlawson@…>, 16 years ago

2.0.22

  • Property mode set to 100644
File size: 8.6 KB
Line 
1# Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.22,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE
5
6AC_CONFIG_FILES([Makefile lib/Makefile])
7dnl GNU C library
8dnl AC_GNU_SOURCE
9
10AM_CONFIG_HEADER(config.h)
11#AC_CONFIG_HEADERS([config.h])
12dnl Checks for programs.
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_LIBTOOL
16
17
18
19# Checks for header files.
20AC_HEADER_STDC
21dnl AC_CHECK_HEADERS(errno.h stdlib.h stdio.h assert.h string.h netinet/in.h assert.h errno.h fcntl.h net/ethernet.h netdb.h pcap.h stdio.h stdlib.h string.h sys/stat.h sys/types.h sys/socket.h sys/un.h unistd.h time.h sys/ioctl.h net/bpf.h pcap.h zlib.h pcap-bpf.h)
22AC_CHECK_HEADERS(pcap.h pcap-int.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h inttypes.h limits.h dagapi.h net/ethernet.h )
23
24AC_CHECK_HEADERS(netinet/in.h)
25
26AC_CHECK_HEADER(net/if.h,
27                AC_DEFINE(HAVE_NET_IF_H,1,[We have net/if.h]), [],
28[#include <sys/types.h>
29 #include <sys/socket.h>
30])
31
32
33AC_CHECK_HEADER(netinet/if_ether.h,
34                AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[We have netinet/if_ether.h]), [],
35[
36 #include <sys/types.h>
37 #include <sys/socket.h>
38 #include <netinet/in.h>
39 #include <net/if.h>
40])
41
42AC_CHECK_HEADER(net/if_arp.h,
43                AC_DEFINE(HAVE_NET_IF_ARP_H,1,[We have net/if_arp.h]), [],
44[
45 #include <sys/types.h>
46 #include <sys/socket.h>
47 #include <netinet/in.h>
48 #include <net/if.h>
49])
50
51       
52# Checking for the right bpf header to include
53AC_MSG_CHECKING([where the bpf headers are kept])
54echo ""
55bpfh=no
56AC_CHECK_HEADER(pcap-bpf.h,
57        [AC_DEFINE([HAVE_PCAP_BPF_H]) bpfh=pcap-bpf.h])
58if test $bpfh = no; then
59AC_CHECK_HEADER(net/bpf.h,
60        [AC_DEFINE([HAVE_NET_BPF_H]) bpfh=net/bpf.h])
61fi
62
63if test $bpfh = no; then
64  AC_MSG_RESULT([No BPF headers, compiling without support for BPF filters])
65  AC_DEFINE(HAVE_BPF,0,[Conditional for building bpf support])
66else
67  AC_MSG_RESULT([Using $bpfh])
68  AC_DEFINE(HAVE_BPF,1,[Conditional for building bpf support])
69fi
70
71
72# Check for various broken functions
73AC_FUNC_MALLOC
74AC_FUNC_REALLOC
75
76# *BSD doesn't have strndup. Currently provide our own.
77AC_REPLACE_FUNCS(strndup)
78
79# Check to see if we have libpcap
80AC_CHECK_LIB(pcap,pcap_open_live,
81             have_pcap_open_live=true,
82             have_pcap_open_live=false)
83
84if test "$have_pcap_open_live" = true; then
85    AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support])
86    ADD_LIBS="$ADD_LIBS  -lpcap"
87else
88    AC_DEFINE(HAVE_PCAP,0,[Conditional for building PCAP support])
89fi     
90
91# Earlier versions of pcap don't have pcap_open_dead. EG: the one OpenBSD
92# ships with. Even Debian Woody is more up to date.
93AC_CHECK_LIB(pcap,pcap_open_dead,
94        have_pcap_open_dead=true,
95        have_pcap_open_dead=false)
96
97if test "$have_pcap_open_dead" = false; then
98        AC_REPLACE_FUNCS(pcap_open_dead)
99fi
100   
101
102# Checks for typedefs, structures, and compiler characteristics.
103AC_C_CONST
104AC_C_INLINE
105AC_C_BIGENDIAN
106AC_TYPE_SIZE_T
107AC_HEADER_TIME
108AC_SYS_LARGEFILE
109
110# Checks for library functions.
111AC_PROG_GCC_TRADITIONAL
112AC_CHECK_FUNCS(socket strdup)
113
114# configure time options for man pages
115AC_ARG_WITH(man,
116            AC_HELP_STRING([--with-man],
117                           [install man pages by default]),
118
119             if test "$withval" = yes
120             then
121                     MANPAGES="docs/man/man3/[a-zA-Z]*.3]"
122             else
123                     MANPAGES=""
124             fi
125)
126
127# configure time options for use of DAG cards
128# borrowed from libpcap!
129AC_ARG_WITH(dag,
130            AC_HELP_STRING([--with-dag[=DIR]],
131                           [include DAG support (located in directory DIR, if supplied)]),
132[
133        if test "$withval" = no
134        then
135                want_dag=no
136        elif test "$withval" = yes
137        then
138                want_dag=yes
139                dag_root=
140        else
141                want_dag=yes
142                dag_root=$withval
143        fi
144],[
145        #
146        # Use DAG API if present, otherwise don't
147        #
148        want_dag=ifpresent
149        dag_root=
150])
151
152ac_cv_lbl_dag_api=no
153if test "$with_dag" != no; then
154        AC_MSG_CHECKING(whether we have DAG API)
155
156        if test -z "$dag_root"; then
157                dag_root=$srcdir/../dag
158        fi
159
160        if test -r "$dag_root/lib"; then
161                dag_lib_dir="$dag_root/lib"
162        else
163                dag_lib_dir="$dag_root"
164        fi
165
166        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
167                dag_tools_dir="$dag_root/tools"
168                dag_include_dir="$dag_root/include"
169        else
170                dag_tools_dir="$dag_root"
171                dag_include_dir="$dag_root"
172        fi
173
174        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
175        then
176                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
177                ADD_LIBS="$ADD_LIBS -ldag"
178                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
179                DAG_TOOLS_DIR=$dag_tools_dir
180                AC_SUBST([DAG_TOOLS_DIR])
181                ac_cv_lbl_dag_api=yes
182        else
183                ac_cv_lbl_dag_api=no
184        fi
185        AC_MSG_RESULT($ac_cv_lbl_dag_api)
186        if test $ac_cv_lbl_dag_api = no; then
187                if test "$want_dag" = yes; then
188                        AC_MSG_ERROR(DAG API not found under directory $dag_root
189; use --without-dag)
190                fi
191        else
192                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
193                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
194        fi
195else
196        AC_DEFINE(HAVE_DAG,0,[conditional for building with DAG support])
197fi
198
199AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
200
201# The following is commented out because it seems you don't actually
202# need it. libpcap 'just works' with large files, even under woody,
203# although you probably need _FILE_OFFSET_BITS and LARGEFILE etc set
204# properly - libtrace handles this however.
205## configure time options for selecting which libpcap and libz to use
206## this is provided to allow for systems whose default libraries don't support
207## large files - you can build your own and link using these options
208#AC_ARG_WITH([pcap],
209#    AC_HELP_STRING([--with-pcap],
210#                                  [name of pcap library (default is pcap)]),
211#       [ac_cv_use_pcap=$withval],
212#    [ac_cv_use_pcap=pcap])
213#
214#
215#AC_ARG_WITH([pcap-path],
216#    AC_HELP_STRING([--with-pcap-path],
217#                                  [location of pcap library (default is /usr/lib)]),
218#       [ac_cv_use_pcap_path=$withval],
219#    [ac_cv_use_pcap_path=/usr/lib])
220#
221#if test x"$ac_cv_use_pcap" != xno; then
222#    ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
223#   
224#    pcap_lib_file="${ac_cv_use_pcap_path}/lib${ac_cv_use_pcap}.so"
225#   
226#    # if the library is in /usr/lib, then just use
227#    # AC_CHECK_LIB.
228#    if test x"${ac_cv_use_pcap_path}" == x"/usr/lib"; then
229#           AC_CHECK_LIB(${ac_cv_use_pcap},pcap_open_live,
230#                        have_libpcap=yes,
231#                        have_libpcap=no)
232#
233#           if test x"${have_libpcap}" == xno; then
234#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
235#               AC_MSG_ERROR([Exiting]);
236#           fi
237#    else
238#       ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
239#       # if it's not in /usr/lib/, check manually. This isn't nice,
240#       # and will probably break.
241#       if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then
242#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
243#               AC_MSG_ERROR([Exiting]);
244#       fi 
245#    fi
246#    AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support])
247#else
248#    AC_DEFINE(HAVE_PCAP,0,[Conditional for building PCAP support])
249#fi
250
251
252AC_ARG_WITH([zlib],
253    AC_HELP_STRING([--with-zlib],
254                               [name of zlib library (default is z)]),
255        [ac_cv_use_zlib=$withval],
256    [ac_cv_use_zlib=z])
257
258AC_ARG_WITH([zlib-path],
259    AC_HELP_STRING([--with-zlib-path],
260                   [location of zlib library (default is /usr/lib)]),
261    [ac_cv_use_zlib_path=$withval],
262    [ac_cv_use_zlib_path=/usr/lib])
263
264if test "$ac_cv_use_zlib" != no; then
265    ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
266   
267    zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
268
269    # if the library is in /usr/lib/, then just use AC_CHECK_LIB
270    if test x"${ac_cv_use_zlib_path}" == x"/usr/lib"; then
271            AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen,
272                         have_libzlib=yes,
273                         have_libzlib=no)
274            if test x"{have_libzlib}" == xno; then
275                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
276                AC_MSG_ERROR([Exiting]);
277            fi
278    else
279        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
280        # if it's not in /usr/lib/, check manually. This isn't nice
281        # and will probably break.
282        if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then
283                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
284                AC_MSG_ERROR([Exiting]);
285        fi
286    fi
287    AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
288else
289    AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support])   
290fi
291
292
293
294AC_SUBST([ADD_LIBS])
295AC_SUBST([ADD_LDFLAGS])
296AC_SUBST([ADD_INCLS])
297AC_SUBST([LTLIBOBJS])
298AC_SUBST([MANPAGES])
299
300dnl and finally, output our Makefiles
301AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.