mirror of
https://git.netfilter.org/nftables
synced 2026-01-26 10:34:27 +00:00
1) This removes former Makefiles and install-sh (which is now
automagically imported via autoreconf).
Makefile.defs.in
Makefile.in
Makefile.rules.in
src/Makefile.in
install-sh (now automagically imported via autoreconf).
2) CFLAGS are left almost same, they are integrated into Make_global.am.
Use AM_CPPFLAGS to set the CFLAGS set by pkgconfig.
3) Add m4 directory to the tree which only contains the .gitignore
file. Update .gitignore file to skip autogenerated files.
4) include <config.h> whenever required.
5) Minor adjustments to scanner.l and parser_bison.y to compile cleanly
with autotools.
6) Add %option outfile=lex.yy.c to scanner.l, otherwise I hit this error
here:
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -DDEFAULT_INCLUDE_PATH="\"/usr/etc\"" -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wsign-compare -Winit-self -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute -Wcast-align -Wundef -Wbad-function-cast -g -O2 -MT mnl.o -MD -MP -MF $depbase.Tpo -c -o mnl.o mnl.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/sh ../build-aux/ylwrap scanner.l lex.yy.c scanner.c -- flex
make[3]: *** [scanner.c] Error 1
make[3]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables'
make: *** [all] Error 2
7) Add Makefile.am for include/ (contributed by Giorgio Dal Molin).
The doc/ and files/ conversion to automake will come in follow up
patches but 'make distcheck' already works.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
134 lines
3.4 KiB
Plaintext
134 lines
3.4 KiB
Plaintext
# -*- Autoconf -*-
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ(2.61)
|
|
|
|
AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy <kaber@trash.net>])
|
|
AC_INIT([nftables], [0.3], [netfilter-devel@vger.kernel.org])
|
|
AC_DEFINE([RELEASE_NAME], ["Support Edward Snowden"], [Release name])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
AC_CANONICAL_HOST
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
|
|
tar-pax no-dist-gzip dist-bzip2 1.6])
|
|
|
|
dnl kernel style compile messages
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
AC_CONFIG_SRCDIR([src/rule.c])
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
AC_DEFINE([_GNU_SOURCE], [], [Enable various GNU extensions])
|
|
AC_DEFINE([_STDC_FORMAT_MACROS], [], [printf-style format macros])
|
|
|
|
AC_ARG_ENABLE([debug],
|
|
AS_HELP_STRING([--enable-debug], [Enable debugging]),
|
|
[CONFIG_DEBUG="$(echo $enableval | cut -b1)"],
|
|
[CONFIG_DEBUG="y"])
|
|
AC_SUBST([CONFIG_DEBUG])
|
|
|
|
# Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_MKDIR_P
|
|
AC_PROG_INSTALL
|
|
AC_PROG_SED
|
|
AM_PROG_LEX
|
|
AC_PROG_YACC
|
|
|
|
if test -z "$ac_cv_prog_YACC"
|
|
then
|
|
echo "*** Error: No suitable bison/yacc found. ***"
|
|
echo " Please install the 'bison' package."
|
|
exit 1
|
|
fi
|
|
if test -z "$ac_cv_prog_LEX"
|
|
then
|
|
echo "*** Error: No suitable flex/lex found. ***"
|
|
echo " Please install the 'flex' package."
|
|
exit 1
|
|
fi
|
|
|
|
AC_CHECK_PROG(CONFIG_MAN1, [docbook2x-man], [y], [n])
|
|
if test "$CONFIG_MAN1" == "y"
|
|
then
|
|
CONFIG_MAN=y
|
|
DB2MAN=docbook2x-man
|
|
else
|
|
AC_CHECK_PROG(CONFIG_MAN2, [db2x_docbook2man], [y], [n])
|
|
if test "$CONFIG_MAN2" == "y"
|
|
then
|
|
CONFIG_MAN=y
|
|
DB2MAN=db2x_docbook2man
|
|
else
|
|
AC_MSG_WARN([docbookx2-man/db2x_docbook2man not found, no manpages will be built])
|
|
fi
|
|
fi
|
|
AC_SUBST(CONFIG_MAN)
|
|
AC_SUBST(DB2MAN)
|
|
|
|
AC_CHECK_PROG(CONFIG_PDF, dblatex, y, n)
|
|
if test "$CONFIG_PDF" != "y"
|
|
then
|
|
AC_MSG_WARN([dblatex not found, no PDF manpages will be built])
|
|
fi
|
|
|
|
# Checks for libraries.
|
|
PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
|
|
PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.2])
|
|
|
|
AC_CHECK_LIB([gmp], [__gmpz_init], ,
|
|
AC_MSG_ERROR([No suitable version of libgmp found]))
|
|
|
|
AC_ARG_WITH([cli], [AS_HELP_STRING([--without-cli],
|
|
[disable interactive CLI (libreadline support)])],
|
|
[], [with_cli=yes])
|
|
AS_IF([test "x$with_cli" != xno], [
|
|
AC_CHECK_LIB([readline], [readline], ,
|
|
AC_MSG_ERROR([No suitable version of libreadline found]))
|
|
AC_DEFINE([HAVE_LIBREADLINE], [1], [])
|
|
])
|
|
AC_SUBST(with_cli)
|
|
AM_CONDITIONAL([BUILD_CLI], [test "x$with_cli" != xno])
|
|
|
|
# Checks for header files.
|
|
AC_HEADER_STDC
|
|
AC_HEADER_ASSERT
|
|
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h \
|
|
netdb.h netinet/in.h netinet/ip.h netinet/ip6.h \
|
|
netinet/tcp.h netinet/udp.h netinet/ip_icmp.h \
|
|
stddef.h stdint.h stdlib.h string.h unistd.h], ,
|
|
AC_MSG_ERROR([Header file not found]))
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
AC_HEADER_STDBOOL
|
|
AC_C_CONST
|
|
AC_C_INLINE
|
|
AC_TYPE_OFF_T
|
|
AC_TYPE_SIZE_T
|
|
AC_TYPE_UID_T
|
|
AC_TYPE_INT8_T
|
|
AC_TYPE_INT16_T
|
|
AC_TYPE_INT32_T
|
|
AC_TYPE_INT64_T
|
|
AC_TYPE_UINT8_T
|
|
AC_TYPE_UINT16_T
|
|
AC_TYPE_UINT32_T
|
|
AC_TYPE_UINT64_T
|
|
|
|
# Checks for library functions.
|
|
AC_CHECK_FUNCS([memmove memset strchr strdup strerror strtoull])
|
|
|
|
AC_CONFIG_FILES([ \
|
|
Makefile \
|
|
src/Makefile \
|
|
include/Makefile \
|
|
include/linux/Makefile \
|
|
include/linux/netfilter/Makefile \
|
|
])
|
|
AC_OUTPUT
|
|
|
|
echo "
|
|
nft configuration:
|
|
cli support: ${with_cli}"
|