source: configure.in @ 26a2928

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

hm

  • Property mode set to 100644
File size: 6.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.10,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace,2.0.10)
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
60dnl Checks for typedefs, structures, and compiler characteristics.
61AC_C_CONST
62AC_C_INLINE
63AC_C_BIGENDIAN
64AC_TYPE_SIZE_T
65AC_HEADER_TIME
66AC_SYS_LARGEFILE
67
68dnl Checks for library functions.
69AC_PROG_GCC_TRADITIONAL
70AC_CHECK_FUNCS(socket strdup)
71
72
73dnl configure time options for use of DAG cards
74dnl borrowed from libpcap!
75AC_ARG_WITH(dag,
76            AC_HELP_STRING([--with-dag[=DIR]],
77                           [include DAG support (located in directory DIR, if supplied)]),
78[
79        if test "$withval" = no
80        then
81                want_dag=no
82        elif test "$withval" = yes
83        then
84                want_dag=yes
85                dag_root=
86        else
87                want_dag=yes
88                dag_root=$withval
89        fi
90],[
91        #
92        # Use DAG API if present, otherwise don't
93        #
94        want_dag=ifpresent
95        dag_root=
96])
97
98ac_cv_lbl_dag_api=no
99if test "$with_dag" != no; then
100        AC_MSG_CHECKING(whether we have DAG API)
101
102        if test -z "$dag_root"; then
103                dag_root=$srcdir/../dag
104        fi
105
106        if test -r "$dag_root/lib"; then
107                dag_lib_dir="$dag_root/lib"
108        else
109                dag_lib_dir="$dag_root"
110        fi
111
112        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
113                dag_tools_dir="$dag_root/tools"
114                dag_include_dir="$dag_root/include"
115        else
116                dag_tools_dir="$dag_root"
117                dag_include_dir="$dag_root"
118        fi
119
120        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
121then
122                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
123                ADD_LIBS="$ADD_LIBS -ldag"
124                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
125                DAG_TOOLS_DIR=$dag_tools_dir
126                AC_SUBST([DAG_TOOLS_DIR])
127                #ADD_LIBS="$ADD_LIBS $dag_tools_dir/dagapi.o $dag_tools_dir/dagopts.o"
128                #ADD_SOURCES="$ADD_SOURCES $dag_tools_dir/dagapi.c $dag_tools_dir/dagopts.c"
129                ac_cv_lbl_dag_api=yes
130        else
131                ac_cv_lbl_dag_api=no
132        fi
133        AC_MSG_RESULT($ac_cv_lbl_dag_api)
134        if test $ac_cv_lbl_dag_api = no; then
135                if test "$want_dag" = yes; then
136                        AC_MSG_ERROR(DAG API not found under directory $dag_root
137; use --without-dag)
138                fi
139        else
140                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
141        fi
142fi
143
144AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
145
146
147dnl configure time options for selecting which libpcap and libz to use
148dnl this is provided to allow for systems whose default libraries don't support
149dnl large files - you can build your own and link using these options
150AC_DEFUN([CHECK_LIBPCAP],
151         [AC_ARG_WITH([pcap],
152                      AC_HELP_STRING([--with-pcap],
153                                     [name of pcap library (default is pcap)]),
154                      [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap])
155AC_CACHE_CHECK([which pcap library to use],
156               [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])])
157
158AC_DEFUN([CHECK_LIBPCAP_PATH],
159         [AC_ARG_WITH([pcap-path],
160                      AC_HELP_STRING([--with-pcap-path],
161                                     [location of pcap library (default is /usr/lib)]),
162                      [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib])
163AC_CACHE_CHECK([location of pcap library],
164               [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])])
165
166
167AC_DEFUN([CHECK_LIBZ],
168         [AC_ARG_WITH([zlib],
169                      AC_HELP_STRING([--with-zlib],
170                                     [name of zlib library (default is z)]),
171                      [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z])
172AC_CACHE_CHECK([which zlib library to use],
173               [ac_cv_use_zlib], [ac_cv_use_zlib=z])])
174
175AC_DEFUN([CHECK_LIBZ_PATH],
176        [AC_ARG_WITH([zlib-path],
177                AC_HELP_STRING([--with-zlib-path],
178                        [location of zlib library (default is /usr/lib)]),
179                [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib])
180AC_CACHE_CHECK([location of zlib library],
181               [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])])
182
183
184
185CHECK_LIBPCAP
186CHECK_LIBPCAP_PATH
187
188if test "$ac_cv_use_pcap" != no; then
189        ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
190        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
191fi
192CHECK_LIBZ
193CHECK_LIBZ_PATH
194
195if test "$ac_cv_use_zlib" != no; then
196        ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
197        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
198fi
199
200AC_SUBST([ADD_LIBS])
201AC_SUBST([ADD_LDFLAGS])
202AC_SUBST([ADD_INCLS])
203
204dnl and finally, output our Makefiles
205AC_OUTPUT(Makefile lib/Makefile)
Note: See TracBrowser for help on using the repository browser.