source: configure.in @ 043d632

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

fixes to makefile for documentation

  • Property mode set to 100644
File size: 8.0 KB
Line 
1# Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.18[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace,2.0.18)
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# Earlier versions of pcap don't have pcap_open_dead. EG: the one OpenBSD
80# ships with. Even Debian Woody is more up to date.
81AC_CHECK_LIB(pcap,pcap_open_dead,
82        have_pcap_open_dead=true,
83        have_pcap_open_dead=false)
84
85if test "$have_pcap_open_dead" = false; then
86        AC_REPLACE_FUNCS(pcap_open_dead)
87fi
88   
89
90# Checks for typedefs, structures, and compiler characteristics.
91AC_C_CONST
92AC_C_INLINE
93AC_C_BIGENDIAN
94AC_TYPE_SIZE_T
95AC_HEADER_TIME
96AC_SYS_LARGEFILE
97
98# Checks for library functions.
99AC_PROG_GCC_TRADITIONAL
100AC_CHECK_FUNCS(socket strdup)
101
102
103# configure time options for use of DAG cards
104# borrowed from libpcap!
105AC_ARG_WITH(dag,
106            AC_HELP_STRING([--with-dag[=DIR]],
107                           [include DAG support (located in directory DIR, if supplied)]),
108[
109        if test "$withval" = no
110        then
111                want_dag=no
112        elif test "$withval" = yes
113        then
114                want_dag=yes
115                dag_root=
116        else
117                want_dag=yes
118                dag_root=$withval
119        fi
120],[
121        #
122        # Use DAG API if present, otherwise don't
123        #
124        want_dag=ifpresent
125        dag_root=
126])
127
128ac_cv_lbl_dag_api=no
129if test "$with_dag" != no; then
130        AC_MSG_CHECKING(whether we have DAG API)
131
132        if test -z "$dag_root"; then
133                dag_root=$srcdir/../dag
134        fi
135
136        if test -r "$dag_root/lib"; then
137                dag_lib_dir="$dag_root/lib"
138        else
139                dag_lib_dir="$dag_root"
140        fi
141
142        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
143                dag_tools_dir="$dag_root/tools"
144                dag_include_dir="$dag_root/include"
145        else
146                dag_tools_dir="$dag_root"
147                dag_include_dir="$dag_root"
148        fi
149
150        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
151        then
152                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
153                ADD_LIBS="$ADD_LIBS -ldag"
154                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
155                DAG_TOOLS_DIR=$dag_tools_dir
156                AC_SUBST([DAG_TOOLS_DIR])
157                ac_cv_lbl_dag_api=yes
158        else
159                ac_cv_lbl_dag_api=no
160        fi
161        AC_MSG_RESULT($ac_cv_lbl_dag_api)
162        if test $ac_cv_lbl_dag_api = no; then
163                if test "$want_dag" = yes; then
164                        AC_MSG_ERROR(DAG API not found under directory $dag_root
165; use --without-dag)
166                fi
167        else
168                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
169                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
170        fi
171else
172        AC_DEFINE(HAVE_DAG,0,[conditional for building with DAG support])
173fi
174
175AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
176
177# The following is commented out because it seems you don't actually
178# need it. libpcap 'just works' with large files, even under woody,
179# although you probably need _FILE_OFFSET_BITS and LARGEFILE etc set
180# properly - libtrace handles this however.
181## configure time options for selecting which libpcap and libz to use
182## this is provided to allow for systems whose default libraries don't support
183## large files - you can build your own and link using these options
184#AC_ARG_WITH([pcap],
185#    AC_HELP_STRING([--with-pcap],
186#                                  [name of pcap library (default is pcap)]),
187#       [ac_cv_use_pcap=$withval],
188#    [ac_cv_use_pcap=pcap])
189#
190#
191#AC_ARG_WITH([pcap-path],
192#    AC_HELP_STRING([--with-pcap-path],
193#                                  [location of pcap library (default is /usr/lib)]),
194#       [ac_cv_use_pcap_path=$withval],
195#    [ac_cv_use_pcap_path=/usr/lib])
196#
197#if test x"$ac_cv_use_pcap" != xno; then
198#    ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
199#   
200#    pcap_lib_file="${ac_cv_use_pcap_path}/lib${ac_cv_use_pcap}.so"
201#   
202#    # if the library is in /usr/lib, then just use
203#    # AC_CHECK_LIB.
204#    if test x"${ac_cv_use_pcap_path}" == x"/usr/lib"; then
205#           AC_CHECK_LIB(${ac_cv_use_pcap},pcap_open_live,
206#                        have_libpcap=yes,
207#                        have_libpcap=no)
208#
209#           if test x"${have_libpcap}" == xno; then
210#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
211#               AC_MSG_ERROR([Exiting]);
212#           fi
213#    else
214#       ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
215#       # if it's not in /usr/lib/, check manually. This isn't nice,
216#       # and will probably break.
217#       if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then
218#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
219#               AC_MSG_ERROR([Exiting]);
220#       fi 
221#    fi
222#    AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support])
223#else
224#    AC_DEFINE(HAVE_PCAP,0,[Conditional for building PCAP support])
225#fi
226
227
228AC_ARG_WITH([zlib],
229    AC_HELP_STRING([--with-zlib],
230                               [name of zlib library (default is z)]),
231        [ac_cv_use_zlib=$withval],
232    [ac_cv_use_zlib=z])
233
234AC_ARG_WITH([zlib-path],
235    AC_HELP_STRING([--with-zlib-path],
236                   [location of zlib library (default is /usr/lib)]),
237    [ac_cv_use_zlib_path=$withval],
238    [ac_cv_use_zlib_path=/usr/lib])
239
240if test "$ac_cv_use_zlib" != no; then
241    ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
242   
243    zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
244
245    # if the library is in /usr/lib/, then just use AC_CHECK_LIB
246    if test x"${ac_cv_use_zlib_path}" == x"/usr/lib"; then
247            AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen,
248                         have_libzlib=yes,
249                         have_libzlib=no)
250            if test x"{have_libzlib}" == xno; then
251                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
252                AC_MSG_ERROR([Exiting]);
253            fi
254    else
255        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
256        # if it's not in /usr/lib/, check manually. This isn't nice
257        # and will probably break.
258        if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then
259                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
260                AC_MSG_ERROR([Exiting]);
261        fi
262    fi
263    AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
264else
265    AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support])   
266fi
267
268
269
270AC_SUBST([ADD_LIBS])
271AC_SUBST([ADD_LDFLAGS])
272AC_SUBST([ADD_INCLS])
273AC_SUBST([LTLIBOBJS])
274
275dnl and finally, output our Makefiles
276AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.