source: configure.in @ 9db00c2

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

fixed up AC_CONFIG_FILES

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