228228AM_CONDITIONAL([ VALGRIND_ENABLED] [ test "$enable_valgrind" = "yes"] 
229229
230230if 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" 
232232    SECP_CFLAGS="-O0 --coverage $SECP_CFLAGS"
233233    LDFLAGS="--coverage $LDFLAGS"
234234else
@@ -270,7 +270,7 @@ enable_external_asm=no
270270
271271case $set_asm in
272272x86_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" 
274274  ;;
275275arm)
276276  enable_external_asm=yes
@@ -283,20 +283,20 @@ no)
283283esac
284284
285285if 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" 
287287fi
288288
289289
290290#  Select wide multiplication implementation
291291case $set_widemul in
292292int128_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" 
294294  ;;
295295int128)
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" 
297297  ;;
298298int64)
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" 
300300  ;;
301301auto)
302302  ;;
@@ -323,7 +323,7 @@ case $set_ecmult_window in
323323    #  not in range
324324    AC_MSG_ERROR ( $error_window_size ) 
325325  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" 
327327  ;;
328328esac
329329
336336
337337case $set_ecmult_gen_precision in
3383382|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" 
340340  ;;
341341*)
342342  AC_MSG_ERROR ( [ 'ecmult gen precision not 2, 4, 8 or "auto"'] ) 
@@ -357,26 +357,26 @@ SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"
357357# ##
358358
359359if 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" 
361361fi
362362
363363if 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" 
365365fi
366366
367367if 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" 
369369  enable_module_extrakeys=yes
370370fi
371371
372372#  Test if extrakeys is set after the schnorrsig module to allow the schnorrsig
373373#  module to set enable_module_extrakeys=yes
374374if 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" 
376376fi
377377
378378if 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" 
380380fi
381381
382382# ##
398398# ## Generate output
399399# ##
400400
401- AC_CONFIG_HEADERS ( [ src/libsecp256k1-config.h] ) 
402401AC_CONFIG_FILES ( [ Makefile libsecp256k1.pc] ) 
403402AC_SUBST ( SECP_INCLUDES ) 
404403AC_SUBST ( SECP_LIBS ) 
405404AC_SUBST ( SECP_TEST_LIBS ) 
406405AC_SUBST ( SECP_TEST_INCLUDES ) 
407406AC_SUBST ( SECP_CFLAGS ) 
407+ AC_SUBST ( SECP_CONFIG_DEFINES ) 
408408AM_CONDITIONAL([ ENABLE_COVERAGE] [ test x"$enable_coverage" = x"yes"] 
409409AM_CONDITIONAL([ USE_TESTS] [ test x"$enable_tests" != x"no"] 
410410AM_CONDITIONAL([ USE_EXHAUSTIVE_TESTS] [ test x"$enable_exhaustive_tests" != x"no"] 
0 commit comments