source: configure.in @ 624a2f5

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

poink

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