]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Separate the two uses of the configured value GMP_NUMB_BITS.
authorNiels Möller <nisse@lysator.liu.se>
Sat, 26 Aug 2017 07:32:25 +0000 (09:32 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 27 Aug 2017 19:05:54 +0000 (21:05 +0200)
In version.h, GMP_NUMB_BITS is needed only for mini-gmp builds. In
non-mini-gmp builds, substitute a dummy value there, to make the
contents of this header file platform independent. In Makefile, we
always need a properly configured value, and do this with the renamed
variable NUMB_BITS.

Makefile.in
config.make.in
configure.ac

index 7e8f29c2b3aa468fa15e128d1db48d97bb0c4c60..d372c2331f81636b0c468de4b30516aca511b6bc 100644 (file)
@@ -326,7 +326,7 @@ des.$(OBJEXT): des.c des.h $(des_headers)
 #      k =  7, c = 6, 320 entries, ~15 KB
 #      k =  9, c = 7, 512 entries, ~24 KB
 ecc-192.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 192 7 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 192 7 6 $(NUMB_BITS) > $@T && mv $@T $@
 # Some possible choices for 224:
 #      k = 18, c = 4,  64 entries,  ~4 KB
 #      k = 24, c = 6, 128 entries,  ~8 KB
@@ -334,7 +334,7 @@ ecc-192.h: eccdata.stamp
 #      k =  8, c = 6, 320 entries, ~20 KB
 #      k = 10, c = 7, 512 entries, ~32 KB
 ecc-224.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 224 12 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 224 12 6 $(NUMB_BITS) > $@T && mv $@T $@
 # Some possible choices for 256:
 #      k = 20, c = 4,  64 entries,  ~4 KB
 #      k = 27, c = 6, 128 entries,  ~8 KB
@@ -342,7 +342,7 @@ ecc-224.h: eccdata.stamp
 #      k =  9, c = 6, 320 entries, ~20 KB
 #      k = 12, c = 7, 512 entries, ~32 KB
 ecc-256.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 256 14 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 256 14 6 $(NUMB_BITS) > $@T && mv $@T $@
 # Some possible choices for 384:
 #      k = 31, c = 4,  64 entries,  ~6 KB
 #      k = 41, c = 6, 128 entries, ~12 KB
@@ -350,7 +350,7 @@ ecc-256.h: eccdata.stamp
 #      k = 14, c = 6, 320 entries, ~30 KB
 #      k = 18, c = 7, 512 entries, ~48 KB
 ecc-384.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 384 41 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 384 41 6 $(NUMB_BITS) > $@T && mv $@T $@
 # Some possible choices for 521:
 #      k = 42, c = 4,  64 entries,  ~9 KB
 #      k = 56, c = 6, 128 entries, ~18 KB
@@ -358,10 +358,10 @@ ecc-384.h: eccdata.stamp
 #      k = 19, c = 6, 320 entries, ~44 KB
 #      k = 24, c = 7, 512 entries, ~70 KB
 ecc-521.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 521 56 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 521 56 6 $(NUMB_BITS) > $@T && mv $@T $@
 
 ecc-25519.h: eccdata.stamp
-       ./eccdata$(EXEEXT_FOR_BUILD) 255 14 6 $(GMP_NUMB_BITS) > $@T && mv $@T $@
+       ./eccdata$(EXEEXT_FOR_BUILD) 255 14 6 $(NUMB_BITS) > $@T && mv $@T $@
 
 eccdata.stamp: eccdata.c
        $(MAKE) eccdata$(EXEEXT_FOR_BUILD)
index 2981379a143899a4998e8c0e95ada041e4c54913..af2068ce34254bfb912039c387a18d091ede12a3 100644 (file)
@@ -46,7 +46,7 @@ LIBHOGWEED_FORLINK = @LIBHOGWEED_FORLINK@
 LIBHOGWEED_LIBS = @LIBHOGWEED_LIBS@
 LIBHOGWEED_LINK = @LIBHOGWEED_LINK@
 
-GMP_NUMB_BITS = @GMP_NUMB_BITS@
+NUMB_BITS = @NUMB_BITS@
 
 AR = @AR@
 ARFLAGS = cru
index 1d1951b5cf35d19bdad0eb39fe65ad56e3e47a99..9b5f11f16a0d96b64df1f4d388fa917e9633bc75 100644 (file)
@@ -268,7 +268,16 @@ if test "x$enable_public_key" = "xyes" ; then
   fi
 fi
 
-GMP_NUMB_BITS="$nettle_cv_gmp_numb_bits"
+# Substituted in Makefile, passed on to the eccdata command.
+NUMB_BITS="$nettle_cv_gmp_numb_bits"
+AC_SUBST([NUMB_BITS])
+
+# Substituted in version.h, used only with mini-gmp.
+if test "x$enable_mini_gmp" = "xyes" ; then
+  GMP_NUMB_BITS="$NUMB_BITS"
+else
+  GMP_NUMB_BITS="n/a"
+fi
 AC_SUBST([GMP_NUMB_BITS])
 
 # Figure out ABI. Currently, configurable only by setting CFLAGS.