source: configure.in @ 808a478

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

Ported to OpenBSD

Changes were mostly with header changes, although openbsd's pcap doesn't have pcap_open_dead, so we provide our own. To this end, I fixed the libreplace shit that wasn't working at all well, and ended up putting strndup.c and pcap_open_dead.c into lib/, and adding @LTLIBOBJS@ to the libtrace source file line. Seems to work fine now!

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