source: configure.in @ 820b439

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

.

  • Property mode set to 100644
File size: 5.8 KB
RevLine 
[dcc1343]1# Process this file with autoconf to produce a configure script.
[70df58d]2AC_INIT(libtrace,2.0.13,[libtrace@wand.net.nz],libtrace)
[3085992]3AC_CONFIG_SRCDIR(lib/trace.c)
[70df58d]4AM_INIT_AUTOMAKE(libtrace,2.0.13)
[14e60c60]5
[9db00c2]6AC_CONFIG_FILES([Makefile replace/Makefile lib/Makefile])
[1f3696b]7dnl GNU C library
[e5d3718]8dnl AC_GNU_SOURCE
[3085992]9
[820b439]10AM_CONFIG_HEADER(config.h)
[e6742f5]11#AC_CONFIG_HEADERS([config.h])
[14e60c60]12dnl Checks for programs.
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_LIBTOOL
16
[97eadcc]17
[14e60c60]18
[dcc1343]19# Checks for header files.
[14e60c60]20AC_HEADER_STDC
[97eadcc]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)
[26a2928]22AC_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)
[dea6547]23       
[dcc1343]24# Checking for the right bpf header to include
[dea6547]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
[dce95f3]36  AC_MSG_RESULT([No BPF headers, compiling without support for BPF filters])
[dcc1343]37  AC_DEFINE(HAVE_BPF,0,[Conditional for building bpf support])
[dce95f3]38else
39  AC_MSG_RESULT([Using $bpfh])
[dcc1343]40  AC_DEFINE(HAVE_BPF,1,[Conditional for building bpf support])
[dea6547]41fi
[14e60c60]42
[26a2928]43
[47801f2]44AC_REPLACE_FUNCS(strndup)
45
[dcc1343]46# Checks for typedefs, structures, and compiler characteristics.
[14e60c60]47AC_C_CONST
48AC_C_INLINE
[97eadcc]49AC_C_BIGENDIAN
[14e60c60]50AC_TYPE_SIZE_T
51AC_HEADER_TIME
[60fc8aa]52AC_SYS_LARGEFILE
[14e60c60]53
[dcc1343]54# Checks for library functions.
[14e60c60]55AC_PROG_GCC_TRADITIONAL
56AC_CHECK_FUNCS(socket strdup)
57
[97eadcc]58
[dcc1343]59# configure time options for use of DAG cards
60# borrowed from libpcap!
[4fd12ac]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";
[dcc1343]107        then
[4fd12ac]108                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
109                ADD_LIBS="$ADD_LIBS -ldag"
110                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
[caa8f99]111                DAG_TOOLS_DIR=$dag_tools_dir
112                AC_SUBST([DAG_TOOLS_DIR])
[4fd12ac]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])
[dcc1343]125                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
[4fd12ac]126        fi
[dcc1343]127else
128        AC_DEFINE(HAVE_DAG,0,[conditional for building with DAG support])
[4fd12ac]129fi
130
[9338143]131AM_CONDITIONAL(HAVE_DAG, test x$ac_cv_lbl_dag_api = xyes)
[4fd12ac]132
[97eadcc]133
[dcc1343]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
[624a2f5]151        ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
152        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
[dcc1343]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])
[624a2f5]162fi
[dcc1343]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])
[624a2f5]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"
[dcc1343]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])   
[624a2f5]191fi
[7d31d26]192
[dcc1343]193
194
[4fd12ac]195AC_SUBST([ADD_LIBS])
196AC_SUBST([ADD_LDFLAGS])
197AC_SUBST([ADD_INCLS])
[dea6547]198
199dnl and finally, output our Makefiles
[6659ffb]200AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.