dnl intro dnl AC_PREREQ(2.50) AC_INIT(libipt_SIGN.c) AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_RANLIB dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T dnl ######################################## dnl Checks for kernel includes KERNEL_inc_check="/usr/src/linux $HOME/linux $HOME/download/linux" AC_ARG_WITH(kernel, [ --with-kernel-source= directory path of kernel source], [KERNEL_inc_check="$withval/ $withval/../"]) AC_MSG_CHECKING([for kernel include directory]) KERNEL_incdir= for m in $KERNEL_inc_check; do if test -d "$m" && test -f "$m/include/linux/netfilter_ipv4/ip_tables.h" then KERNEL_incdir=$m/include break fi done case "$KERNEL_incdir" in /*) ;; .*) ;; * ) AC_MSG_ERROR([Didn't find kernel ip_tables.h header, use --with-kernel-source]) ;; esac AC_MSG_RESULT([$KERNEL_incdir]) AC_MSG_CHECKING([if kernel headers are of the right version]) KERNEL_DISK_VERSION=$(grep UTS_RELEASE $KERNEL_incdir/linux/version.h | cut -f3 -d" " | sed s/\"//g) if test $KERNEL_DISK_VERSION \!= $(uname -r) then AC_MSG_ERROR([No. Use --with-kernel-source]) fi AC_MSG_RESULT([yes - $KERNEL_DISK_VERSION==$(uname -r)]) CFLAGS="$CFLAGS -I$KERNEL_incdir" dnl #############################################3 dnl Check for iptables directory # ~/cvs/netfilter/userspace/include/ IPTABLES_dir_check="$HOME/cvs/netfilter/userspace/ $HOME/netfilter/userspace/ /usr/local/netfilter/" AC_ARG_WITH(iptables, [ --with-iptables-source= directory path of iptables source], [IPTABLES_dir_check="$withval/ $withval/../"]) AC_MSG_CHECKING([for iptables directory]) IPTABLES_dir= for m in $IPTABLES_dir_check; do if test -d "$m" && test -f "$m/include/iptables.h" then IPTABLES_dir=$m break fi done case "$IPTABLES_dir" in /*) ;; .*) ;; * ) AC_MSG_ERROR([Didn't find iptables iptables.h header, use --with-iptables-source]) ;; esac AC_MSG_RESULT([$IPTABLES_dir]) CFLAGS="$CFLAGS -I$IPTABLES_dir/include/" IPTABLES_lib_dir="" AC_ARG_WITH(iptables-modules, [ --with-iptables-modules= directory of iptables installed modules], [IPTABLES_lib_dir="$withval/"]) AC_MSG_CHECKING([for iptables module install directory]) if test "-z $IPTABLES_lib_dir" -a "-f $IPTABLES_dir/iptables" then IPTABLES_lib_dir=$(strings $IPTABLES_dir/iptables | grep libipt_%s.so | sed s/libipt_%s.so//) fi if test -z $IPTABLES_lib_dir then AC_MSG_ERROR([Could not find iptables binary, specify iptables modules install directory\nwith --with-iptables-modules]) fi AC_MSG_RESULT([$IPTABLES_lib_dir]) AC_MSG_CHECKING([netfilter version we are building against]) NETFILTER_VERSION=$($IPTABLES_dir/iptables --version | cut -f2 -dv) AC_MSG_RESULT([$NETFILTER_VERSION]) CFLAGS="$CFLAGS -DNETFILTER_VERSION=\\\"$NETFILTER_VERSION\\\"" libexecdir=$IPTABLES_lib_dir AC_OUTPUT(Makefile)