--- 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]))
+ [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], [
#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;
- (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);
}
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);
+
+ 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}