source: configure.in @ a6d38b6

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

adding DAG support

  • Property mode set to 100644
File size: 5.1 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.7,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace,2.0.7)
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
121
122
123dnl configure time options for selecting which libpcap and libz to use
124dnl this is provided to allow for systems whose default libraries don't support
125dnl large files - you can build your own and link using these options
126AC_DEFUN([CHECK_LIBPCAP],
127         [AC_ARG_WITH([pcap],
128                      AC_HELP_STRING([--with-pcap],
129                                     [name of pcap library (default is pcap)]),
130                      [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap])
131AC_CACHE_CHECK([which pcap library to use],
132               [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])])
133
134AC_DEFUN([CHECK_LIBPCAP_PATH],
135         [AC_ARG_WITH([pcap-path],
136                      AC_HELP_STRING([--with-pcap-path],
137                                     [location of pcap library (default is /usr/lib)]),
138                      [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib])
139AC_CACHE_CHECK([location of pcap library],
140               [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])])
141
142
143AC_DEFUN([CHECK_LIBZ],
144         [AC_ARG_WITH([zlib],
145                      AC_HELP_STRING([--with-zlib],
146                                     [name of zlib library (default is z)]),
147                      [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z])
148AC_CACHE_CHECK([which zlib library to use],
149               [ac_cv_use_zlib], [ac_cv_use_zlib=z])])
150
151AC_DEFUN([CHECK_LIBZ_PATH],
152        [AC_ARG_WITH([zlib-path],
153                AC_HELP_STRING([--with-zlib-path],
154                        [location of zlib library (default is /usr/lib)]),
155                [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib])
156AC_CACHE_CHECK([location of zlib library],
157               [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])])
158
159
160
161CHECK_LIBPCAP
162CHECK_LIBPCAP_PATH
163
164ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
165ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
166
167CHECK_LIBZ
168CHECK_LIBZ_PATH
169ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
170ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
171
172AC_SUBST([ADD_LIBS])
173AC_SUBST([ADD_LDFLAGS])
174AC_SUBST([ADD_INCLS])
175
176dnl and finally, output our Makefiles
177AC_OUTPUT(Makefile lib/Makefile)
Note: See TracBrowser for help on using the repository browser.