summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-03-09 13:40:39 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-03-09 13:50:28 +0100
commitac946390530caea325111c10c2e437ecd5f3cd77 (patch)
tree9dc3100805abbfcd76032dbd3026746ec4cd95eb
parenteefcdd8815f9629409f006a76a5710f479eca341 (diff)
downloadgnutls-ac946390530caea325111c10c2e437ecd5f3cd77.tar.gz
Added option to enable linking with nettle-mini
-rw-r--r--configure.ac5
-rw-r--r--lib/nettle/mpi.c3
-rw-r--r--m4/hooks.m414
3 files changed, 16 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 4fc54a7b18..7698a349e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -769,6 +769,9 @@ AC_MSG_NOTICE([summary of build options:
Compiler: ${CC}
CFlags: ${CFLAGS}
Library types: Shared=${enable_shared}, Static=${enable_static}
+ Local libopts: ${enable_local_libopts}
+ Local libtasn1: ${included_libtasn1}
+ Use nettle-mini: ${mini_nettle}
])
AC_MSG_NOTICE([External hardware support:
@@ -803,8 +806,6 @@ if features are disabled)
AC_MSG_NOTICE([Optional applications:
crywrap app: $libidn
- local libopts: ${enable_local_libopts}
- local libtasn1: ${included_libtasn1}
])
AC_MSG_NOTICE([Optional libraries:
diff --git a/lib/nettle/mpi.c b/lib/nettle/mpi.c
index 54ec77bcf7..ced6ef288f 100644
--- a/lib/nettle/mpi.c
+++ b/lib/nettle/mpi.c
@@ -28,8 +28,7 @@
#include <algorithms.h>
#include <gnutls_num.h>
#include <gnutls_mpi.h>
-#include <gmp.h>
-#include <nettle/bignum.h>
+#include <nettle/bignum.h> /* includes gmp.h */
#include <gnettle.h>
#include <random.h>
diff --git a/m4/hooks.m4 b/m4/hooks.m4
index ab0a3d05ea..f669d938f2 100644
--- a/m4/hooks.m4
+++ b/m4/hooks.m4
@@ -82,13 +82,23 @@ AC_MSG_ERROR([[
GNUTLS_REQUIRES_PRIVATE="Requires.private: nettle, hogweed"
+ AC_ARG_WITH(nettle-mini,
+ AS_HELP_STRING([--with-nettle-mini], [Link against a mini-nettle (that includes mini-gmp)]),
+ mini_nettle=$withval,
+ mini_nettle=no)
+
AC_ARG_VAR(GMP_CFLAGS, [C compiler flags for gmp])
AC_ARG_VAR(GMP_LIBS, [linker flags for gmp])
- if test x$GMP_LIBS = x; then
- AC_CHECK_LIB(gmp, __gmpz_cmp, [GMP_LIBS="-lgmp"], [AC_MSG_ERROR([[
+ if test "$mini_nettle" != no;then
+ GMP_CLFLAGS=""
+ GMP_LIBS=""
+ else
+ if test x$GMP_LIBS = x; then
+ AC_CHECK_LIB(gmp, __gmpz_cmp, [GMP_LIBS="-lgmp"], [AC_MSG_ERROR([[
***
*** gmp was not found.
]])])
+ fi
fi
AC_SUBST(GMP_CFLAGS)
AC_SUBST(GMP_LIBS)