📄 configure.in
字号:
# $Id: configure.in,v 1.54 2000/07/07 08:19:27 fyodor Exp $
AC_INIT(snort.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(snort,1.6.3-patch2)
AM_PROG_CC_STDC
AC_PROG_CC
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall "
fi
AC_CANONICAL_HOST
linux=no
sunos4=no
AC_C_BIGENDIAN
case "$host" in
*-openbsd*)
AC_DEFINE(OPENBSD)
;;
*-sgi-irix5*)
AC_DEFINE(IRIX)
no_libsocket=yes
no_libnsl=yes
if test -z "$GCC"; then
sgi_cc=yes
fi
LDFLAGS=${LDFLAGS} -L/usr/local/lib
extra_incl=-I/usr/local/include
;;
*-sgi-irix6*)
AC_DEFINE(IRIX)
no_libsocket=yes
no_libnsl=yes
if test -z "$GCC"; then
sgi_cc=yes
fi
LDFLAGS=${LDFLAGS} -L/usr/local/lib
extra_incl=-I/usr/local/include
;;
*-solaris*)
AC_DEFINE(SOLARIS)
;;
*-sunos*)
AC_DEFINE(SUNOS)
sunos4=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
;;
*-hpux10*)
AC_DEFINE(HPUX)
AC_DEFINE(WORDS_BIGENDIAN)
AC_SUBST(extra_incl)
extra_incl=-I/usr/local/include
;;
*-freebsd*)
AC_DEFINE(FREEBSD)
;;
*-bsdi*)
AC_DEFINE(BSDI)
;;
*-aix*)
AC_DEFINE(AIX)
broken_types=yes
;;
*-osf4*)
AC_DEFINE(OSF1)
tru64_types=yes
;;
*-tru64*)
AC_DEFINE(OSF1)
tru64_types=yes
;;
esac
# any sparc platform has to have this one defined.
if test "$host_cpu" = "sparc"; then
AC_DEFINE(WORDS_MUSTALIGN)
fi
dnl checking headers
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(paths.h)
dnl make sure we've got all our libraries
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
# SunOS4 has several things `broken'
if test "$sunos4" != "no"; then
AC_CHECK_FUNCS(vsnprintf,, LIBS=" $LIBS -ldb")
AC_CHECK_FUNCS(strtoul,, LIBS=" $LIBS -l44bsd")
fi
# some funky macro to be backwards compatible with earlier autoconfs
# in current they have AC_CHECK_DECLS
AC_DEFUN(SN_CHECK_DECL,[
AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(sn_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <syslog.h>
],
[char *(*pfn) = (char *(*)) $1],
eval "sn_cv_decl_needed_$1=no",eval "sn_cv_decl_needed_$1=yes") ])
if eval "test \"`echo '$sn_cv_decl_needed_'$1`\" != no"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
ifelse([$3], , ,[$3])
fi
])dnl
AC_DEFUN(SN_CHECK_DECLS,
[for sn_decl in $1
do
sn_def_decl=`echo $sn_decl | tr [a-z] [A-Z]`
SN_CHECK_DECL($sn_decl,
[
AC_DEFINE_UNQUOTED(NEED_DECL_$sn_def_decl, 1,
[you have this cuz autoheader is dumb])
$2], $3)dnl
done
])
# some stuff for declarations which were missed on sunos4 platform too.
#
# add `#undef NEED_DECL_FUNCTIONAME to acconfig.h` because autoheader
# fails to work properly with custom macroses.
# you will see also #undef for each SN_CHECK_DECLS macros invocation
# because autoheader doesn't execute shell script commands.
# it is possible to make loops using m4 but the code would look even
# more confusing..
SN_CHECK_DECLS(printf fprintf syslog puts fputs fputc fopen \
fclose fwrite fflush getopt bzero bcopy memset strtol \
strcasecmp strncasecmp strerror perror socket sendto \
vsnprintf strtoul)
AC_ARG_WITH(libpcap_includes,
[ --with-libpcap-includes=DIR libcap include directory],
[with_libpcap_includes="$withval"],[with_libpcap_includes=no])
AC_ARG_WITH(libpcap_libraries,
[ --with-libpcap-libraries=DIR libcap library directory],
[with_libpcap_libraries="$withval"],[with_libpcap_libraries=no])
# Search for pcap.h using any info provided, plus a list of "standard"
# directories where we might find it. People with it installed in
# multiple places (eg, different versions) will always complain about
# the ordering of the paths, but how do we know what to use? They
# can always use --with-libpcap-includes, anyway...
AC_PATH_PROG(PCAP_H, pcap.h, [no], "$with_libpcap_includes:$prefix/include:$prefix/include/pcap:/usr/include:/usr/include/pcap:/usr/local/include:/usr/local/include/pcap")
if test "$PCAP_H" = "no"; then
echo
echo " ERROR! Libpcap header not found, go get it from"
echo " ftp://ftp.ee.lbl.gov/libpcap.tar.Z"
echo " or use the --with-libpcap-* options."
echo " See the INSTALL file for more information."
echo
exit
else
PCAP_H=`echo $PCAP_H | sed 's/\/pcap\.h//'`
if test "${PCAP_H}" != "/usr/include"; then
CPPFLAGS="${CPPFLAGS} -I${PCAP_H}"
fi
fi
AC_PATH_PROG(PCAP_LIB, libpcap.a, [no], "$with_libpcap_libraries:$prefix/lib:$prefix/lib/pcap:/usr/lib:/usr/lib/pcap:/usr/local/lib:/usr/local/lib/pcap")
if test "$PCAP_LIB" = "no"; then
echo
echo " ERROR! Libpcap libraries not found, go get it from"
echo " ftp://ftp.ee.lbl.gov/libpcap.tar.Z"
echo " or use the --with-libpcap-* options."
echo " See the INSTALL file for more information."
echo
exit
else
PCAP_LIB=`echo $PCAP_LIB | sed 's/\/libpcap\.a//'`
LDFLAGS="${LDFLAGS} -L${PCAP_LIB}"
fi
LPCAP=""
AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
if test "$LPCAP" = "no"; then
echo
echo " ERROR! Libpcap library not found, go get it from"
echo " ftp://ftp.ee.lbl.gov/libpcap.tar.Z"
echo " or use the --with-libpcap-* options."
echo " See the INSTALL file for more information."
echo
exit
fi
INCVAL="/usr/include/mysql"
LIBVAL="/usr/lib/mysql"
AC_ARG_WITH(mysql_includes,
[ --with-mysql-includes=DIR mysql include directory],
[INCVAL="$withval"])
AC_CHECK_HEADER($INCVAL/mysql.h, MYINC=yes, MYINC=no)
if test "$MYINC" = "yes"; then
AC_ARG_WITH(mysql_libraries,
[ --with-mysql-libraries=DIR mysql library directory],
[LIBVAL="$withval"])
LDFLAGS="${LDFLAGS} -L${LIBVAL}"
AC_CHECK_LIB(mysqlclient, mysql_init, , MYLIB=no)
if test "$MYLIB" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${INCVAL} -DENABLE_MYSQL"
else
if test "$LIBVAL" != "/usr/lib/mysql"; then
AC_MSG_ERROR("MySQL library \(mysqlclient\) not found in $LIBVAL")
fi
fi
else
if test "$INCVAL" != "/usr/include/mysql"; then
AC_MSG_ERROR("MySQL header file \(mysql\.h\) was not found in $INCVAL")
fi
fi
INCVAL="/usr/local/include"
LIBVAL="/usr/local/lib"
AC_ARG_WITH(unixodbc_includes,
[ --with-unixodbc-includes=DIR unixodbc include directory],
[INCVAL="$withval"])
AC_CHECK_HEADER($INCVAL/sql.h, ODINC=yes, ODINC=no)
if test "$ODINC" = "yes"; then
AC_CHECK_HEADER($INCVAL/sqlext.h, ODINC=yes, ODINC=no)
if test "$ODINC" = "yes"; then
AC_CHECK_HEADER($INCVAL/sqltypes.h, ODINC=yes, ODINC=no)
if test "$ODINC" = "yes"; then
AC_ARG_WITH(unixodbc_libraries,
[ --with-unixodbc-libraries=DIR unixodbc library directory],
[LIBVAL="$withval"])
LDFLAGS="${LDFLAGS} -L${LIBVAL}"
AC_CHECK_LIB(odbc, SQLConnect, , ODLIB=no)
if test "$ODLIB" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${INCVAL} -DENABLE_UNIXODBC"
else
if test "$LIBVAL" != "/usr/local/lib"; then
AC_MSG_ERROR("unixodbc library \(odbc\) not found in $LIBVAL")
fi
fi
else
if test "$INCVAL" != "/usr/local/include"; then
AC_MSG_ERROR("unixodbc header file \(sqltypes.h\) was not found in $INCVAL")
fi
fi
else
if test "$INCVAL" != "/usr/local/include"; then
AC_MSG_ERROR("unixodbc header file \(sqlext.h\) was not found in $INCVAL")
fi
fi
else
if test "$INCVAL" != "/usr/local/include"; then
AC_MSG_ERROR("unixodbc header file \(sql.h\) was not found in $INCVAL")
fi
fi
INCVAL="/usr/include/pgsql"
LIBVAL="/usr/lib"
AC_ARG_WITH(libpq_includes,
[ --with-libpq-includes=DIR libpq include directory],
[INCVAL="$withval"])
AC_CHECK_HEADER($INCVAL/libpq-fe.h, PGINC=yes, PGINC=no)
if test "$PGINC" = "yes"; then
AC_ARG_WITH(libpq_libraries,
[ --with-libpq-libraries=DIR libpq library directory],
[LIBVAL="$withval"])
LDFLAGS="${LDFLAGS} -L${LIBVAL}"
AC_CHECK_LIB(pq, PQconnectdb, , PGLIB=no)
if test "$PGLIB" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${INCVAL} -DENABLE_POSTGRESQL"
else
if test "$LIBVAL" != "/usr/include/pgsql"; then
AC_MSG_ERROR("postgresql library \(pq\) not found in $LIBVAL")
fi
fi
else
if test "$INCVAL" != "/usr/include/pgsql"; then
AC_MSG_ERROR("postgresql include \(libpq-fe.h\) not found in $INCVAL")
fi
fi
AC_ARG_ENABLE(smbalerts,
[ --enable-smbalerts SMB alerting capaility via Samba],
CFLAGS="$CFLAGS -DENABLE_SMB_ALERTS",)
AC_ARG_ENABLE(flexresp,
[ --enable-flexresp Flexible Responses on hostile connection attempts],
[ CFLAGS="$CFLAGS -DENABLE_RESPONSE `libnet-config --defines`"
LIBS="$LIBS `libnet-config --libs`"],)
AC_ARG_ENABLE(pthreads,
[ --enable-pthreads Multiple interfaces support using pthreads ],
[ CFLAGS="$CFLAGS -pthread -DUSE_PTHREADS"
],)
if test "$tru64_types" = "yes"; then
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int32_t, unsigned int)
else
if test "$broken_types" = "yes"; then
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CHECK_TYPE(u_int16_t, unsigned short int)
AC_CHECK_TYPE(u_int32_t, unsigned long int)
else
AC_CHECK_TYPE(u_int8_t, uint8_t)
AC_CHECK_TYPE(u_int16_t, uint16_t)
AC_CHECK_TYPE(u_int32_t, uint32_t)
fi
fi
AC_PROG_INSTALL
AC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -