summaryrefslogtreecommitdiffstats
path: root/include/gmputil.h
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2015-01-08 07:54:34 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-01-08 12:23:13 +0100
commitb3529cf43bba5c3c4cddefa7f5d0143d510fd3ec (patch)
tree20bb09a946f083601714a3fa38aab99c1f5fdbb7 /include/gmputil.h
parentc434c709e0a8e0ca2aa92ad139b61025173ae033 (diff)
build: add --with-mini-gmp switch to disable linking libgmp
This allows to disable linking the >400 KB big libgmp and replace it with the builtin mini-gmp which only increases size by ~30KB. Enabling this selectively decreases debugging verbosity (pr_debug). Signed-off-by: Steven Barth <cyrus@openwrt.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/gmputil.h')
-rw-r--r--include/gmputil.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gmputil.h b/include/gmputil.h
index 63eb0ba9..1bf696a5 100644
--- a/include/gmputil.h
+++ b/include/gmputil.h
@@ -1,7 +1,17 @@
#ifndef NFTABLES_GMPUTIL_H
#define NFTABLES_GMPUTIL_H
+#include <config.h>
+
+#ifdef HAVE_LIBGMP
#include <gmp.h>
+#else
+#include <mini-gmp.h>
+/* mini-gmp doesn't come with gmp_printf, so we use our own minimal variant */
+extern int mpz_printf(const char *format, const mpz_t value);
+#define gmp_printf mpz_printf
+#endif
+
#include <asm/byteorder.h>
enum mpz_word_order {