1 | # Process this file with autoconf to produce a configure script. |
---|
2 | |
---|
3 | # Now you only need to update the version number in two places - below, |
---|
4 | # and in the README |
---|
5 | |
---|
6 | AC_INIT([libtrace],[3.0.7],[contact@wand.net.nz],[libtrace]) |
---|
7 | |
---|
8 | LIBTRACE_MAJOR=3 |
---|
9 | LIBTRACE_MID=0 |
---|
10 | LIBTRACE_MINOR=7 |
---|
11 | |
---|
12 | # OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not |
---|
13 | # searched by default - add it to LDFLAGS so we at least have a chance of |
---|
14 | # finding it |
---|
15 | if test -d "/usr/gnu/lib"; then |
---|
16 | LDFLAGS+=" -L/usr/gnu/lib" |
---|
17 | fi |
---|
18 | |
---|
19 | AC_CONFIG_MACRO_DIR([m4]) |
---|
20 | AC_CONFIG_SRCDIR(lib/trace.c) |
---|
21 | AM_INIT_AUTOMAKE |
---|
22 | |
---|
23 | # Make sure we use the relatively silent automake output |
---|
24 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
---|
25 | |
---|
26 | # Define our libtrace version number externally so we can use it in the source |
---|
27 | # as well, if needed. |
---|
28 | AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version]) |
---|
29 | AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version]) |
---|
30 | AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version]) |
---|
31 | |
---|
32 | # These are all the files we want to be built for us by configure |
---|
33 | AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile |
---|
34 | tools/Makefile tools/traceanon/Makefile tools/tracepktdump/Makefile |
---|
35 | tools/tracemerge/Makefile tools/tracereport/Makefile |
---|
36 | tools/tracertstats/Makefile tools/tracesplit/Makefile |
---|
37 | tools/tracestats/Makefile tools/tracetop/Makefile |
---|
38 | tools/tracereplay/Makefile tools/tracediff/Makefile |
---|
39 | examples/Makefile examples/skeleton/Makefile examples/rate/Makefile |
---|
40 | examples/stats/Makefile examples/tutorial/Makefile |
---|
41 | docs/libtrace.doxygen |
---|
42 | lib/libtrace.h |
---|
43 | ]) |
---|
44 | |
---|
45 | |
---|
46 | # Function that checks if the C++ compiler actually works - there's a bit of |
---|
47 | # oversight in autoconf that will set the C++ compiler to g++ if no compiler |
---|
48 | # is found, even if g++ is not present! So we need an extra test to make sure |
---|
49 | # that the compiler works :( |
---|
50 | |
---|
51 | AC_DEFUN([rw_PROG_CXX_WORKS], |
---|
52 | [AC_REQUIRE([AC_PROG_CXX])dnl |
---|
53 | AC_CACHE_CHECK([whether the C++ compiler works], |
---|
54 | [rw_cv_prog_cxx_works], |
---|
55 | [AC_LANG_PUSH([C++]) |
---|
56 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
---|
57 | [rw_cv_prog_cxx_works=yes], |
---|
58 | [rw_cv_prog_cxx_works=no]) |
---|
59 | AC_LANG_POP([C++])]) |
---|
60 | ]) |
---|
61 | |
---|
62 | # Put all our automake definitions in config.h |
---|
63 | AM_CONFIG_HEADER([config.h]) |
---|
64 | |
---|
65 | # Checks for C and C++ compilers |
---|
66 | AC_PROG_CC |
---|
67 | AC_PROG_CXX |
---|
68 | rw_PROG_CXX_WORKS |
---|
69 | |
---|
70 | if test "$rw_cv_prog_cxx_works" = "no"; then |
---|
71 | AC_MSG_ERROR("Failed to find working C++ compiler") |
---|
72 | fi |
---|
73 | |
---|
74 | # Checking for 'install' |
---|
75 | AC_PROG_INSTALL |
---|
76 | |
---|
77 | # Checking for bison and flex |
---|
78 | AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc) |
---|
79 | AM_PROG_LEX |
---|
80 | |
---|
81 | # All our source files for function replacements are in lib/ |
---|
82 | AC_CONFIG_LIBOBJ_DIR(lib) |
---|
83 | |
---|
84 | # Check for various "replacement" functions |
---|
85 | AC_FUNC_MALLOC |
---|
86 | AC_FUNC_REALLOC |
---|
87 | |
---|
88 | # *BSD doesn't have strndup. Currently provide our own. |
---|
89 | AC_REPLACE_FUNCS(strndup) |
---|
90 | |
---|
91 | |
---|
92 | # Checks for typedefs, structures, and compiler characteristics. |
---|
93 | AC_C_CONST |
---|
94 | AC_C_INLINE |
---|
95 | AC_C_BIGENDIAN |
---|
96 | AC_TYPE_SIZE_T |
---|
97 | AC_HEADER_TIME |
---|
98 | AC_SYS_LARGEFILE |
---|
99 | |
---|
100 | # Set our C compiler flags based on the gcc version |
---|
101 | if test "$GCC" = "yes"; then |
---|
102 | |
---|
103 | gcc_version=`gcc -dumpversion` |
---|
104 | |
---|
105 | # This is probably not the most reliable way to test whether our |
---|
106 | # compiler supports visibility, but it's better than nothing |
---|
107 | # |
---|
108 | # According to the gcc wiki - http://gcc.gnu.org/wiki/Visibility - |
---|
109 | # visibility is supported in gcc 4.0 or later, so we just need to |
---|
110 | # check the major version number |
---|
111 | |
---|
112 | major=${gcc_version%\.*\.*} |
---|
113 | |
---|
114 | if test "$major" -lt 4; then |
---|
115 | vis=no |
---|
116 | else |
---|
117 | vis=yes |
---|
118 | fi |
---|
119 | |
---|
120 | CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -O2" |
---|
121 | CXXFLAGS="$CXXFLAGS -Wall -O2" |
---|
122 | LIBCFLAGS="$CFLAGS" |
---|
123 | LIBCFLAGS="$LIBCFLAGS -DLT_BUILDING_DLL=1" |
---|
124 | LIBCXXFLAGS="$CXXFLAGS" |
---|
125 | LIBCXXFLAGS="$CXXFLAGS -DLT_BUILDING_DLL=1" |
---|
126 | |
---|
127 | if test "$vis" = "yes"; then |
---|
128 | LIBCFLAGS="$LIBCFLAGS -Wextra -fvisibility=hidden" |
---|
129 | LIBCXXFLAGS="$CXXFLAGS -Wextra -fvisibility=hidden" |
---|
130 | fi |
---|
131 | fi |
---|
132 | |
---|
133 | # Check for libtool |
---|
134 | AC_PROG_LIBTOOL |
---|
135 | |
---|
136 | # Checks for library functions. |
---|
137 | AC_PROG_GCC_TRADITIONAL |
---|
138 | |
---|
139 | # Fail if any of these functions are missing |
---|
140 | AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf) |
---|
141 | |
---|
142 | AC_CHECK_SIZEOF([long int]) |
---|
143 | |
---|
144 | |
---|
145 | # Checks for header files. |
---|
146 | AC_HEADER_STDC |
---|
147 | AC_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 sys/prctl.h) |
---|
148 | |
---|
149 | |
---|
150 | # OpenSolaris puts ncurses.h in /usr/include/ncurses rather than /usr/include, |
---|
151 | # so check for that |
---|
152 | AC_CHECK_HEADERS(ncurses.h,,[missing_ncurses=true]) |
---|
153 | |
---|
154 | if test "x$missing_ncurses" = xtrue; then |
---|
155 | if test -f "/usr/include/ncurses/ncurses.h"; then |
---|
156 | AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Has nested ncurses header]) |
---|
157 | fi |
---|
158 | fi |
---|
159 | |
---|
160 | |
---|
161 | # Check for the presence of various networking headers and define appropriate |
---|
162 | # macros |
---|
163 | AC_CHECK_HEADERS(netinet/in.h) |
---|
164 | AC_CHECK_HEADERS(netpacket/packet.h,[ |
---|
165 | libtrace_netpacket_packet_h=true |
---|
166 | AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net]) |
---|
167 | ]) |
---|
168 | AC_CHECK_HEADER(net/if.h, |
---|
169 | AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[ |
---|
170 | #include <sys/types.h> |
---|
171 | #include <sys/socket.h> |
---|
172 | ]) |
---|
173 | |
---|
174 | AC_CHECK_HEADER(netinet/ether.h, |
---|
175 | AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[ |
---|
176 | #include <sys/types.h> |
---|
177 | #include <sys/socket.h> |
---|
178 | #include <netinet/in.h> |
---|
179 | #include <net/if.h> |
---|
180 | ]) |
---|
181 | |
---|
182 | AC_CHECK_HEADER(netinet/if_ether.h, |
---|
183 | AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[ |
---|
184 | #include <sys/types.h> |
---|
185 | #include <sys/socket.h> |
---|
186 | #include <netinet/in.h> |
---|
187 | #include <net/if.h> |
---|
188 | ]) |
---|
189 | |
---|
190 | AC_CHECK_HEADER(net/if_arp.h, |
---|
191 | AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[ |
---|
192 | #include <sys/types.h> |
---|
193 | #include <sys/socket.h> |
---|
194 | #include <netinet/in.h> |
---|
195 | #include <net/if.h> |
---|
196 | ]) |
---|
197 | |
---|
198 | # Check for sdl_len in sockaddr_dl - sockaddr_dl is used on BSD systems |
---|
199 | if test "$libtrace_netpacket_packet_h" != "true"; then |
---|
200 | AC_CHECK_MEMBER([struct sockaddr_dl.sdl_len], |
---|
201 | AC_DEFINE(HAVE_SDL_LEN,1,[Has sdl_len in sockaddr_dl]),,[ |
---|
202 | #include <sys/types.h> |
---|
203 | #include <sys/socket.h> |
---|
204 | #include <net/if_dl.h> |
---|
205 | ]) |
---|
206 | fi |
---|
207 | |
---|
208 | # Checking for the right bpf header to include |
---|
209 | AC_CHECK_HEADER(pcap-bpf.h) |
---|
210 | AC_CHECK_HEADER(net/bpf.h) |
---|
211 | |
---|
212 | # Checking for libgdc |
---|
213 | AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h])) |
---|
214 | |
---|
215 | # Check to see if we have libdl - *BSD has built-in libdl |
---|
216 | AC_CHECK_LIB(dl, dlopen) |
---|
217 | |
---|
218 | # Check for libpcap |
---|
219 | AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0) |
---|
220 | AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock) |
---|
221 | AC_CHECK_DECLS([BIOCSETIF],,,[ |
---|
222 | #include <sys/types.h> |
---|
223 | #include <sys/time.h> |
---|
224 | #include <sys/ioctl.h> |
---|
225 | #include <net/bpf.h> |
---|
226 | ]) |
---|
227 | |
---|
228 | # Configure options for man pages |
---|
229 | AC_ARG_WITH(man, |
---|
230 | AS_HELP_STRING(--with-man,install man pages by default),[ |
---|
231 | if test "$withval" = yes |
---|
232 | then |
---|
233 | MANPAGES="docs/man/man3/[a-zA-Z]*.3" |
---|
234 | else |
---|
235 | MANPAGES="" |
---|
236 | fi |
---|
237 | ]) |
---|
238 | |
---|
239 | # Complain if we didn't find a suitable libpcap |
---|
240 | if test "$pcapfound" = 0; then |
---|
241 | 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) |
---|
242 | else |
---|
243 | ADD_LIBS="$ADD_LIBS -lpcap" |
---|
244 | AC_DEFINE([HAVE_LIBPCAP],1,[compile with libpcap support]) |
---|
245 | AC_DEFINE([HAVE_BPF_FILTER],1,[compile with bpf filter support]) |
---|
246 | fi |
---|
247 | |
---|
248 | # Configure options for use of DAG cards |
---|
249 | # Originally borrowed from libpcap, but extended quite a bit :) |
---|
250 | # More details on how this check works: |
---|
251 | # http://wand.net.nz/trac/libtrace/wiki/DAGNotes |
---|
252 | |
---|
253 | AC_ARG_WITH(dag, |
---|
254 | AS_HELP_STRING(--with-dag[=DIR],include DAG live capture support (located in directory DIR, if supplied)), |
---|
255 | [ |
---|
256 | if test "$withval" = no |
---|
257 | then |
---|
258 | want_dag=no |
---|
259 | elif test "$withval" = yes |
---|
260 | then |
---|
261 | want_dag=yes |
---|
262 | dag_root=/usr/local/dag |
---|
263 | else |
---|
264 | want_dag=yes |
---|
265 | dag_root=$withval |
---|
266 | fi |
---|
267 | ],[ |
---|
268 | # |
---|
269 | # Use DAG API if present, otherwise don't |
---|
270 | # |
---|
271 | want_dag=ifpresent |
---|
272 | dag_root=/usr/local/dag |
---|
273 | ]) |
---|
274 | |
---|
275 | # DAG 3.0 actually puts header files and shared libraries into sensible |
---|
276 | # places now, so we should be able to do a simple CHECK_LIB to see if |
---|
277 | # they're there! |
---|
278 | |
---|
279 | # Addendum: It turns out DAG 2.5 does this too, so we'll match DAG2.5 in here |
---|
280 | # also. This isn't such a bad thing, the DAG2.5 API is essentially the same as |
---|
281 | # DAG 3.0 and libtrace will use the same format_dagXX source for both |
---|
282 | libtrace_dag=false |
---|
283 | libtrace_dag_version=none |
---|
284 | |
---|
285 | if test "$with_dag" != no; then |
---|
286 | AC_CHECK_LIB(dag, dag_open, dag_found=1, dag_found=0) |
---|
287 | if test "$dag_found" = 1; then |
---|
288 | ADD_LIBS="$ADD_LIBS -ldag" |
---|
289 | AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API]) |
---|
290 | AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support]) |
---|
291 | libtrace_dag=true |
---|
292 | |
---|
293 | AC_DEFINE(DAG_VERSION,25,[defines the DAG driver version]) |
---|
294 | libtrace_dag_version=25 |
---|
295 | fi |
---|
296 | fi |
---|
297 | |
---|
298 | # TODO: turn the test part of the next block into a function, so it can be |
---|
299 | # called multiple times for $dag_root, /root/dag, /usr/local/lib |
---|
300 | dag_drv_v="DAG not present" |
---|
301 | |
---|
302 | # Now check for 2.4 DAG drivers which don't install as cleanly! |
---|
303 | if test "$with_dag" != no -a "$libtrace_dag" = false; then |
---|
304 | AC_MSG_CHECKING(whether we have DAG 2.4 API instead) |
---|
305 | |
---|
306 | if test -r "$dag_root/lib"; then |
---|
307 | dag_lib_dir="$dag_root/lib" |
---|
308 | else |
---|
309 | dag_lib_dir="$dag_root" |
---|
310 | fi |
---|
311 | |
---|
312 | if test -r "$dag_root/include"; then |
---|
313 | dag_tools_dir="$dag_root/tools" |
---|
314 | dag_include_dir="$dag_root/include" |
---|
315 | else |
---|
316 | dag_tools_dir="$dag_root" |
---|
317 | dag_include_dir="$dag_root" |
---|
318 | fi |
---|
319 | |
---|
320 | if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a"; |
---|
321 | then |
---|
322 | ADD_INCLS="$ADD_INCLS -I $dag_include_dir" |
---|
323 | ADD_LIBS="$ADD_LIBS -ldag" |
---|
324 | ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir" |
---|
325 | DAG_TOOLS_DIR=$dag_tools_dir |
---|
326 | AC_SUBST([DAG_TOOLS_DIR]) |
---|
327 | libtrace_dag=true |
---|
328 | |
---|
329 | AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API]) |
---|
330 | AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support]) |
---|
331 | AC_DEFINE(DAG_VERSION, 24, [defines the DAG driver version]) |
---|
332 | libtrace_dag_version=24 |
---|
333 | else |
---|
334 | if test "$want_dag" = yes; then |
---|
335 | AC_MSG_ERROR(DAG API not found under directory $dag_root |
---|
336 | ; use --without-dag) |
---|
337 | fi |
---|
338 | libtrace_dag=false |
---|
339 | fi |
---|
340 | AC_MSG_RESULT($libtrace_dag) |
---|
341 | |
---|
342 | fi |
---|
343 | |
---|
344 | # Try to determine the DAG driver version |
---|
345 | #if test x"$libtrace_dag" = xtrue; then |
---|
346 | # dag_drv_v="Unknown" |
---|
347 | # files=`locate /usr/*dag*/VERSION` |
---|
348 | # file_count=0 |
---|
349 | # |
---|
350 | # for i in $files; do |
---|
351 | # if $file_count > 0; then |
---|
352 | # dag_drv_v="Indeterminate" |
---|
353 | # break |
---|
354 | # fi |
---|
355 | # dag_drv_v=`cat $i` |
---|
356 | # file_count=$file_count+1 |
---|
357 | # done |
---|
358 | #fi |
---|
359 | #DAG_VERSION_NUM=$dag_drv_v |
---|
360 | |
---|
361 | have_ncurses=yes |
---|
362 | |
---|
363 | # Checks for various "optional" libraries |
---|
364 | AC_CHECK_LIB(z, deflate) |
---|
365 | AC_CHECK_LIB(bz2, BZ2_bzDecompressInit) |
---|
366 | AC_CHECK_LIB(lzo2, lzo1x_1_compress) |
---|
367 | AC_CHECK_LIB(pthread, pthread_create) |
---|
368 | |
---|
369 | # Check for ncurses |
---|
370 | AC_SEARCH_LIBS(mvprintw, ncurses, , have_ncurses=no) |
---|
371 | |
---|
372 | # These libraries have to be explicitly linked in OpenSolaris |
---|
373 | AC_SEARCH_LIBS(getservent, socket, [], [], -lnsl) |
---|
374 | AC_SEARCH_LIBS(inet_ntop, nsl, [], [], -lsocket) |
---|
375 | |
---|
376 | |
---|
377 | # For now, the user has to explicitly ask for the LLVM stuff, as it's a bit |
---|
378 | # rough around the edges :( |
---|
379 | AC_ARG_WITH([llvm], |
---|
380 | [AC_HELP_STRING([--with-llvm], |
---|
381 | [support Just In Time compiler])], |
---|
382 | use_llvm="yes", |
---|
383 | use_llvm="no") |
---|
384 | JIT=no |
---|
385 | |
---|
386 | # Search for LLVM and the libraries that it requires |
---|
387 | if (test "$use_llvm" != "no"); then |
---|
388 | AC_PATH_PROG(LLVM_CONFIG, llvm-config, no) |
---|
389 | |
---|
390 | # XXX Hard coding the path is REALLY bad. |
---|
391 | # llvm-gcc is installed in a stupid place in Debian / Ubuntu. Hard luck |
---|
392 | # if you've installed it somewhere custom. |
---|
393 | # Hopefully in future we can replace this with clang, which may or may |
---|
394 | # not be installed somewhere intelligent. |
---|
395 | AC_PATH_PROG(LLVM_GCC, llvm-gcc, no, /usr/lib/llvm/llvm/gcc-4.2/bin) |
---|
396 | |
---|
397 | AC_LANG_PUSH([C++]) |
---|
398 | AC_CHECK_HEADERS([boost/lexical_cast.hpp], boost="yes", boost="no") |
---|
399 | AC_LANG_POP([C++]) |
---|
400 | |
---|
401 | |
---|
402 | if test "$boost" = "no"; then |
---|
403 | AC_MSG_NOTICE([Unabled to find boost libraries. JIT support disabled.]) |
---|
404 | JIT=no |
---|
405 | elif test "$LLVM_CONFIG" = "no" ; then |
---|
406 | AC_MSG_NOTICE([Unable to find llvm-config. JIT support disabled.]) |
---|
407 | JIT=no |
---|
408 | elif test "$LLVM_GCC" = "no"; then |
---|
409 | AC_MSG_NOTICE([Unable to find llvm-gcc. JIT support disabled.]) |
---|
410 | JIT=no |
---|
411 | else |
---|
412 | LIBCXXFLAGS="`$LLVM_CONFIG --cxxflags` $CXXFLAGS" |
---|
413 | ADD_LIBS="$ADD_LIBS `$LLVM_CONFIG --libs all`"; |
---|
414 | LDFLAGS="`$LLVM_CONFIG --ldflags` $LDFLAGS"; |
---|
415 | JIT=yes |
---|
416 | AC_DEFINE(HAVE_LLVM, 1, [Set to 1 if you have LLVM installed]) |
---|
417 | fi |
---|
418 | fi |
---|
419 | |
---|
420 | |
---|
421 | # Define automake conditionals for use in our Makefile.am files |
---|
422 | AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ]) |
---|
423 | AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true]) |
---|
424 | AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24]) |
---|
425 | AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25]) |
---|
426 | AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_deflate" = yes]) |
---|
427 | AM_CONDITIONAL([HAVE_BZLIB], [test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" = yes]) |
---|
428 | AM_CONDITIONAL([HAVE_LZO], [test "$ac_cv_lib_lzo2_lzo1x_1_compress" = yes]) |
---|
429 | AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true]) |
---|
430 | AM_CONDITIONAL([HAVE_LIBGDC], [test "$ac_cv_header_gdc_h" = yes]) |
---|
431 | AM_CONDITIONAL([HAVE_LLVM], [test "x$JIT" != "xno" ]) |
---|
432 | AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncurses" = "xyes"]) |
---|
433 | |
---|
434 | # Check for miscellaneous programs |
---|
435 | AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false]) |
---|
436 | |
---|
437 | AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue]) |
---|
438 | |
---|
439 | # Set all our output variables |
---|
440 | AC_SUBST([ADD_LIBS]) |
---|
441 | AC_SUBST([ADD_LDFLAGS]) |
---|
442 | AC_SUBST([ADD_INCLS]) |
---|
443 | AC_SUBST([LTLIBOBJS]) |
---|
444 | AC_SUBST([MANPAGES]) |
---|
445 | AC_SUBST([PACKAGE_VERSION]) |
---|
446 | AC_SUBST([LIBTRACE_MAJOR]) |
---|
447 | AC_SUBST([LIBTRACE_MID]) |
---|
448 | AC_SUBST([LIBTRACE_MINOR]) |
---|
449 | AC_SUBST([DAG_VERSION_NUM]) |
---|
450 | AC_SUBST([HAVE_BPF_CAPTURE]) |
---|
451 | AC_SUBST([HAVE_LIBGDC]) |
---|
452 | AC_SUBST([HAVE_LLVM]) |
---|
453 | AC_SUBST([HAVE_NCURSES]) |
---|
454 | AC_SUBST([LIBCFLAGS]) |
---|
455 | AC_SUBST([LIBCXXFLAGS]) |
---|
456 | |
---|
457 | |
---|
458 | # Finally, output our Makefiles |
---|
459 | AC_OUTPUT |
---|
460 | |
---|
461 | # Function for reporting whether an option was set or not |
---|
462 | reportopt() { |
---|
463 | if test x"$2" = xtrue -o x"$2" = xyes; then |
---|
464 | AC_MSG_NOTICE([$1: Yes]) |
---|
465 | else |
---|
466 | AC_MSG_NOTICE([$1: No]) |
---|
467 | fi |
---|
468 | } |
---|
469 | |
---|
470 | |
---|
471 | # Report which configure options were set |
---|
472 | echo |
---|
473 | AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION]) |
---|
474 | reportopt "Compiled with PCAP 0.8 support" $ac_cv_lib_pcap_pcap_next_ex |
---|
475 | reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_deflate |
---|
476 | reportopt "Compiled with compressed trace (bz2) support" $ac_cv_lib_bz2_BZ2_bzDecompressInit |
---|
477 | reportopt "Compiled with compressed trace (lzo write only) support" $ac_cv_lib_lzo2_lzo1x_1_compress |
---|
478 | if test x"$libtrace_dag" = xtrue; then |
---|
479 | if test "$libtrace_dag_version" = 24; then |
---|
480 | AC_MSG_NOTICE([Compiled with DAG live capture support: 2.4]) |
---|
481 | elif test "$libtrace_dag_version" = 30; then |
---|
482 | AC_MSG_NOTICE([Compiled with DAG live capture support: 3.0]) |
---|
483 | else |
---|
484 | AC_MSG_NOTICE([Compiled with DAG live capture support: 2.5]) |
---|
485 | fi |
---|
486 | else |
---|
487 | AC_MSG_NOTICE([Compiled with DAG live capture support: No]) |
---|
488 | fi |
---|
489 | reportopt "Compiled with LLVM BPF JIT support" $JIT |
---|
490 | reportopt "Building man pages/documentation" $libtrace_doxygen |
---|
491 | reportopt "Building tracetop (requires libncurses)" $have_ncurses |
---|
492 | |
---|
493 | # Report any errors relating to missing bison, flex, etc. |
---|
494 | echo |
---|
495 | ac_cv_errcount=0; |
---|
496 | if test -z "$YACC"; then |
---|
497 | AC_MSG_WARN(bison or yacc not found. Please install bison before continuing) |
---|
498 | ac_cv_errcount=$((ac_cv_errcount + 1)) |
---|
499 | fi |
---|
500 | |
---|
501 | if test -z "$LEXLIB"; then |
---|
502 | AC_MSG_WARN(flex or lex not found. Please install flex before continuing) |
---|
503 | ac_cv_errcount=$((ac_cv_errcount + 1)) |
---|
504 | fi |
---|
505 | |
---|
506 | if test $ac_cv_errcount -gt 0; then |
---|
507 | AC_MSG_ERROR(Critical packages are missing and compilation will fail. Please install the packages listed above and rerun ./configure) |
---|
508 | fi |
---|
509 | |
---|