source: configure.in @ 70df58d

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

updated to 2.0.13

  • Property mode set to 100644
File size: 6.1 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.13,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace,2.0.13)
5
6dnl GNU C library
7dnl AC_GNU_SOURCE
8
9AM_CONFIG_HEADER(config.h)
10dnl Checks for programs.
11AC_PROG_CC
12AC_PROG_INSTALL
13AC_PROG_LIBTOOL
14
15
16
17dnl Checks for header files.
18AC_HEADER_STDC
19dnl 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)
20AC_CHECK_HEADERS(pcap.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h stdint.h limits.h dagapi.h parser.h libxml/parser.h libxml2/libxml/parser.h)
21       
22dnl Checking for the right bpf header to include
23AC_MSG_CHECKING([where the bpf headers are kept])
24echo ""
25bpfh=no
26AC_CHECK_HEADER(pcap-bpf.h,
27        [AC_DEFINE([HAVE_PCAP_BPF_H]) bpfh=pcap-bpf.h])
28if test $bpfh = no; then
29AC_CHECK_HEADER(net/bpf.h,
30        [AC_DEFINE([HAVE_NET_BPF_H]) bpfh=net/bpf.h])
31fi
32
33if test $bpfh = no; then
34  AC_MSG_RESULT([No BPF headers, compiling without support for BPF filters])
35else
36  AC_MSG_RESULT([Using $bpfh])
37fi
38
39
40AC_MSG_CHECKING([where the libxml parser header is kept])
41echo ""
42xmlparser=no
43AC_CHECK_FILE(/usr/include/parser.h,
44        [AC_DEFINE([HAVE_PARSER_H]) xmlparser=parser.h])
45if test $xmlparser = no; then
46AC_CHECK_FILE(/usr/include/libxml/parser.h,
47        [AC_DEFINE([HAVE_LIBXML_PARSER_H]) xmlparser=libxml/parser.h])
48if test $xmlparser = no; then
49AC_CHECK_FILE(/usr/include/libxml2/libxml/parser.h,
50        [AC_DEFINE([HAVE_LIBXML2_LIBXML_PARSER_H]) xmlparser=libxml2/libxml/parser.h])
51fi
52fi
53
54if test $xmlparser = no; then
55        AC_MSG_RESULT([No libxml parser headers, compiling without XML support])
56else
57        AC_MSG_RESULT([Using $xmlparser])
58fi
59
60AC_REPLACE_FUNCS(strndup)
61
62dnl Checks for typedefs, structures, and compiler characteristics.
63AC_C_CONST
64AC_C_INLINE
65AC_C_BIGENDIAN
66AC_TYPE_SIZE_T
67AC_HEADER_TIME
68AC_SYS_LARGEFILE
69
70dnl Checks for library functions.
71AC_PROG_GCC_TRADITIONAL
72AC_CHECK_FUNCS(socket strdup)
73
74
75dnl configure time options for use of DAG cards
76dnl borrowed from libpcap!
77AC_ARG_WITH(dag,
78            AC_HELP_STRING([--with-dag[=DIR]],
79                           [include DAG support (located in directory DIR, if supplied)]),
80[
81        if test "$withval" = no
82        then
83                want_dag=no
84        elif test "$withval" = yes
85        then
86                want_dag=yes
87                dag_root=
88        else
89                want_dag=yes
90                dag_root=$withval
91        fi
92],[
93        #
94        # Use DAG API if present, otherwise don't
95        #
96        want_dag=ifpresent
97        dag_root=
98])
99
100ac_cv_lbl_dag_api=no
101if test "$with_dag" != no; then
102        AC_MSG_CHECKING(whether we have DAG API)
103
104        if test -z "$dag_root"; then
105                dag_root=$srcdir/../dag
106        fi
107
108        if test -r "$dag_root/lib"; then
109                dag_lib_dir="$dag_root/lib"
110        else
111                dag_lib_dir="$dag_root"
112        fi
113
114        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
115                dag_tools_dir="$dag_root/tools"
116                dag_include_dir="$dag_root/include"
117        else
118                dag_tools_dir="$dag_root"
119                dag_include_dir="$dag_root"
120        fi
121
122        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
123then
124                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
125                ADD_LIBS="$ADD_LIBS -ldag"
126                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
127                DAG_TOOLS_DIR=$dag_tools_dir
128                AC_SUBST([DAG_TOOLS_DIR])
129                #ADD_LIBS="$ADD_LIBS $dag_tools_dir/dagapi.o $dag_tools_dir/dagopts.o"
130                #ADD_SOURCES="$ADD_SOURCES $dag_tools_dir/dagapi.c $dag_tools_dir/dagopts.c"
131                ac_cv_lbl_dag_api=yes
132        else
133                ac_cv_lbl_dag_api=no
134        fi
135        AC_MSG_RESULT($ac_cv_lbl_dag_api)
136        if test $ac_cv_lbl_dag_api = no; then
137                if test "$want_dag" = yes; then
138                        AC_MSG_ERROR(DAG API not found under directory $dag_root
139; use --without-dag)
140                fi
141        else
142                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
143        fi
144fi
145
146AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
147
148
149dnl configure time options for selecting which libpcap and libz to use
150dnl this is provided to allow for systems whose default libraries don't support
151dnl large files - you can build your own and link using these options
152AC_DEFUN([CHECK_LIBPCAP],
153         [AC_ARG_WITH([pcap],
154                      AC_HELP_STRING([--with-pcap],
155                                     [name of pcap library (default is pcap)]),
156                      [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap])
157AC_CACHE_CHECK([which pcap library to use],
158               [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])])
159
160AC_DEFUN([CHECK_LIBPCAP_PATH],
161         [AC_ARG_WITH([pcap-path],
162                      AC_HELP_STRING([--with-pcap-path],
163                                     [location of pcap library (default is /usr/lib)]),
164                      [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib])
165AC_CACHE_CHECK([location of pcap library],
166               [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])])
167
168
169AC_DEFUN([CHECK_LIBZ],
170         [AC_ARG_WITH([zlib],
171                      AC_HELP_STRING([--with-zlib],
172                                     [name of zlib library (default is z)]),
173                      [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z])
174AC_CACHE_CHECK([which zlib library to use],
175               [ac_cv_use_zlib], [ac_cv_use_zlib=z])])
176
177AC_DEFUN([CHECK_LIBZ_PATH],
178        [AC_ARG_WITH([zlib-path],
179                AC_HELP_STRING([--with-zlib-path],
180                        [location of zlib library (default is /usr/lib)]),
181                [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib])
182AC_CACHE_CHECK([location of zlib library],
183               [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])])
184
185
186
187CHECK_LIBPCAP
188CHECK_LIBPCAP_PATH
189
190if test "$ac_cv_use_pcap" != no; then
191        ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
192        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
193fi
194CHECK_LIBZ
195CHECK_LIBZ_PATH
196
197if test "$ac_cv_use_zlib" != no; then
198        ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
199        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
200fi
201
202AC_SUBST([ADD_LIBS])
203AC_SUBST([ADD_LDFLAGS])
204AC_SUBST([ADD_INCLS])
205
206dnl and finally, output our Makefiles
207AC_OUTPUT(Makefile replace/Makefile lib/Makefile)
Note: See TracBrowser for help on using the repository browser.