1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in 1082 2005-02-12 19:40:04Z bmah $
dnl based on:
dnl $ID: configure.in,v 1.10 1996/10/27 01:35:36 bmah Exp $
AC_REVISION($Revision: 1082 $)
AC_INIT(pc.h)
AC_LANG_CPLUSPLUS
AC_ARG_PROGRAM
AC_CANONICAL_HOST
AC_ARG_WITH(ipv6, [ --with-ipv6 always enable IPv6 support])
AC_ARG_WITH(pcap, [ --with-pcap use pcap library])
AC_ARG_WITH(snmp, [ --with-snmp use UCD SNMP library])
AC_ARG_WITH(suid, [ --with-suid install SUID root])
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_MSG_CHECKING(for pchar version number)
PC_VERSION=`cat ${srcdir}/VERSION`
AC_SUBST(PC_VERSION)
AC_MSG_RESULT("$PC_VERSION")
dnl Check echo functionality
AC_MSG_CHECKING(echo functionality)
if test "`echo "\\n"`" = '\n'; then
echoqnl='echo "\"\\n\""'
AC_MSG_RESULT "BSD-style"
else
echoqnl='echo "\"\\\n\""'
AC_MSG_RESULT "SysV-style"
fi
AC_SUBST(echoqnl)
dnl Check for a bool type.
AC_CHECK_SIZEOF(bool)
dnl Check for a socklen_t type.
AC_CACHE_CHECK(for socklen_t, pchar_cv_socklen_t,
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>],
[{ socklen_t foo; }],
[pchar_cv_socklen_t=yes],
[pchar_cv_socklen_t=no])
)
if test "$pchar_cv_socklen_t" = "yes"; then
AC_DEFINE(HAVE_SOCKLEN_T)
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(strings.h)
AC_LBL_SOCKADDR_SA_LEN
AC_LBL_LIBRARY_NET
dnl Checks for library functions.
AC_CHECK_FUNCS(herror)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_LIB(m, log)
dnl Subsets of object files that we need to link together.
dnl These are defined in the Makefile. We always need ${OBJ_BASE}.
obj_subsets='${OBJ_BASE}'
dnl IPv6 support if desired. If the user enabled --with-ipv6,
dnl then force IPv6 support on. If the user set --without-ipv6,
dnl then force IPv6 support off. Otherwise, test for a definition
dnl of struct in6_addr and use that to figure out if we have IPv6 on
dnl this system. An argument to --with-ipv6
dnl is taken as the base directory to where any IPv6 support libraries
dnl live (e.g. with libraries in /usr/local/v6/lib, pchar should
dnl be configured --with-ipv6=/usr/local/v6 to find its libraries).
dnl Specification of a library is not needed with systems that have
dnl IPv6 support built-in, for example, in libc.
AC_CACHE_CHECK(for IPv6 support, pchar_cv_sys_ipv6,
if test "$with_ipv6" ; then
if test "$with_ipv6" != "no" ; then
pchar_cv_sys_ipv6=yes
else
pchar_cv_sys_ipv6=no
fi
else
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[{ struct in6_addr foo; }],
[pchar_cv_sys_ipv6=yes],
[pchar_cv_sys_ipv6=no])
fi)
if test "$pchar_cv_sys_ipv6" = "yes" ; then
AC_DEFINE(HAVE_IPV6)
obj_subsets="$obj_subsets \${OBJ_IPV6}"
if test "$with_ipv6" -a "$with_ipv6" != "yes" ; then
LDFLAGS="-L$with_ipv6/lib $LDFLAGS"
fi
AC_CHECK_LIB(inet6, inet_pton)
fi
dnl UCD SNMP support if desired. If the user enabled --with-snmp,
dnl then modify the include path and library definitions as needed.
dnl If the user gave an argument to --with-snmp, use that as the
dnl base directory for support libraries and header files.
AC_CACHE_CHECK(for UCD SNMP support, pchar_cv_sys_snmp,
pchar_cv_sys_snmp=no
if test "$with_snmp" ; then
if test "$with_snmp" != "no" ; then
pchar_cv_sys_snmp=yes
else
pchar_cv_sys_snmp=no
fi
fi)
if test "$pchar_cv_sys_snmp" = "yes" ; then
AC_DEFINE(HAVE_SNMP)
obj_subsets="$obj_subsets \${OBJ_SNMP}"
if test "$with_snmp" -a "$with_snmp" != "yes" ; then
LDFLAGS="-L$with_snmp/lib $LDFLAGS"
CPPFLAGS="-I$with_snmp/include $CPPFLAGS"
fi
AC_CHECK_LIB(crypto, des_cbc_encrypt)
AC_CHECK_LIB(snmp, snmp_sess_init,,,-lcrypto)
fi
dnl pcap support if desired. If the user enabled --with-pcap,
dnl the modify the include path and library definitions as needed.
dnl (Basically, do what we do for UCD SNMP support.)
AC_CACHE_CHECK(for LBL pcap support, pchar_cv_sys_pcap,
pchar_cv_sys_pcap=no
if test "$with_pcap" ; then
if test "$with_pcap" != "no" ; then
pchar_cv_sys_pcap=yes
else
pchar_cv_sys_pcap=no
fi
fi)
if test "$pchar_cv_sys_pcap" = "yes" ; then
AC_DEFINE(HAVE_PCAP)
obj_subsets="$obj_subsets"
if test "$with_pcap" -a "$with_pcap" != "yes" ; then
LDFLAGS="-L$with_pcap/lib $LDFLAGS"
CPPFLAGS="-I$with_pcap/include $CPPFLAGS"
fi
AC_CHECK_LIB(pcap, pcap_open_live)
fi
dnl If we are using pcap, check if we're running it over BPF
dnl The check using "test -r" followed by "test -c" comes from
dnl the pcap configure script.
if test "$pchar_cv_sys_pcap" = "yes" ; then
AC_CACHE_CHECK(for BPF support, pchar_cv_sys_bpf,
pchar_cvs_sys_bpf=no
if test -r /dev/bpf0 ; then
pchar_cv_sys_bpf=yes
else
if test -c /dev/bpf0 ; then
pchar_cv_sys_bpf=yes
else
pchar_cv_sys_bpf=no
fi
fi)
if test "$pchar_cv_sys_bpf" = "yes" ; then
AC_DEFINE(HAVE_BPF)
fi
fi
dnl Set object file list substitution
AC_SUBST(obj_subsets)
dnl Check for setuid root. If user specified this as an argument
dnl to configure, then turn on that part of the code and tweak our
dnl install program variable. Doing this is bad for the general case
dnl since anything installed with ${INSTALL_PROGRAM} will get
dnl installed SUID. Also make sure to strip the binary.
AC_MSG_CHECKING(for SUID root build)
if test "$with_suid" ; then
if test "$with_suid" = "yes" ; then
AC_DEFINE(WITH_SUID)
INSTALL_PROGRAM='${INSTALL} -m 4755 -s'
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
dnl OS-specific kludges
AC_MSG_CHECKING(for OS-specific requirements)
case $host in
*-solaris2*) AC_DEFINE(NEED_XOPEN)
case $host in
*-solaris2.5.1) AC_DEFINE(NEED_RANDOM_PROTO)
AC_MSG_RESULT(Solaris X/Open flags and random prototype) ;;
*) AC_MSG_RESULT(Solaris X/Open flags) ;;
esac
;;
*-irix* | *-osf*) AC_DEFINE(NEED_GETSOCKNAME_HACK)
AC_MSG_RESULT(getsockname(3) takes (int *)) ;;
*-bsdi4.1) AC_DEFINE(NEED_NRL_IPV6_HACK)
AC_MSG_RESULT(BSDI 4.1 uses NRL IPv6 stack) ;;
*) AC_MSG_RESULT(none);
esac
AC_OUTPUT(Makefile Makefile.depend)
|