I noticed that trying to build nettle in systems without floating point
fails at the shadata, aesdata tools. The attached patch adds a flag
(disable-data-targets) to prevent them from being built.

regards,
Nikos
>From 508ee91f87a109a61abfcb02aa06db2cd89c18cf Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <[email protected]>
Date: Sun, 16 Dec 2012 16:46:26 +0100
Subject: [PATCH] Do not build the algorithm data generation if
 --disable-data-targets is given.

---
 Makefile.in  |    9 +++++----
 configure.ac |   14 ++++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index d6be465..bac4794 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,9 +29,10 @@ getopt_TARGETS = $(getopt_SOURCES:.c=.$(OBJEXT))
 internal_SOURCES = nettle-internal.c
 internal_TARGETS = $(internal_SOURCES:.c=.$(OBJEXT))
 
-TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) twofishdata$(EXEEXT) \
-	  shadata$(EXEEXT) gcmdata$(EXEEXT) \
-	  $(getopt_TARGETS) $(internal_TARGETS) \
+DATA_TARGETS = @IF_DATA_TARGETS@ aesdata$(EXEEXT) desdata$(EXEEXT) twofishdata$(EXEEXT) \
+	  shadata$(EXEEXT) gcmdata$(EXEEXT)
+
+TARGETS = $(getopt_TARGETS) $(internal_TARGETS) \
 	  $(LIBTARGETS) $(SHLIBTARGETS)
 IMPLICIT_TARGETS = @IF_DLL@ $(LIBNETTLE_FILE) $(LIBHOGWEED_FILE)
 
@@ -58,7 +59,7 @@ check-here:
 dvi installcheck uninstallcheck:
 	true
 
-all-here: $(TARGETS) $(DOCTARGETS)
+all-here: $(TARGETS) $(DOCTARGETS) $(DATA_TARGETS)
 
 nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
 		 aes-encrypt-internal.c aes-encrypt.c aes-encrypt-table.c \
diff --git a/configure.ac b/configure.ac
index 737febb..e232a58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -610,11 +610,24 @@ else
   IF_DOCUMENTATION='#'
 fi
 
+#whether to build data targets
+AC_ARG_ENABLE(data-targets,
+  AC_HELP_STRING([--disable-data-targets], [Omit generation of algorithm data (default=yes)]),
+  [enable_data_targets=$enableval],
+  [enable_data_targets=yes])
+
+if test "x$enable_data_targets" = "xyes" ; then
+  IF_DATA_TARGETS=''
+else
+  IF_DATA_TARGETS='#'
+fi
+
 AC_SUBST(IF_HOGWEED)
 AC_SUBST(IF_STATIC)
 AC_SUBST(IF_SHARED)
 AC_SUBST(IF_DOCUMENTATION)
 AC_SUBST(IF_DLL)
+AC_SUBST(IF_DATA_TARGETS)
 
 OPENSSL_LIBFLAGS=''
 
@@ -697,5 +710,6 @@ AC_MSG_NOTICE([summary of build options:
   Static libraries:  ${enable_static}
   Shared libraries:  ${enable_shared}
   Public key crypto: ${enable_public_key}
+  Data targets:      ${enable_data_targets}
   Documentation:     ${enable_documentation}
 ])
-- 
1.7.10.4

_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to