source: configure.in @ 92c5ce3

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

removed some header checks

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