source: configure.in @ caa8f99

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

changes to pull in dagapi.c and dagopts.c from dag source tree

  • Property mode set to 100644
File size: 5.4 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)
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
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                DAG_TOOLS_DIR=$dag_tools_dir
105                AC_SUBST([DAG_TOOLS_DIR])
106                #ADD_LIBS="$ADD_LIBS $dag_tools_dir/dagapi.o $dag_tools_dir/dagopts.o"
107                #ADD_SOURCES="$ADD_SOURCES $dag_tools_dir/dagapi.c $dag_tools_dir/dagopts.c"
108                ac_cv_lbl_dag_api=yes
109        else
110                ac_cv_lbl_dag_api=no
111        fi
112        AC_MSG_RESULT($ac_cv_lbl_dag_api)
113        if test $ac_cv_lbl_dag_api = no; then
114                if test "$want_dag" = yes; then
115                        AC_MSG_ERROR(DAG API not found under directory $dag_root
116; use --without-dag)
117                fi
118        else
119                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
120        fi
121fi
122
123AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
124
125
126dnl configure time options for selecting which libpcap and libz to use
127dnl this is provided to allow for systems whose default libraries don't support
128dnl large files - you can build your own and link using these options
129AC_DEFUN([CHECK_LIBPCAP],
130         [AC_ARG_WITH([pcap],
131                      AC_HELP_STRING([--with-pcap],
132                                     [name of pcap library (default is pcap)]),
133                      [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap])
134AC_CACHE_CHECK([which pcap library to use],
135               [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])])
136
137AC_DEFUN([CHECK_LIBPCAP_PATH],
138         [AC_ARG_WITH([pcap-path],
139                      AC_HELP_STRING([--with-pcap-path],
140                                     [location of pcap library (default is /usr/lib)]),
141                      [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib])
142AC_CACHE_CHECK([location of pcap library],
143               [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])])
144
145
146AC_DEFUN([CHECK_LIBZ],
147         [AC_ARG_WITH([zlib],
148                      AC_HELP_STRING([--with-zlib],
149                                     [name of zlib library (default is z)]),
150                      [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z])
151AC_CACHE_CHECK([which zlib library to use],
152               [ac_cv_use_zlib], [ac_cv_use_zlib=z])])
153
154AC_DEFUN([CHECK_LIBZ_PATH],
155        [AC_ARG_WITH([zlib-path],
156                AC_HELP_STRING([--with-zlib-path],
157                        [location of zlib library (default is /usr/lib)]),
158                [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib])
159AC_CACHE_CHECK([location of zlib library],
160               [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])])
161
162
163
164CHECK_LIBPCAP
165CHECK_LIBPCAP_PATH
166
167if test "$ac_cv_use_pcap" != no; then
168        ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
169        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
170fi
171CHECK_LIBZ
172CHECK_LIBZ_PATH
173
174if test "$ac_cv_use_zlib" != no; then
175        ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
176        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
177fi
178
179AC_SUBST([ADD_LIBS])
180AC_SUBST([ADD_LDFLAGS])
181AC_SUBST([ADD_INCLS])
182
183dnl and finally, output our Makefiles
184AC_OUTPUT(Makefile lib/Makefile)
Note: See TracBrowser for help on using the repository browser.