From: Steven Barth Date: Sun, 14 Dec 2014 16:03:45 +0000 (+0000) Subject: nftables: bump to latest git, fix mini-gmp patches X-Git-Tag: reboot~4935 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c927daaf760c4b11db799dd33f75b813c9a8657e;p=openwrt%2Fopenwrt.git nftables: bump to latest git, fix mini-gmp patches Signed-off-by: Steven Barth SVN-Revision: 43707 --- diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 4f25ee91e7..54b209dce0 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.3+2014-10-21 +PKG_VERSION:=0.3+2014-12-11 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=git://git.netfilter.org/nftables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=17b495957b29e699f59874d1ceca9535921b1a79 +PKG_SOURCE_VERSION:=81cffc1ee5098809167085bc997297a61d7476bd PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 @@ -27,6 +27,8 @@ CONFIGURE_ARGS += \ --without-libgmp \ --without-cli \ +TARGET_CFLAGS += -D_GNU_SOURCE + define Package/nftables SECTION:=net CATEGORY:=Network diff --git a/package/network/utils/nftables/patches/102-build-allow-building-with-mini-gmp-instead-of-gmp.patch b/package/network/utils/nftables/patches/102-build-allow-building-with-mini-gmp-instead-of-gmp.patch index 211d32d48a..7894779ee7 100644 --- a/package/network/utils/nftables/patches/102-build-allow-building-with-mini-gmp-instead-of-gmp.patch +++ b/package/network/utils/nftables/patches/102-build-allow-building-with-mini-gmp-instead-of-gmp.patch @@ -33,9 +33,9 @@ Signed-off-by: Steven Barth --- a/configure.ac +++ b/configure.ac -@@ -68,8 +68,18 @@ AC_CHECK_LIB([mnl], [mnl_socket_open], , - AC_CHECK_LIB([nftnl], [nft_rule_alloc], , - AC_MSG_ERROR([No suitable version of libnftnl found])) +@@ -72,8 +72,19 @@ AM_CONDITIONAL([BUILD_PDF], [test "$DBLA + 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])) @@ -44,8 +44,9 @@ Signed-off-by: Steven Barth + [with_libgmp=yes]) +AS_IF([test "x$with_libgmp" != xno], [ +AC_CHECK_LIB([gmp],[__gmpz_init], , AC_MSG_ERROR([No suitable version of libgmp found])) ++AC_DEFINE([HAVE_LIBGMP], [1], []) +]) -+AC_SUBST(with_libgmp) ++AM_CONDITIONAL([BUILD_MINIGMP], [test "x$with_libgmp" == xno]) + + +AS_IF([test "x$with_libgmp" != xyes -a "x$CONFIG_DEBUG" = xy], [ @@ -412,20 +413,9 @@ Signed-off-by: Steven Barth #endif #define __fmtstring(x, y) __attribute__((format(printf, x, y))) ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -31,3 +31,8 @@ nft-extra-clean-files += parser.c parser - - nft-obj += scanner.o - nft-extra-clean-files += scanner.c scanner.h -+ -+ifneq (@with_libgmp@,yes) -+nft-obj += mini-gmp.o -+nft-obj += mini-gmp-printf.o -+endif --- a/src/datatype.c +++ b/src/datatype.c -@@ -267,11 +267,9 @@ static struct error_record *integer_type +@@ -275,11 +275,9 @@ static struct error_record *integer_type struct expr **res) { mpz_t v; @@ -436,11 +426,11 @@ Signed-off-by: Steven Barth - (int)strlen(sym->identifier) != len) { + if (mpz_set_str(v, sym->identifier, 0)) { mpz_clear(v); - if (sym->dtype != &integer_type) - return NULL; + return error(&sym->location, "Could not parse %s", + sym->dtype->desc); --- a/src/erec.c +++ b/src/erec.c -@@ -43,6 +43,7 @@ static void erec_destroy(struct error_re +@@ -44,6 +44,7 @@ static void erec_destroy(struct error_re xfree(erec); } @@ -448,7 +438,7 @@ Signed-off-by: Steven Barth struct error_record *erec_vcreate(enum error_record_types type, const struct location *loc, const char *fmt, va_list ap) -@@ -54,10 +55,11 @@ struct error_record *erec_vcreate(enum e +@@ -55,10 +56,11 @@ struct error_record *erec_vcreate(enum e erec->num_locations = 0; erec_add_location(erec, loc); @@ -4944,3 +4934,14 @@ Signed-off-by: Steven Barth + + return r; +} +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -48,4 +48,8 @@ if BUILD_CLI + nft_SOURCES += cli.c + endif + ++if BUILD_MINIGMP ++nft_SOURCES += mini-gmp.c mini-gmp-printf.c ++endif ++ + nft_LDADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} diff --git a/package/network/utils/nftables/patches/103-enforce-disabling-debugging.patch b/package/network/utils/nftables/patches/103-enforce-disabling-debugging.patch new file mode 100644 index 0000000000..25f6df6d46 --- /dev/null +++ b/package/network/utils/nftables/patches/103-enforce-disabling-debugging.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -3,7 +3,7 @@ sbin_PROGRAMS = nft + CLEANFILES = scanner.c parser_bison.c + + AM_CPPFLAGS = -I$(top_srcdir)/include +-AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -DDEBUG \ ++AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" \ + ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS} + + AM_CFLAGS = -Wall \ diff --git a/package/network/utils/nftables/patches/104-fix-CFLAGS-handling.patch b/package/network/utils/nftables/patches/104-fix-CFLAGS-handling.patch deleted file mode 100644 index 4a85df29af..0000000000 --- a/package/network/utils/nftables/patches/104-fix-CFLAGS-handling.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/Makefile.defs.in -+++ b/Makefile.defs.in -@@ -24,6 +24,7 @@ LDFLAGS += @LIBS@ - - CPPFLAGS += @CPPFLAGS@ - -+CFLAGS := - CFLAGS += @CFLAGS@ @DEFS@ - CFLAGS += -DDEFAULT_INCLUDE_PATH="\"$(confdir)\"" - CFLAGS += -include config.h