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
|
# configure.in borrowed from nmap-2.3BETA6 by fyodor@dhp.com
AC_SUBST(VERSION)
VERSION=`pwd | sed 's/.*-//'`
if test -d /usr/local/lib; then
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
if test -d /usr/local/include; then
CFLAGS="$CLFAGS -I/usr/local/include"
fi
dnl Process this file with autoconf to produce a configure script.
AC_INIT(tcpblast.c)
dnl use config.h instad of -D macros
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall "
fi
AC_SUBST(COMPAT_OBJS)
AC_SUBST(COMPAT_SRCS)
dnl Host specific hacks
AC_CANONICAL_HOST
linux=no
case "$host" in
*-netbsd*)
AC_DEFINE(NETBSD)
;;
*-openbsd*)
AC_DEFINE(OPENBSD)
;;
*-sgi-irix5*)
AC_DEFINE(IRIX)
no_libsocket=yes
no_libnsl=yes
if test -z "$GCC"; then
sgi_cc=yes
fi
;;
*-sgi-irix6*)
AC_DEFINE(IRIX)
no_libsocket=yes
no_libnsl=yes
if test -z "$GCC"; then
sgi_cc=yes
fi
;;
*-solaris2.0*)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris2.1*)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris2.2*)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris2.3*)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris2.4*)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris2.5.1)
AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
AC_DEFINE(SOLARIS)
;;
*-solaris*)
AC_DEFINE(SOLARIS)
;;
*-sunos4*)
AC_DEFINE(SUNOS)
AC_DEFINE(SPRINTF_RETURNS_STRING)
no_libnsl=yes
no_libsocket=yes
;;
*-linux*)
linux=yes
AC_DEFINE(LINUX)
AC_DEFINE(PCAP_TIMEOUT_IGNORED) # libpcap doesn't even LOOK at
# the timeout you give it under Linux
;;
*-freebsd*)
AC_DEFINE(FREEBSD)
;;
*-bsdi*)
AC_DEFINE(BSDI)
;;
esac
dnl Checks for libraries.
dnl AC_CHECK_LIB(m, pow)
if test -z "$no_libnsl"; then
AC_CHECK_LIB(nsl, inet_ntoa)
fi
if test -z "$no_libsocket"; then
AC_CHECK_LIB(socket, socket)
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h getopt.h strings.h memory.h sys/param.h sys/sockio.h sys/time.h )
AC_HEADER_TIME
dnl AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl socklen_t
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>], [socklen_t len; len = 1;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKLEN_T)], [AC_MSG_RESULT(no)])
dnl in6_addr
AC_MSG_CHECKING(for in6_addr)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netinet/in.h>], [struct in6_addr addr;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_IN6_ADDR)], [AC_MSG_RESULT(no)])
dnl AC_HEADER_TIME
AC_SUBST(CFLAGS)
AC_C_BIGENDIAN
dnl Checks for library functions.
AC_CHECK_FUNCS(bzero getaddrinfo inet_pton strerror)
AC_MSG_CHECKING(for timersub)
AC_TRY_COMPILE([#include <sys/time.h>], [#ifndef timersub
error
#endif],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMERSUB)], [AC_MSG_RESULT(no)])
AC_CHECK_FUNC(getopt_long, ,
[ COMPAT_SRCS="$COMPAT_SRCS getopt.c getopt1.c"
COMPAT_OBJS="$COMPAT_OBJS getopt.o getopt1.o" ])
AC_REPLACE_FUNCS(strsep daemon)
AC_OUTPUT(Makefile docs/tcpblast.spec)
|