source: configure.in @ dea6547

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

configure time checks for pcpa-bpf.h/ net/bpf.h

  • Property mode set to 100644
File size: 3.1 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(libtrace,2.0.7,[libtrace@wand.net.nz],libtrace)
3AC_CONFIG_SRCDIR(lib/trace.c)
4AM_INIT_AUTOMAKE(libtrace,2.0.7)
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
17dnl 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)
21       
22dnl 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_ERROR([Missing BPF header file])
35fi
36AC_MSG_RESULT([Using $bpfh])
37
38
39dnl Checks for typedefs, structures, and compiler characteristics.
40AC_C_CONST
41AC_C_INLINE
42AC_C_BIGENDIAN
43AC_TYPE_SIZE_T
44AC_HEADER_TIME
45AC_SYS_LARGEFILE
46
47dnl Checks for library functions.
48AC_PROG_GCC_TRADITIONAL
49AC_CHECK_FUNCS(socket strdup)
50
51
52
53dnl configure time options for selecting which libpcap and libz to use
54dnl this is provided to allow for systems whose default libraries don't support
55dnl large files - you can build your own and link using these options
56AC_DEFUN([CHECK_LIBPCAP],
57         [AC_ARG_WITH([pcap],
58                      AC_HELP_STRING([--with-pcap],
59                                     [name of pcap library (default is pcap)]),
60                      [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap])
61AC_CACHE_CHECK([which pcap library to use],
62               [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])])
63
64AC_DEFUN([CHECK_LIBPCAP_PATH],
65         [AC_ARG_WITH([pcap-path],
66                      AC_HELP_STRING([--with-pcap-path],
67                                     [location of pcap library (default is /usr/lib)]),
68                      [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib])
69AC_CACHE_CHECK([location of pcap library],
70               [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])])
71
72
73AC_DEFUN([CHECK_LIBZ],
74         [AC_ARG_WITH([zlib],
75                      AC_HELP_STRING([--with-zlib],
76                                     [name of zlib library (default is z)]),
77                      [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z])
78AC_CACHE_CHECK([which zlib library to use],
79               [ac_cv_use_zlib], [ac_cv_use_zlib=z])])
80
81AC_DEFUN([CHECK_LIBZ_PATH],
82        [AC_ARG_WITH([zlib-path],
83                AC_HELP_STRING([--with-zlib-path],
84                        [location of zlib library (default is /usr/lib)]),
85                [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib])
86AC_CACHE_CHECK([location of zlib library],
87               [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])])
88
89CHECK_LIBPCAP
90CHECK_LIBPCAP_PATH
91CHECK_LIBZ
92CHECK_LIBZ_PATH
93
94LIBPCAP=-l$ac_cv_use_pcap
95LIBPCAP_PATH=-L$ac_cv_use_pcap_path
96
97AC_SUBST([LIBPCAP])
98AC_SUBST([LIBPCAP_PATH])
99
100LIBZ=-l$ac_cv_use_zlib
101LIBZ_PATH=-L$ac_cv_use_zlib_path
102AC_SUBST([LIBZ])
103AC_SUBST([LIBZ_PATH])
104
105
106dnl and finally, output our Makefiles
107AC_OUTPUT(Makefile lib/Makefile)
Note: See TracBrowser for help on using the repository browser.