Changeset c11c3ce
- Timestamp:
- 08/25/10 11:12:10 (11 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 4c92c49
- Parents:
- 4e94095
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.in
ra1e177d rc11c3ce 20 20 AC_CONFIG_SRCDIR(lib/trace.c) 21 21 AM_INIT_AUTOMAKE 22 23 # Make sure we use the relatively silent automake output 22 24 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 23 25 26 # Define our libtrace version number externally so we can use it in the source 27 # as well, if needed. 24 28 AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version]) 25 29 AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version]) 26 30 AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version]) 27 31 32 # These are all the files we want to be built for us by configure 28 33 AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile 29 34 tools/Makefile tools/traceanon/Makefile tools/tracepktdump/Makefile … … 37 42 lib/libtrace.h 38 43 ]) 39 dnl GNU C library 40 dnl AC_GNU_SOURCE 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 :( 41 50 42 51 AC_DEFUN([rw_PROG_CXX_WORKS], … … 51 60 ]) 52 61 53 62 # Put all our automake definitions in config.h 54 63 AM_CONFIG_HEADER([config.h]) 55 dnl Checks for programs. 64 65 # Checks for C and C++ compilers 56 66 AC_PROG_CC 57 67 AC_PROG_CXX … … 62 72 fi 63 73 64 65 74 # Checking for 'install' 66 75 AC_PROG_INSTALL 67 dnl AC_PROG_YACC 76 77 # Checking for bison and flex 68 78 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc) 69 79 AM_PROG_LEX 70 80 81 # All our source files for function replacements are in lib/ 71 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 72 91 73 92 # Checks for typedefs, structures, and compiler characteristics. … … 79 98 AC_SYS_LARGEFILE 80 99 100 # Set our C compiler flags based on the gcc version 81 101 if test "$GCC" = "yes"; then 82 102 … … 111 131 fi 112 132 133 # Check for libtool 113 134 AC_PROG_LIBTOOL 114 135 115 136 # Checks for library functions. 116 137 AC_PROG_GCC_TRADITIONAL 138 139 # Fail if any of these functions are missing 117 140 AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf) 118 141 119 142 AC_CHECK_SIZEOF([long int]) 120 143 121 122 123 # Check for various broken functions124 AC_FUNC_MALLOC125 AC_FUNC_REALLOC126 127 # *BSD doesn't have strndup. Currently provide our own.128 AC_REPLACE_FUNCS(strndup)129 144 130 145 # Checks for header files. … … 132 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) 133 148 149 150 # OpenSolaris puts ncurses.h in /usr/include/ncurses rather than /usr/include, 151 # so check for that 134 152 AC_CHECK_HEADERS(ncurses.h,,[missing_ncurses=true]) 135 153 … … 141 159 142 160 161 # Check for the presence of various networking headers and define appropriate 162 # macros 143 163 AC_CHECK_HEADERS(netinet/in.h) 144 164 AC_CHECK_HEADERS(netpacket/packet.h,[ … … 176 196 ]) 177 197 198 # Check for sdl_len in sockaddr_dl - sockaddr_dl is used on BSD systems 178 199 if test "$libtrace_netpacket_packet_h" != "true"; then 179 # Check for sdl_len in sockaddr_dl180 200 AC_CHECK_MEMBER([struct sockaddr_dl.sdl_len], 181 201 AC_DEFINE(HAVE_SDL_LEN,1,[Has sdl_len in sockaddr_dl]),,[ … … 186 206 fi 187 207 188 189 190 208 # Checking for the right bpf header to include 191 209 AC_CHECK_HEADER(pcap-bpf.h) 192 210 AC_CHECK_HEADER(net/bpf.h) 211 212 # Checking for libgdc 193 213 AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h])) 194 214 195 215 # Check to see if we have libdl - *BSD has built-in libdl 196 216 AC_CHECK_LIB(dl, dlopen) 197 # check pcap 217 218 # Check for libpcap 198 219 AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0) 199 #AC_CHECK_LIB(pcap,pcap_next_ex)200 #AC_REPLACE_FUNCS(pcap_open_dead)201 #AC_REPLACE_FUNCS(pcap_dump_flush)202 #AC_REPLACE_FUNCS(pcap_next_ex)203 220 AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock) 204 221 AC_CHECK_DECLS([BIOCSETIF],,,[ … … 209 226 ]) 210 227 211 # configure time options for man pages228 # Configure options for man pages 212 229 AC_ARG_WITH(man, 213 230 AS_HELP_STRING(--with-man,install man pages by default),[ … … 220 237 ]) 221 238 222 AC_PROG_CXX 223 239 # Complain if we didn't find a suitable libpcap 224 240 if test "$pcapfound" = 0; then 225 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) … … 230 246 fi 231 247 232 # configure time options for use of DAG cards 233 # borrowed from libpcap! 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 234 253 AC_ARG_WITH(dag, 235 254 AS_HELP_STRING(--with-dag[=DIR],include DAG live capture support (located in directory DIR, if supplied)), … … 277 296 fi 278 297 279 # turn the test part of the next block into a function, so it can be298 # TODO: turn the test part of the next block into a function, so it can be 280 299 # called multiple times for $dag_root, /root/dag, /usr/local/lib 281 300 dag_drv_v="DAG not present" … … 324 343 325 344 # Try to determine the DAG driver version 326 if test x"$libtrace_dag" = xtrue; then327 328 files=`locate /usr/*dag*/VERSION`329 330 331 332 if $file_count > 0; then333 dag_drv_v="Indeterminate"334 break335 fi336 dag_drv_v=`cat $i`337 file_count=$file_count+1338 done339 fi340 DAG_VERSION_NUM=$dag_drv_v345 #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 341 360 342 361 have_ncurses=yes 343 362 363 # Checks for various "optional" libraries 344 364 AC_CHECK_LIB(z, deflate) 345 365 AC_CHECK_LIB(bz2, BZ2_bzDecompressInit) 346 366 AC_CHECK_LIB(lzo2, lzo1x_1_compress) 347 367 AC_CHECK_LIB(pthread, pthread_create) 368 369 # Check for ncurses 348 370 AC_SEARCH_LIBS(mvprintw, ncurses, , have_ncurses=no) 371 372 # These libraries have to be explicitly linked in OpenSolaris 349 373 AC_SEARCH_LIBS(getservent, socket, [], [], -lnsl) 350 374 AC_SEARCH_LIBS(inet_ntop, nsl, [], [], -lsocket) … … 360 384 JIT=no 361 385 386 # Search for LLVM and the libraries that it requires 362 387 if (test "$use_llvm" != "no"); then 363 388 AC_PATH_PROG(LLVM_CONFIG, llvm-config, no) … … 394 419 395 420 421 # Define automake conditionals for use in our Makefile.am files 396 422 AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ]) 397 423 AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true]) 398 424 AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24]) 399 425 AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25]) 400 #AM_CONDITIONAL([DAG3_0], [test "$libtrace_dag_version" = 30])401 426 AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_deflate" = yes]) 402 427 AM_CONDITIONAL([HAVE_BZLIB], [test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" = yes]) … … 412 437 AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue]) 413 438 439 # Set all our output variables 414 440 AC_SUBST([ADD_LIBS]) 415 441 AC_SUBST([ADD_LDFLAGS]) … … 428 454 AC_SUBST([LIBCFLAGS]) 429 455 AC_SUBST([LIBCXXFLAGS]) 430 dnl and finally, output our Makefiles 456 457 458 # Finally, output our Makefiles 431 459 AC_OUTPUT 432 460 461 # Function for reporting whether an option was set or not 433 462 reportopt() { 434 463 if test x"$2" = xtrue -o x"$2" = xyes; then … … 439 468 } 440 469 470 471 # Report which configure options were set 441 472 echo 442 473 AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION]) … … 460 491 reportopt "Building tracetop (requires libncurses)" $have_ncurses 461 492 493 # Report any errors relating to missing bison, flex, etc. 462 494 echo 463 495 ac_cv_errcount=0;
Note: See TracChangeset
for help on using the changeset viewer.