You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AC_MSG_CHECKING([for working native compiler: ${CC_FOR_BUILD}])
230
-
AC_RUN_IFELSE(
231
-
[AC_LANG_PROGRAM([], [])],
232
-
[working_native_cc=yes],
233
-
[working_native_cc=no],[:])
234
-
235
-
CFLAGS_FOR_BUILD="$CFLAGS"
236
-
237
-
# Restore the environment
238
-
cross_compiling=$save_cross_compiling
239
-
CC="$SAVE_CC"
240
-
CFLAGS="$SAVE_CFLAGS"
241
-
CPPFLAGS="$SAVE_CPPFLAGS"
242
-
LDFLAGS="$SAVE_LDFLAGS"
243
-
244
-
if test x"$working_native_cc" = x"no"; then
245
-
AC_MSG_RESULT([no])
246
-
set_precomp=no
247
-
m4_define([please_set_for_build], [Please set CC_FOR_BUILD, CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD.])
248
-
if test x"$use_ecmult_static_precomputation" = x"yes"; then
249
-
AC_MSG_ERROR([native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
250
-
else
251
-
AC_MSG_WARN([Disabling statically generated ecmult table because the native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
252
-
fi
253
-
else
254
-
AC_MSG_RESULT([yes])
255
-
set_precomp=yes
256
-
fi
257
-
else
258
-
set_precomp=no
259
-
fi
260
-
261
214
if test x"$req_asm" = x"auto"; then
262
215
SECP_64BIT_ASM_CHECK
263
216
if test x"$has_64bit_asm" = x"yes"; then
@@ -311,7 +264,7 @@ else
311
264
esac
312
265
fi
313
266
314
-
#select assembly optimization
267
+
#Select assembly optimization
315
268
use_external_asm=no
316
269
317
270
case $set_asm in
@@ -328,7 +281,12 @@ no)
328
281
;;
329
282
esac
330
283
331
-
# select wide multiplication implementation
284
+
if test x"$use_external_asm" = x"yes"; then
285
+
AC_DEFINE(USE_EXTERNAL_ASM, 1, [Define this symbol if an external (non-inline) assembly implementation is used])
286
+
fi
287
+
288
+
289
+
# Select wide multiplication implementation
332
290
case $set_widemul in
333
291
int128)
334
292
AC_DEFINE(USE_FORCE_WIDEMUL_INT128, 1, [Define this symbol to force the use of the (unsigned) __int128 based wide multiplication implementation])
@@ -343,7 +301,7 @@ auto)
343
301
;;
344
302
esac
345
303
346
-
#select bignum implementation
304
+
#Select bignum implementation
347
305
case $set_bignum in
348
306
gmp)
349
307
AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed])
@@ -361,7 +319,7 @@ no)
361
319
;;
362
320
esac
363
321
364
-
#set ecmult window size
322
+
# Set ecmult window size
365
323
if test x"$req_ecmult_window" = x"auto"; then
366
324
set_ecmult_window=15
367
325
else
@@ -383,7 +341,7 @@ case $set_ecmult_window in
383
341
;;
384
342
esac
385
343
386
-
#set ecmult gen precision
344
+
# Set ecmult gen precision
387
345
if test x"$req_ecmult_gen_precision" = x"auto"; then
388
346
set_ecmult_gen_precision=4
389
347
else
@@ -434,10 +392,70 @@ if test x"$enable_valgrind" = x"yes"; then
434
392
SECP_INCLUDES="$SECP_INCLUDES $VALGRIND_CPPFLAGS"
435
393
fi
436
394
395
+
# Handle static precomputation (after everything which modifies CFLAGS and friends)
396
+
if test x"$use_ecmult_static_precomputation" != x"no"; then
397
+
# Temporarily switch to an environment for the native compiler
AC_MSG_CHECKING([for working native compiler: ${CC_FOR_BUILD}])
420
+
AC_RUN_IFELSE(
421
+
[AC_LANG_PROGRAM([], [])],
422
+
[working_native_cc=yes],
423
+
[working_native_cc=no],[:])
424
+
425
+
CFLAGS_FOR_BUILD="$CFLAGS"
426
+
427
+
# Restore the environment
428
+
cross_compiling=$save_cross_compiling
429
+
CC="$SAVE_CC"
430
+
CFLAGS="$SAVE_CFLAGS"
431
+
CPPFLAGS="$SAVE_CPPFLAGS"
432
+
LDFLAGS="$SAVE_LDFLAGS"
433
+
434
+
if test x"$working_native_cc" = x"no"; then
435
+
AC_MSG_RESULT([no])
436
+
set_precomp=no
437
+
m4_define([please_set_for_build], [Please set CC_FOR_BUILD, CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and/or LDFLAGS_FOR_BUILD.])
438
+
if test x"$use_ecmult_static_precomputation" = x"yes"; then
439
+
AC_MSG_ERROR([native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
440
+
else
441
+
AC_MSG_WARN([Disabling statically generated ecmult table because the native compiler ${CC_FOR_BUILD} does not produce working binaries. please_set_for_build])
442
+
fi
443
+
else
444
+
AC_MSG_RESULT([yes])
445
+
set_precomp=yes
446
+
fi
447
+
else
448
+
set_precomp=no
449
+
fi
450
+
437
451
if test x"$set_precomp" = x"yes"; then
438
452
AC_DEFINE(USE_ECMULT_STATIC_PRECOMPUTATION, 1, [Define this symbol to use a statically generated ecmult table])
439
453
fi
440
454
455
+
###
456
+
### Handle module options
457
+
###
458
+
441
459
if test x"$enable_module_ecdh" = x"yes"; then
442
460
AC_DEFINE(ENABLE_MODULE_ECDH, 1, [Define this symbol to enable the ECDH module])
443
461
fi
@@ -457,14 +475,14 @@ if test x"$enable_module_extrakeys" = x"yes"; then
457
475
AC_DEFINE(ENABLE_MODULE_EXTRAKEYS, 1, [Define this symbol to enable the extrakeys module])
458
476
fi
459
477
460
-
if test x"$use_external_asm" = x"yes"; then
461
-
AC_DEFINE(USE_EXTERNAL_ASM, 1, [Define this symbol if an external (non-inline) assembly implementation is used])
462
-
fi
463
-
464
478
if test x"$use_external_default_callbacks" = x"yes"; then
465
479
AC_DEFINE(USE_EXTERNAL_DEFAULT_CALLBACKS, 1, [Define this symbol if an external implementation of the default callbacks is used])
0 commit comments