source: configure.in @ 6659ffb

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

AC_OUTPUT with args is deprecated

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