source: configure.in @ a81d2fc

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since a81d2fc was 5798dc6, checked in by Shane Alcock <salcock@…>, 14 years ago
  • Changed DAG 2.5 code to force it to call dag_advance_stream if it has read 4MB without doing so. This is to ensure that the processed records get freed regularly.
  • Changed a couple of internal functions in format_dag24 to be static, which fixes some warnings
  • Changed the wording of the configure message that checks for DAG2.4 after failing to find DAG 2.5 or later to make it obvious that we aren't trying to do the same thing twice (and getting inconsistent results!)
  • Property mode set to 100644
File size: 8.4 KB
RevLine 
[dcc1343]1# Process this file with autoconf to produce a configure script.
[144fc8d]2
[e5f1431]3# Now you only need to update the version number in two places - below,
4# and in the README
5
[9514ca0]6AC_INIT([libtrace],[3.0.2],[contact@wand.net.nz],[libtrace])
[e5f1431]7
[14d8a63]8LIBTRACE_MAJOR=3
[144fc8d]9LIBTRACE_MID=0
[9514ca0]10LIBTRACE_MINOR=2
[144fc8d]11
[3085992]12AC_CONFIG_SRCDIR(lib/trace.c)
[e5f1431]13AM_INIT_AUTOMAKE
14
15AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version])
16AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version])
17AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version])
[14e60c60]18
[e5f1431]19AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile
[83f2cbf]20        tools/Makefile tools/traceanon/Makefile tools/tracepktdump/Makefile
[e5f1431]21        tools/tracemerge/Makefile tools/tracereport/Makefile
22        tools/tracertstats/Makefile tools/tracesplit/Makefile
[02bd77e]23        tools/tracestats/Makefile tools/traceflow/Makefile
[6187a46]24        examples/Makefile examples/skeleton/Makefile examples/rate/Makefile
[47de0aa]25        docs/libtrace.doxygen
26        lib/libtrace.h
[d5a27e8]27        ])
[1f3696b]28dnl GNU C library
[e5d3718]29dnl AC_GNU_SOURCE
[3085992]30
[61ecfb6]31
[755e794]32AM_CONFIG_HEADER([config.h])
[14e60c60]33dnl Checks for programs.
34AC_PROG_CC
[a3505a8]35AC_PROG_CXX
[14e60c60]36AC_PROG_INSTALL
[61a9096]37AC_PROG_YACC
[22ce0d5]38AM_PROG_LEX
[14e60c60]39
[61ecfb6]40AC_CONFIG_LIBOBJ_DIR(lib)
[14e60c60]41
[5540efc]42# Checks for typedefs, structures, and compiler characteristics.
43AC_C_CONST
44AC_C_INLINE
45AC_C_BIGENDIAN
46AC_TYPE_SIZE_T
47AC_HEADER_TIME
48AC_SYS_LARGEFILE
49
[470afa7]50if test "$GCC" = "yes"; then
[994beed]51        CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes"
[470afa7]52fi
53
[47de0aa]54AC_PROG_LIBTOOL
[858f07f]55
[5540efc]56# Checks for library functions.
57AC_PROG_GCC_TRADITIONAL
[e283596]58AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf)
[5540efc]59
[41b53c2]60AC_CHECK_SIZEOF([long int])
61
[fe3d755]62
63
[41b53c2]64# Check for various broken functions
65AC_FUNC_MALLOC
66AC_FUNC_REALLOC
67
68# *BSD doesn't have strndup. Currently provide our own.
69AC_REPLACE_FUNCS(strndup)
70
[dcc1343]71# Checks for header files.
[14e60c60]72AC_HEADER_STDC
[11346a5]73AC_CHECK_HEADERS(pcap.h pcap-int.h pcap-bpf.h net/bpf.h sys/limits.h stddef.h inttypes.h limits.h net/ethernet.h )
[808a478]74
75AC_CHECK_HEADERS(netinet/in.h)
[e5c2bc4]76AC_CHECK_HEADERS(netpacket/packet.h,[
77        libtrace_netpacket_packet_h=true
78        AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net])
79])
[808a478]80AC_CHECK_HEADER(net/if.h,
[e5c2bc4]81        AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[
82 #include <sys/types.h>
[808a478]83 #include <sys/socket.h>
84])
85
[41b53c2]86AC_CHECK_HEADER(netinet/ether.h,
[e5c2bc4]87        AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[
[41b53c2]88 #include <sys/types.h>
89 #include <sys/socket.h>
90 #include <netinet/in.h>
91 #include <net/if.h>
92])
93
[808a478]94AC_CHECK_HEADER(netinet/if_ether.h,
[e5c2bc4]95        AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[
[808a478]96 #include <sys/types.h>
97 #include <sys/socket.h>
98 #include <netinet/in.h>
99 #include <net/if.h>
100])
101
[e5c2bc4]102AC_CHECK_HEADER(net/if_arp.h,
103        AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[
[808a478]104 #include <sys/types.h>
105 #include <sys/socket.h>
106 #include <netinet/in.h>
107 #include <net/if.h>
108])
109
[dcc1343]110# Checking for the right bpf header to include
[e5c2bc4]111AC_CHECK_HEADER(pcap-bpf.h)
112AC_CHECK_HEADER(net/bpf.h)
113AC_CHECK_HEADER(gdc.h)
[5540efc]114
[4e65f42]115# Check to see if we have libdl - *BSD has built-in libdl
[e5c2bc4]116AC_CHECK_LIB(dl, dlopen)
117# check pcap
[544c680]118AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0)
119#AC_CHECK_LIB(pcap,pcap_next_ex)
120#AC_REPLACE_FUNCS(pcap_open_dead)
121#AC_REPLACE_FUNCS(pcap_dump_flush)
122#AC_REPLACE_FUNCS(pcap_next_ex)
[e5c2bc4]123AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock)
[755e794]124AC_CHECK_DECLS([BIOCSETIF],,,[
125#include <sys/types.h>
126#include <sys/time.h>
127#include <sys/ioctl.h>
128#include <net/bpf.h>
129])
[14e60c60]130
[da17570]131# configure time options for man pages
132AC_ARG_WITH(man,
[01bc623]133            AS_HELP_STRING(--with-man,install man pages by default),[
[da17570]134             if test "$withval" = yes
135             then
[4362100]136                     MANPAGES="docs/man/man3/[a-zA-Z]*.3"
[da17570]137             else
138                     MANPAGES=""
139             fi
[01bc623]140])
[97eadcc]141
[e5c2bc4]142AC_PROG_CXX
[4a605a9]143
[544c680]144if test "$pcapfound" = 0; then
145        AC_MSG_ERROR(libpcap0.8 or greater is required to compile libtrace. If you have installed it in a non-standard location please use LDFLAGS to specify the location of the library)
146else
147        ADD_LIBS="$ADD_LIBS -lpcap"
[d5a27e8]148        AC_DEFINE([HAVE_LIBPCAP],1,[compile with libpcap support])
[544c680]149fi
150
[dcc1343]151# configure time options for use of DAG cards
152# borrowed from libpcap!
[4fd12ac]153AC_ARG_WITH(dag,
[e502f76]154            AS_HELP_STRING(--with-dag[=DIR],include DAG support (located in directory DIR, if supplied)),
[4fd12ac]155[
156        if test "$withval" = no
157        then
158                want_dag=no
159        elif test "$withval" = yes
160        then
161                want_dag=yes
[df3bd99]162                dag_root=/usr/local/dag
[4fd12ac]163        else
164                want_dag=yes
165                dag_root=$withval
166        fi
167],[
168        #
169        # Use DAG API if present, otherwise don't
170        #
171        want_dag=ifpresent
[df3bd99]172        dag_root=/usr/local/dag
[4fd12ac]173])
174
[52656ed]175# DAG 3.0 actually puts header files and shared libraries into sensible
176# places now, so we should be able to do a simple CHECK_LIB to see if
177# they're there!
178
179# Addendum: It turns out DAG 2.5 does this too, so we'll match DAG2.5 in here
180# also. This isn't such a bad thing, the DAG2.5 API is essentially the same as
181# DAG 3.0 and libtrace will use the same format_dagXX source for both
[437d002]182libtrace_dag=false
[52656ed]183libtrace_dag_version=none
184
[4fd12ac]185if test "$with_dag" != no; then
[52656ed]186        AC_CHECK_LIB(dag, dag_open, dag_found=1, dag_found=0)
187        if test "$dag_found" = 1; then
188                ADD_LIBS="$ADD_LIBS -ldag"
189                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
190                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
191                libtrace_dag=true
192               
193                AC_DEFINE(DAG_VERSION,30,[defines the DAG driver version])
194                libtrace_dag_version=30
195        fi
196fi
197
198# turn the test part of the next block into a function, so it can be
199# called multiple times for $dag_root, /root/dag, /usr/local/lib
200#dag_drv_v="DAG not present"
201
202# Now check for 2.4 DAG drivers which don't install as cleanly!
203if test "$with_dag" != no -a "$libtrace_dag" = false; then
[5798dc6]204        AC_MSG_CHECKING(whether we have DAG 2.4 API instead)
[4fd12ac]205
206        if test -r "$dag_root/lib"; then
207                dag_lib_dir="$dag_root/lib"
208        else
209                dag_lib_dir="$dag_root"
210        fi
[9f15cd1]211       
[e502f76]212        if test -r "$dag_root/include"; then
[dfc2673]213                dag_tools_dir="$dag_root/tools"
[4fd12ac]214                dag_include_dir="$dag_root/include"
215        else
216                dag_tools_dir="$dag_root"
217                dag_include_dir="$dag_root"
[e502f76]218        fi
[4fd12ac]219
220        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
[dcc1343]221        then
[4fd12ac]222                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
223                ADD_LIBS="$ADD_LIBS -ldag"
224                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
[caa8f99]225                DAG_TOOLS_DIR=$dag_tools_dir
226                AC_SUBST([DAG_TOOLS_DIR])
[437d002]227                libtrace_dag=true
[80a6589]228               
229                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
230                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
[52656ed]231                AC_DEFINE(DAG_VERSION, 24, [defines the DAG driver version])
232                libtrace_dag_version=24
[4fd12ac]233        else
234                if test "$want_dag" = yes; then
235                        AC_MSG_ERROR(DAG API not found under directory $dag_root
236; use --without-dag)
237                fi
[437d002]238                libtrace_dag=false
[4fd12ac]239        fi
[437d002]240        AC_MSG_RESULT($libtrace_dag)
[0fd4ad6]241
[4fd12ac]242fi
[52656ed]243
[e5c2bc4]244AC_CHECK_LIB(z, gzopen)
[7d31d26]245
[755e794]246AM_CONDITIONAL([HAVE_BPF], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
[4a605a9]247AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
[52656ed]248AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24])
249AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25])
250AM_CONDITIONAL([DAG3_0], [test "$libtrace_dag_version" = 30])
[306f91c]251AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_gzopen" = yes])
[7b2a39b]252AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
[306f91c]253AM_CONDITIONAL([LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
[4a605a9]254
255# Check for miscellaneous programs
256AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false])
257
258AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue])
[dcc1343]259
260
[4fd12ac]261AC_SUBST([ADD_LIBS])
262AC_SUBST([ADD_LDFLAGS])
263AC_SUBST([ADD_INCLS])
[be40c18]264AC_SUBST([LTLIBOBJS])
[da17570]265AC_SUBST([MANPAGES])
[e5f1431]266AC_SUBST([PACKAGE_VERSION])
267AC_SUBST([LIBTRACE_MAJOR])
268AC_SUBST([LIBTRACE_MID])
269AC_SUBST([LIBTRACE_MINOR])
[0fd4ad6]270AC_SUBST([DAG_VERSION_NUM])
[dea6547]271dnl and finally, output our Makefiles
[6659ffb]272AC_OUTPUT
[437d002]273
[41b53c2]274reportopt() {
[ba0017c]275        if test x"$2" = xtrue -o x"$2" = xyes; then
[437d002]276                AC_MSG_NOTICE([$1: Yes])
277        else
278                AC_MSG_NOTICE([$1: No])
279        fi
280}
281
[306f91c]282echo
[e5f1431]283AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION])
[544c680]284reportopt "Compiled with PCAP 0.8 support" $ac_cv_lib_pcap_pcap_next_ex
[306f91c]285reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_gzopen
[01b2922]286if test x"$libtrace_dag" = xtrue; then
[52656ed]287        if test "$libtrace_dag_version" = 24; then
[01b2922]288                AC_MSG_NOTICE([Compiled with DAG support: 2.4])
[52656ed]289        elif test "$libtrace_dag_version" = 30; then
290                AC_MSG_NOTICE([Compiled with DAG support: 3.0])
[01b2922]291        else
292                AC_MSG_NOTICE([Compiled with DAG support: 2.5])
[52656ed]293        fi     
[01b2922]294else
295        AC_MSG_NOTICE([Compiled with DAG support: No])
296fi
[437d002]297reportopt "Building man pages/documentation" $libtrace_doxygen
298
Note: See TracBrowser for help on using the repository browser.