diff options
author | sam <sam@FreeBSD.org> | 2005-07-11 03:24:53 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-07-11 03:24:53 +0000 |
commit | d1c1ca625af687a355eb6acd58948cd7ef9620be (patch) | |
tree | d384a6daf986752ae619933314dd5195879612ca /contrib/libpcap/configure.in | |
parent | 70f7ae46f5124d9a1805484495b57250a715bed4 (diff) | |
download | FreeBSD-src-d1c1ca625af687a355eb6acd58948cd7ef9620be.zip FreeBSD-src-d1c1ca625af687a355eb6acd58948cd7ef9620be.tar.gz |
Virgin import of libpcap v0.9.1 (release) from tcpdump.org
Approved by: re (scottl)
Diffstat (limited to 'contrib/libpcap/configure.in')
-rwxr-xr-x | contrib/libpcap/configure.in | 220 |
1 files changed, 160 insertions, 60 deletions
diff --git a/contrib/libpcap/configure.in b/contrib/libpcap/configure.in index d970fd5..fbc70b8 100755 --- a/contrib/libpcap/configure.in +++ b/contrib/libpcap/configure.in @@ -1,4 +1,4 @@ -dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.120 2005/03/27 22:26:25 guy Exp $ (LBL) +dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.120.2.6 2005/06/20 21:37:43 guy Exp $ (LBL) dnl dnl Copyright (c) 1994, 1995, 1996, 1997 dnl The Regents of the University of California. All rights reserved. @@ -6,7 +6,7 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl -AC_REVISION($Revision: 1.120 $) +AC_REVISION($Revision: 1.120.2.6 $) AC_PREREQ(2.50) AC_INIT(pcap.c) @@ -84,7 +84,7 @@ if test "$ac_cv_func_ether_hostton" = yes; then # # Yes. Does it declare ether_hostton()? # - AC_CHECK_DECLS(ether_hostton, + AC_CHECK_DECL(ether_hostton, [ AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,, [Define to 1 if netinet/if_ether.h declares `ether_hostton']) @@ -93,6 +93,7 @@ if test "$ac_cv_func_ether_hostton" = yes; then #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> +#include <arpa/inet.h> struct mbuf; struct rtentry; #include <net/if.h> @@ -115,7 +116,7 @@ struct rtentry; # suppress the next test. # unset ac_cv_have_decl_ether_hostton - AC_CHECK_DECLS(ether_hostton, + AC_CHECK_DECL(ether_hostton, [ AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,, [Define to 1 if netinet/ether.h declares `ether_hostton']) @@ -125,6 +126,33 @@ struct rtentry; ]) fi fi + # + # Is ether_hostton() declared? + # + if test "$ac_cv_have_decl_ether_hostton" != yes; then + # + # No, we'll have to declare it ourselves. + # Do we have "struct ether_addr"? + # + AC_CHECK_TYPES(struct ether_addr,,, + [ +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +struct mbuf; +struct rtentry; +#include <net/if.h> +#include <netinet/if_ether.h> + ]) + AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0, + [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you +don't.]) + else + AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1, + [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you +don't.]) + fi fi dnl to pacify those who hate protochain insn @@ -338,7 +366,11 @@ linux) dag) V_DEFS="$V_DEFS -DDAG_ONLY" - ;; + ;; + +septel) + V_DEFS="$V_DEFS -DSEPTEL_ONLY" + ;; null) AC_MSG_WARN(cannot determine packet capture interface) @@ -359,7 +391,7 @@ fi AC_MSG_RESULT($ac_cv_lbl_proc_net_dev) # Check for Endace DAG card support. -AC_ARG_WITH([dag], [ --with-dag[[=DIR]] include Endace DAG support ("yes", "no" or DIR; default="yes" on BSD and Linux if present)], +AC_ARG_WITH([dag], [ --with-dag[[=DIR]] include Endace DAG support ("yes", "no" or DIR; default="yes" on BSD and Linux if present)], [ if test "$withval" = no then @@ -398,8 +430,8 @@ AC_ARG_WITH([dag-libraries], [ --with-dag-libraries=DIR Endace DAG library dir case "$V_PCAP" in linux|bpf|dag) # - # We support the DAG API on Linux or BSD, or if we're building a - # DAG-only libpcap. + # We support the DAG API if we're on Linux or BSD, or if we're + # building a DAG-only libpcap. # ;; *) @@ -422,7 +454,7 @@ if test "$want_dag" != no; then AC_MSG_CHECKING([whether we have DAG API headers]) - # If necessary, set default paths for DAG API headers and libraries. + # If necessary, set default paths for DAG API headers and libraries. if test -z "$dag_root"; then dag_root=/usr/local fi @@ -442,7 +474,7 @@ if test "$want_dag" != no; then if test -r $dag_include_dir/dagapi.h; then ac_cv_lbl_dag_api=yes fi - AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)]) + AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)]) fi if test $ac_cv_lbl_dag_api = yes; then @@ -450,30 +482,25 @@ if test $ac_cv_lbl_dag_api = yes; then AC_MSG_CHECKING([dagapi.o]) dagapi_obj=no if test -r $dag_tools_dir/dagapi.o; then - - # 2.4.x. + # 2.4.x. dagapi_obj=$dag_tools_dir/dagapi.o - elif test -r $dag_lib_dir/dagapi.o; then - - # 2.5.x. - dagapi_obj=$dag_lib_dir/dagapi.o - - elif test -r $dag_lib_dir/libdag.a; then - - # 2.5.x. + # 2.5.x. + dagapi_obj=$dag_lib_dir/dagapi.o + elif test -r $dag_lib_dir/libdag.a; then + # 2.5.x. ar x $dag_lib_dir/libdag.a dagapi.o if test -r ./dagapi.o; then dagapi_obj=./dagapi.o fi - fi + fi if test $dagapi_obj = no; then - AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)]) + AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)]) ac_cv_lbl_dag_api=no else AC_MSG_RESULT([yes ($dagapi_obj)]) - fi + fi fi if test $ac_cv_lbl_dag_api = yes; then @@ -481,26 +508,21 @@ if test $ac_cv_lbl_dag_api = yes; then AC_MSG_CHECKING([dagopts.o]) dagopts_obj=no if test -r $dag_tools_dir/dagopts.o; then - - # 2.4.x. + # 2.4.x. dagopts_obj=$dag_tools_dir/dagopts.o - elif test -r $dag_lib_dir/dagopts.o; then - - # 2.5.x. - dagopts_obj=$dag_lib_dir/dagopts.o - - elif test -r $dag_lib_dir/libdag.a; then - - # 2.5.x. + # 2.5.x. + dagopts_obj=$dag_lib_dir/dagopts.o + elif test -r $dag_lib_dir/libdag.a; then + # 2.5.x. ar x $dag_lib_dir/libdag.a dagopts.o if test -r ./dagopts.o; then dagopts_obj=./dagopts.o - fi + fi fi if test $dagopts_obj = no; then - AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)]) + AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)]) ac_cv_lbl_dag_api=no else AC_MSG_RESULT([yes ($dagopts_obj)]) @@ -508,37 +530,31 @@ if test $ac_cv_lbl_dag_api = yes; then fi if test $ac_cv_lbl_dag_api = yes; then - # Under 2.5.x only we need to add dagreg.o. if test -r $dag_include_dir/dagreg.h; then - - AC_MSG_CHECKING([dagreg.o]) - dagreg_obj=no - if test -r $dag_lib_dir/dagreg.o; then - - # Object file is ready and waiting. - dagreg_obj=$dag_lib_dir/dagreg.o - - elif test -r $dag_lib_dir/libdag.a; then - - # Extract from libdag.a. + AC_MSG_CHECKING([dagreg.o]) + dagreg_obj=no + if test -r $dag_lib_dir/dagreg.o; then + # Object file is ready and waiting. + dagreg_obj=$dag_lib_dir/dagreg.o + elif test -r $dag_lib_dir/libdag.a; then + # Extract from libdag.a. ar x $dag_lib_dir/libdag.a dagreg.o if test -r ./dagreg.o; then - dagreg_obj=./dagreg.o - fi + dagreg_obj=./dagreg.o + fi fi if test $dagreg_obj = no; then - AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)]) + AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)]) ac_cv_lbl_dag_api=no - else + else AC_MSG_RESULT([yes ($dagreg_obj)]) fi fi fi if test $ac_cv_lbl_dag_api = yes; then - V_INCLS="$V_INCLS -I$dag_include_dir" V_LIBS="$V_LIBS $dagapi_obj $dagopts_obj $dagreg_obj" if test $V_PCAP != dag ; then @@ -546,7 +562,8 @@ if test $ac_cv_lbl_dag_api = yes; then fi # See if we can find a general version string. - # Don't need to save and restore LIBS to prevent -ldag being included if there's a found-action (arg 3). + # Don't need to save and restore LIBS to prevent -ldag being + # included if there's a found-action (arg 3). saved_ldflags=$LDFLAGS LDFLAGS="-L$dag_lib_dir" AC_CHECK_LIB([dag], [dag_attach_stream], [dag_version="2.5.x"], [dag_version="2.4.x"]) @@ -557,20 +574,103 @@ if test $ac_cv_lbl_dag_api = yes; then if test -r "$dag_root/VERSION"; then dag_version="`cat $dag_root/VERSION`" fi - AC_MSG_RESULT([$dag_version]) + AC_MSG_RESULT([$dag_version]) AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API]) fi if test $ac_cv_lbl_dag_api = no; then if test "$want_dag" = yes; then - # User wanted DAG support but we couldn't find it. + # User wanted DAG support but we couldn't find it. AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag]) fi - if test "$V_PCAP" = dag; then - # User requested "dag" capture type but the DAG API wasn't found. - AC_MSG_ERROR([Specifying the capture type as "dag" requires the DAG API to be present; use the --with-dag options to specify the location. (Try "./configure --help" for more information.)]) - fi + if test "$V_PCAP" = dag; then + # User requested "dag" capture type but the DAG API wasn't + # found. + AC_MSG_ERROR([Specifying the capture type as "dag" requires the DAG API to be present; use the --with-dag options to specify the location. (Try "./configure --help" for more information.)]) + fi +fi + +AC_ARG_WITH(septel, [ --with-septel[[=DIR]] include Septel support (located in directory DIR, if supplied). [default=yes, on Linux, if present]], +[ + if test "$withval" = no + then + want_septel=no + elif test "$withval" = yes + then + want_septel=yes + septel_root= + else + want_septel=yes + septel_root=$withval + fi +],[ + # + # Use Septel API if present, otherwise don't + # + want_septel=ifpresent + septel_root=./../septel +]) +ac_cv_lbl_septel_api=no +case "$V_PCAP" in +linux|septel) + # + # We support the Septel API if we're on Linux, or if we're building + # a Septel-only libpcap. + # + ;; +*) + # + # If the user explicitly requested Septel, tell them it's not + # supported. + # + # If they expressed no preference, don't include it. + # + if test $want_septel = yes; then + AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types) + elif test $want_septel = yes; then + want_septel=no + fi + ;; +esac + +if test "$with_septel" != no; then + AC_MSG_CHECKING(whether we have Septel API) + + if test -z "$septel_root"; then + septel_root=$srcdir/../septel + + fi + + septel_tools_dir="$septel_root" + septel_include_dir="$septel_root/INC" + DEF="-DHAVE_SEPTEL_API" + + ac_cv_lbl_septel_api=no + if test -r "$septel_include_dir/msg.h"; then + V_INCLS="$V_INCLS -I$septel_include_dir" + V_DEFS="$V_DEFS $DEF" + V_LIBS="$V_LIBS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o " + + if test "$V_PCAP" != septel ; then + SSRC="pcap-septel.c" + + fi + ac_cv_lbl_septel_api=yes + fi + + AC_MSG_RESULT($ac_cv_lbl_septel_api) + if test $ac_cv_lbl_septel_api = no; then + if test "$want_septel" = yes; then + AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel) + fi + else + AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API]) + fi +fi + +if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then + AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR) fi @@ -617,7 +717,7 @@ hpux*) dnl XXX - DYEXT should be set to "sl" if this is building dnl for 32-bit PA-RISC, but should be left as "so" for dnl 64-bit PA-RISC or, I suspect, IA-64. - AC_DEFINE(HAVE_HPUX10_20,1,[on HP-UX 10.20]) + AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later]) ;; sinix*) |