@@ -114,60 +114,54 @@ SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)
114
114
# ## Define config arguments
115
115
# ##
116
116
117
+ # In dev mode, we enable all binaries and modules by default but individual options can still be overridden explicitly.
118
+ # Check for dev mode first because SECP_SET_DEFAULT needs enable_dev_mode set.
119
+ AC_ARG_ENABLE ( dev_mode , [ ] , [ ] ,
120
+ [ enable_dev_mode=no] )
121
+
117
122
AC_ARG_ENABLE ( benchmark ,
118
- AS_HELP_STRING ( [ --enable-benchmark] ,[ compile benchmark [ default=yes] ] ) ,
119
- [ use_benchmark=$enableval] ,
120
- [ use_benchmark=yes] )
123
+ AS_HELP_STRING ( [ --enable-benchmark] ,[ compile benchmark [ default=yes] ] ) , [ ] ,
124
+ [ SECP_SET_DEFAULT([ enable_benchmark] , [ yes] , [ yes] )] )
121
125
122
126
AC_ARG_ENABLE ( coverage ,
123
- AS_HELP_STRING ( [ --enable-coverage] ,[ enable compiler flags to support kcov coverage analysis [ default=no] ] ) ,
124
- [ enable_coverage=$enableval] ,
125
- [ enable_coverage=no] )
127
+ AS_HELP_STRING ( [ --enable-coverage] ,[ enable compiler flags to support kcov coverage analysis [ default=no] ] ) , [ ] ,
128
+ [ SECP_SET_DEFAULT([ enable_coverage] , [ no] , [ no] )] )
126
129
127
130
AC_ARG_ENABLE ( tests ,
128
- AS_HELP_STRING ( [ --enable-tests] ,[ compile tests [ default=yes] ] ) ,
129
- [ use_tests=$enableval] ,
130
- [ use_tests=yes] )
131
+ AS_HELP_STRING ( [ --enable-tests] ,[ compile tests [ default=yes] ] ) , [ ] ,
132
+ [ SECP_SET_DEFAULT([ enable_tests] , [ yes] , [ yes] )] )
131
133
132
134
AC_ARG_ENABLE ( experimental ,
133
- AS_HELP_STRING ( [ --enable-experimental] ,[ allow experimental configure options [ default=no] ] ) ,
134
- [ use_experimental=$enableval] ,
135
- [ use_experimental=no] )
135
+ AS_HELP_STRING ( [ --enable-experimental] ,[ allow experimental configure options [ default=no] ] ) , [ ] ,
136
+ [ SECP_SET_DEFAULT([ enable_experimental] , [ no] , [ yes] )] )
136
137
137
138
AC_ARG_ENABLE ( exhaustive_tests ,
138
- AS_HELP_STRING ( [ --enable-exhaustive-tests] ,[ compile exhaustive tests [ default=yes] ] ) ,
139
- [ use_exhaustive_tests=$enableval] ,
140
- [ use_exhaustive_tests=yes] )
139
+ AS_HELP_STRING ( [ --enable-exhaustive-tests] ,[ compile exhaustive tests [ default=yes] ] ) , [ ] ,
140
+ [ SECP_SET_DEFAULT([ enable_exhaustive_tests] , [ yes] , [ yes] )] )
141
141
142
142
AC_ARG_ENABLE ( examples ,
143
- AS_HELP_STRING ( [ --enable-examples] ,[ compile the examples [ default=no] ] ) ,
144
- [ use_examples=$enableval] ,
145
- [ use_examples=no] )
143
+ AS_HELP_STRING ( [ --enable-examples] ,[ compile the examples [ default=no] ] ) , [ ] ,
144
+ [ SECP_SET_DEFAULT([ enable_examples] , [ no] , [ yes] )] )
146
145
147
146
AC_ARG_ENABLE ( module_ecdh ,
148
- AS_HELP_STRING ( [ --enable-module-ecdh] ,[ enable ECDH shared secret computation] ) ,
149
- [ enable_module_ecdh=$enableval] ,
150
- [ enable_module_ecdh=no] )
147
+ AS_HELP_STRING ( [ --enable-module-ecdh] ,[ enable ECDH shared secret computation] ) , [ ] ,
148
+ [ SECP_SET_DEFAULT([ enable_module_ecdh] , [ no] , [ yes] )] )
151
149
152
150
AC_ARG_ENABLE ( module_recovery ,
153
- AS_HELP_STRING ( [ --enable-module-recovery] ,[ enable ECDSA pubkey recovery module [ default=no] ] ) ,
154
- [ enable_module_recovery=$enableval] ,
155
- [ enable_module_recovery=no] )
151
+ AS_HELP_STRING ( [ --enable-module-recovery] ,[ enable ECDSA pubkey recovery module [ default=no] ] ) , [ ] ,
152
+ [ SECP_SET_DEFAULT([ enable_module_recovery] , [ no] , [ yes] )] )
156
153
157
154
AC_ARG_ENABLE ( module_extrakeys ,
158
- AS_HELP_STRING ( [ --enable-module-extrakeys] ,[ enable extrakeys module (experimental)] ) ,
159
- [ enable_module_extrakeys=$enableval] ,
160
- [ enable_module_extrakeys=no] )
155
+ AS_HELP_STRING ( [ --enable-module-extrakeys] ,[ enable extrakeys module (experimental)] ) , [ ] ,
156
+ [ SECP_SET_DEFAULT([ enable_module_extrakeys] , [ no] , [ yes] )] )
161
157
162
158
AC_ARG_ENABLE ( module_schnorrsig ,
163
- AS_HELP_STRING ( [ --enable-module-schnorrsig] ,[ enable schnorrsig module (experimental)] ) ,
164
- [ enable_module_schnorrsig=$enableval] ,
165
- [ enable_module_schnorrsig=no] )
159
+ AS_HELP_STRING ( [ --enable-module-schnorrsig] ,[ enable schnorrsig module (experimental)] ) , [ ] ,
160
+ [ SECP_SET_DEFAULT([ enable_module_schnorrsig] , [ no] , [ yes] )] )
166
161
167
162
AC_ARG_ENABLE ( external_default_callbacks ,
168
- AS_HELP_STRING ( [ --enable-external-default-callbacks] ,[ enable external default callback functions [ default=no] ] ) ,
169
- [ use_external_default_callbacks=$enableval] ,
170
- [ use_external_default_callbacks=no] )
163
+ AS_HELP_STRING ( [ --enable-external-default-callbacks] ,[ enable external default callback functions [ default=no] ] ) , [ ] ,
164
+ [ SECP_SET_DEFAULT([ enable_external_default_callbacks] , [ no] , [ no] )] )
171
165
172
166
# Test-only override of the (autodetected by the C code) "widemul" setting.
173
167
# Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default).
@@ -257,14 +251,14 @@ else
257
251
fi
258
252
259
253
# Select assembly optimization
260
- use_external_asm =no
254
+ enable_external_asm =no
261
255
262
256
case $set_asm in
263
257
x86_64)
264
258
AC_DEFINE ( USE_ASM_X86_64 , 1 , [ Define this symbol to enable x86_64 assembly optimizations] )
265
259
;;
266
260
arm)
267
- use_external_asm =yes
261
+ enable_external_asm =yes
268
262
;;
269
263
no)
270
264
;;
273
267
;;
274
268
esac
275
269
276
- if test x"$use_external_asm " = x"yes"; then
270
+ if test x"$enable_external_asm " = x"yes"; then
277
271
AC_DEFINE ( USE_EXTERNAL_ASM , 1 , [ Define this symbol if an external (non-inline) assembly implementation is used] )
278
272
fi
279
273
@@ -361,7 +355,7 @@ if test x"$enable_module_extrakeys" = x"yes"; then
361
355
AC_DEFINE ( ENABLE_MODULE_EXTRAKEYS , 1 , [ Define this symbol to enable the extrakeys module] )
362
356
fi
363
357
364
- if test x"$use_external_default_callbacks " = x"yes"; then
358
+ if test x"$enable_external_default_callbacks " = x"yes"; then
365
359
AC_DEFINE ( USE_EXTERNAL_DEFAULT_CALLBACKS , 1 , [ Define this symbol if an external implementation of the default callbacks is used] )
366
360
fi
367
361
@@ -400,15 +394,15 @@ AC_SUBST(SECP_TEST_LIBS)
400
394
AC_SUBST ( SECP_TEST_INCLUDES )
401
395
AC_SUBST ( SECP_CFLAGS )
402
396
AM_CONDITIONAL([ ENABLE_COVERAGE] , [ test x"$enable_coverage" = x"yes"] )
403
- AM_CONDITIONAL([ USE_TESTS] , [ test x"$use_tests " != x"no"] )
404
- AM_CONDITIONAL([ USE_EXHAUSTIVE_TESTS] , [ test x"$use_exhaustive_tests " != x"no"] )
405
- AM_CONDITIONAL([ USE_EXAMPLES] , [ test x"$use_examples " != x"no"] )
406
- AM_CONDITIONAL([ USE_BENCHMARK] , [ test x"$use_benchmark " = x"yes"] )
397
+ AM_CONDITIONAL([ USE_TESTS] , [ test x"$enable_tests " != x"no"] )
398
+ AM_CONDITIONAL([ USE_EXHAUSTIVE_TESTS] , [ test x"$enable_exhaustive_tests " != x"no"] )
399
+ AM_CONDITIONAL([ USE_EXAMPLES] , [ test x"$enable_examples " != x"no"] )
400
+ AM_CONDITIONAL([ USE_BENCHMARK] , [ test x"$enable_benchmark " = x"yes"] )
407
401
AM_CONDITIONAL([ ENABLE_MODULE_ECDH] , [ test x"$enable_module_ecdh" = x"yes"] )
408
402
AM_CONDITIONAL([ ENABLE_MODULE_RECOVERY] , [ test x"$enable_module_recovery" = x"yes"] )
409
403
AM_CONDITIONAL([ ENABLE_MODULE_EXTRAKEYS] , [ test x"$enable_module_extrakeys" = x"yes"] )
410
404
AM_CONDITIONAL([ ENABLE_MODULE_SCHNORRSIG] , [ test x"$enable_module_schnorrsig" = x"yes"] )
411
- AM_CONDITIONAL([ USE_EXTERNAL_ASM] , [ test x"$use_external_asm " = x"yes"] )
405
+ AM_CONDITIONAL([ USE_EXTERNAL_ASM] , [ test x"$enable_external_asm " = x"yes"] )
412
406
AM_CONDITIONAL([ USE_ASM_ARM] , [ test x"$set_asm" = x"arm"] )
413
407
AM_CONDITIONAL([ BUILD_WINDOWS] , [ test "$build_windows" = "yes"] )
414
408
AC_SUBST ( LIB_VERSION_CURRENT , _LIB_VERSION_CURRENT )
@@ -424,11 +418,11 @@ AC_OUTPUT
424
418
425
419
echo
426
420
echo "Build Options:"
427
- echo " with external callbacks = $use_external_default_callbacks "
428
- echo " with benchmarks = $use_benchmark "
429
- echo " with tests = $use_tests "
421
+ echo " with external callbacks = $enable_external_default_callbacks "
422
+ echo " with benchmarks = $enable_benchmark "
423
+ echo " with tests = $enable_tests "
430
424
echo " with coverage = $enable_coverage"
431
- echo " with examples = $use_examples "
425
+ echo " with examples = $enable_examples "
432
426
echo " module ecdh = $enable_module_ecdh"
433
427
echo " module recovery = $enable_module_recovery"
434
428
echo " module extrakeys = $enable_module_extrakeys"
0 commit comments