source: configure.in @ 41660d5

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 41660d5 was 41660d5, checked in by Shane Alcock <salcock@…>, 15 years ago

Fixed AM_INIT_AUTOMAKE in configure.in to use correct parameters

  • Property mode set to 100644
File size: 9.2 KB
Line 
1# Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.23,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace, 2.0.23)
5
6AC_CONFIG_FILES([Makefile lib/Makefile docs/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 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# Versions of libpcap earlier than 0.8 don't have pcap_dump_flush
102AC_CHECK_LIB(pcap,pcap_dump_flush,
103             have_pcap_dump_flush=true,
104             have_pcap_dump_flush=false)
105
106if test "$have_pcap_dump_flush" = false; then
107        AC_REPLACE_FUNCS(pcap_dump_flush)
108fi
109
110# Checks for typedefs, structures, and compiler characteristics.
111AC_C_CONST
112AC_C_INLINE
113AC_C_BIGENDIAN
114AC_TYPE_SIZE_T
115AC_HEADER_TIME
116AC_SYS_LARGEFILE
117
118# Checks for library functions.
119AC_PROG_GCC_TRADITIONAL
120AC_CHECK_FUNCS(socket strdup)
121
122# configure time options for man pages
123AC_ARG_WITH(man,
124            AC_HELP_STRING([--with-man],
125                           [install man pages by default]),
126
127             if test "$withval" = yes
128             then
129                     MANPAGES="docs/man/man3/[a-zA-Z]*.3]"
130             else
131                     MANPAGES=""
132             fi
133)
134
135# configure time options for use of DAG cards
136# borrowed from libpcap!
137AC_ARG_WITH(dag,
138            AC_HELP_STRING([--with-dag[=DIR]],
139                           [include DAG support (located in directory DIR, if supplied)]),
140[
141        if test "$withval" = no
142        then
143                want_dag=no
144        elif test "$withval" = yes
145        then
146                want_dag=yes
147                dag_root=/root/dag
148        else
149                want_dag=yes
150                dag_root=$withval
151        fi
152],[
153        #
154        # Use DAG API if present, otherwise don't
155        #
156        want_dag=ifpresent
157        dag_root=/root/dag/
158])
159
160# turn the test part of the next block into a function, so it can be
161# called multiple times for $dag_root, /root/dag, /usr/local/lib
162ac_cv_lbl_dag_api=no
163dag2_4=false
164if test "$with_dag" != no; then
165        AC_MSG_CHECKING(whether we have DAG API)
166
167        if test -r "$dag_root/lib"; then
168                dag_lib_dir="$dag_root/lib"
169        else
170                dag_lib_dir="$dag_root"
171        fi
172       
173        AC_MSG_CHECKING(if we are using DAG 2.4)
174        if grep '2.4.' $dag_root/VERSION > /dev/null; then
175                dag2_4=true
176        else
177                dag2_4=false
178        fi
179
180        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
181                dag_tools_dir="$dag_root/tools"
182                dag_include_dir="$dag_root/include"
183        else
184                dag_tools_dir="$dag_root"
185                dag_include_dir="$dag_root"
186        fi
187
188        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
189        then
190                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
191                ADD_LIBS="$ADD_LIBS -ldag"
192                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
193                DAG_TOOLS_DIR=$dag_tools_dir
194                AC_SUBST([DAG_TOOLS_DIR])
195                ac_cv_lbl_dag_api=yes
196               
197                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
198                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
199        else
200                if test "$want_dag" = yes; then
201                        AC_MSG_ERROR(DAG API not found under directory $dag_root
202; use --without-dag)
203                fi
204                ac_cv_lbl_dag_api=no
205        fi
206        AC_MSG_RESULT($ac_cv_lbl_dag_api)
207else
208        AC_DEFINE(HAVE_DAG,0,[conditional for building with DAG support])
209fi
210
211AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
212AM_CONDITIONAL(DAG2_4, test x$dag2_4 = xtrue)
213
214
215# Check for miscellaneous programs
216AC_CHECK_PROG([has_doxygen], [doxygen], [true], [false])
217
218AM_CONDITIONAL(HAS_DOXYGEN, [test x"$has_doxygen" = xtrue])
219
220
221
222# The following is commented out because it seems you don't actually
223# need it. libpcap 'just works' with large files, even under woody,
224# although you probably need _FILE_OFFSET_BITS and LARGEFILE etc set
225# properly - libtrace handles this however.
226## configure time options for selecting which libpcap and libz to use
227## this is provided to allow for systems whose default libraries don't support
228## large files - you can build your own and link using these options
229#AC_ARG_WITH([pcap],
230#    AC_HELP_STRING([--with-pcap],
231#                                  [name of pcap library (default is pcap)]),
232#       [ac_cv_use_pcap=$withval],
233#    [ac_cv_use_pcap=pcap])
234#
235#
236#AC_ARG_WITH([pcap-path],
237#    AC_HELP_STRING([--with-pcap-path],
238#                                  [location of pcap library (default is /usr/lib)]),
239#       [ac_cv_use_pcap_path=$withval],
240#    [ac_cv_use_pcap_path=/usr/lib])
241#
242#if test x"$ac_cv_use_pcap" != xno; then
243#    ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
244#   
245#    pcap_lib_file="${ac_cv_use_pcap_path}/lib${ac_cv_use_pcap}.so"
246#   
247#    # if the library is in /usr/lib, then just use
248#    # AC_CHECK_LIB.
249#    if test x"${ac_cv_use_pcap_path}" == x"/usr/lib"; then
250#           AC_CHECK_LIB(${ac_cv_use_pcap},pcap_open_live,
251#                        have_libpcap=yes,
252#                        have_libpcap=no)
253#
254#           if test x"${have_libpcap}" == xno; then
255#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
256#               AC_MSG_ERROR([Exiting]);
257#           fi
258#    else
259#       ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
260#       # if it's not in /usr/lib/, check manually. This isn't nice,
261#       # and will probably break.
262#       if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then
263#               AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
264#               AC_MSG_ERROR([Exiting]);
265#       fi 
266#    fi
267#    AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support])
268#else
269#    AC_DEFINE(HAVE_PCAP,0,[Conditional for building PCAP support])
270#fi
271
272
273AC_ARG_WITH([zlib],
274    AC_HELP_STRING([--with-zlib],
275                               [name of zlib library (default is z)]),
276        [ac_cv_use_zlib=$withval],
277    [ac_cv_use_zlib=z])
278
279AC_ARG_WITH([zlib-path],
280    AC_HELP_STRING([--with-zlib-path],
281                   [location of zlib library (default is /usr/lib)]),
282    [ac_cv_use_zlib_path=$withval],
283    [ac_cv_use_zlib_path=/usr/lib])
284
285if test "$ac_cv_use_zlib" != no; then
286    ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
287   
288    zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
289
290    # if the library is in /usr/lib/, then just use AC_CHECK_LIB
291    if test x"${ac_cv_use_zlib_path}" == x"/usr/lib"; then
292            AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen,
293                         have_libzlib=yes,
294                         have_libzlib=no)
295            if test x"{have_libzlib}" == xno; then
296                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
297                AC_MSG_ERROR([Exiting]);
298            fi
299    else
300        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
301        # if it's not in /usr/lib/, check manually. This isn't nice
302        # and will probably break.
303        if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then
304                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
305                AC_MSG_ERROR([Exiting]);
306        fi
307    fi
308    AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
309else
310    AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support])   
311fi
312
313
314
315AC_SUBST([ADD_LIBS])
316AC_SUBST([ADD_LDFLAGS])
317AC_SUBST([ADD_INCLS])
318AC_SUBST([LTLIBOBJS])
319AC_SUBST([MANPAGES])
320
321dnl and finally, output our Makefiles
322AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.