228
228
AM_CONDITIONAL([ VALGRIND_ENABLED] ,[ test "$enable_valgrind" = "yes"] )
229
229
230
230
if test x"$enable_coverage" = x"yes"; then
231
- AC_DEFINE ( COVERAGE , 1 , [ Define this symbol to compile out all VERIFY code ] )
231
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOVERAGE=1"
232
232
SECP_CFLAGS="-O0 --coverage $SECP_CFLAGS"
233
233
LDFLAGS="--coverage $LDFLAGS"
234
234
else
@@ -270,7 +270,7 @@ enable_external_asm=no
270
270
271
271
case $set_asm in
272
272
x86_64)
273
- AC_DEFINE ( USE_ASM_X86_64 , 1 , [ Define this symbol to enable x86_64 assembly optimizations ] )
273
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_ASM_X86_64=1"
274
274
;;
275
275
arm)
276
276
enable_external_asm=yes
@@ -283,20 +283,20 @@ no)
283
283
esac
284
284
285
285
if test x"$enable_external_asm" = x"yes"; then
286
- AC_DEFINE ( USE_EXTERNAL_ASM , 1 , [ Define this symbol if an external (non-inline) assembly implementation is used ] )
286
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_EXTERNAL_ASM=1"
287
287
fi
288
288
289
289
290
290
# Select wide multiplication implementation
291
291
case $set_widemul in
292
292
int128_struct)
293
- AC_DEFINE ( USE_FORCE_WIDEMUL_INT128_STRUCT , 1 , [ Define this symbol to force the use of the structure for simulating (unsigned) int128 based wide multiplication ] )
293
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT128_STRUCT=1"
294
294
;;
295
295
int128)
296
- AC_DEFINE ( USE_FORCE_WIDEMUL_INT128 , 1 , [ Define this symbol to force the use of the (unsigned) __int128 based wide multiplication implementation ] )
296
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT128=1"
297
297
;;
298
298
int64)
299
- AC_DEFINE ( USE_FORCE_WIDEMUL_INT64 , 1 , [ Define this symbol to force the use of the (u)int64_t based wide multiplication implementation ] )
299
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT64=1"
300
300
;;
301
301
auto)
302
302
;;
@@ -323,7 +323,7 @@ case $set_ecmult_window in
323
323
# not in range
324
324
AC_MSG_ERROR ( $error_window_size )
325
325
fi
326
- AC_DEFINE_UNQUOTED ( ECMULT_WINDOW_SIZE , $set_ecmult_window , [ Set window size for ecmult precomputation ] )
326
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DECMULT_WINDOW_SIZE= $set_ecmult_window"
327
327
;;
328
328
esac
329
329
336
336
337
337
case $set_ecmult_gen_precision in
338
338
2|4|8)
339
- AC_DEFINE_UNQUOTED ( ECMULT_GEN_PREC_BITS , $set_ecmult_gen_precision , [ Set ecmult gen precision bits ] )
339
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DECMULT_GEN_PREC_BITS= $set_ecmult_gen_precision"
340
340
;;
341
341
*)
342
342
AC_MSG_ERROR ( [ 'ecmult gen precision not 2, 4, 8 or "auto"'] )
@@ -357,26 +357,26 @@ SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"
357
357
# ##
358
358
359
359
if test x"$enable_module_ecdh" = x"yes"; then
360
- AC_DEFINE ( ENABLE_MODULE_ECDH , 1 , [ Define this symbol to enable the ECDH module ] )
360
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_ECDH=1"
361
361
fi
362
362
363
363
if test x"$enable_module_recovery" = x"yes"; then
364
- AC_DEFINE ( ENABLE_MODULE_RECOVERY , 1 , [ Define this symbol to enable the ECDSA pubkey recovery module ] )
364
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_RECOVERY=1"
365
365
fi
366
366
367
367
if test x"$enable_module_schnorrsig" = x"yes"; then
368
- AC_DEFINE ( ENABLE_MODULE_SCHNORRSIG , 1 , [ Define this symbol to enable the schnorrsig module ] )
368
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_SCHNORRSIG=1"
369
369
enable_module_extrakeys=yes
370
370
fi
371
371
372
372
# Test if extrakeys is set after the schnorrsig module to allow the schnorrsig
373
373
# module to set enable_module_extrakeys=yes
374
374
if test x"$enable_module_extrakeys" = x"yes"; then
375
- AC_DEFINE ( ENABLE_MODULE_EXTRAKEYS , 1 , [ Define this symbol to enable the extrakeys module ] )
375
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_EXTRAKEYS=1"
376
376
fi
377
377
378
378
if test x"$enable_external_default_callbacks" = x"yes"; then
379
- AC_DEFINE ( USE_EXTERNAL_DEFAULT_CALLBACKS , 1 , [ Define this symbol if an external implementation of the default callbacks is used ] )
379
+ SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_EXTERNAL_DEFAULT_CALLBACKS=1"
380
380
fi
381
381
382
382
# ##
398
398
# ## Generate output
399
399
# ##
400
400
401
- AC_CONFIG_HEADERS ( [ src/libsecp256k1-config.h] )
402
401
AC_CONFIG_FILES ( [ Makefile libsecp256k1.pc] )
403
402
AC_SUBST ( SECP_INCLUDES )
404
403
AC_SUBST ( SECP_LIBS )
405
404
AC_SUBST ( SECP_TEST_LIBS )
406
405
AC_SUBST ( SECP_TEST_INCLUDES )
407
406
AC_SUBST ( SECP_CFLAGS )
407
+ AC_SUBST ( SECP_CONFIG_DEFINES )
408
408
AM_CONDITIONAL([ ENABLE_COVERAGE] , [ test x"$enable_coverage" = x"yes"] )
409
409
AM_CONDITIONAL([ USE_TESTS] , [ test x"$enable_tests" != x"no"] )
410
410
AM_CONDITIONAL([ USE_EXHAUSTIVE_TESTS] , [ test x"$enable_exhaustive_tests" != x"no"] )
0 commit comments