6767
6868CFLAGS="-W $CFLAGS"
6969
70- warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings"
70+ warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef - Wno-unused-function -Wno-long-long -Wno-overlength-strings"
7171saved_CFLAGS="$CFLAGS"
7272CFLAGS="$warn_CFLAGS $CFLAGS"
7373AC_MSG_CHECKING ( [ if ${CC} supports ${warn_CFLAGS}] )
@@ -136,6 +136,16 @@ AC_ARG_ENABLE(module_recovery,
136136 [ enable_module_recovery=$enableval] ,
137137 [ enable_module_recovery=no] )
138138
139+ AC_ARG_ENABLE ( module_extrakeys ,
140+ AS_HELP_STRING ( [ --enable-module-extrakeys] ,[ enable extrakeys module (experimental)] ) ,
141+ [ enable_module_extrakeys=$enableval] ,
142+ [ enable_module_extrakeys=no] )
143+
144+ AC_ARG_ENABLE ( module_schnorrsig ,
145+ AS_HELP_STRING ( [ --enable-module-schnorrsig] ,[ enable schnorrsig module (experimental)] ) ,
146+ [ enable_module_schnorrsig=$enableval] ,
147+ [ enable_module_schnorrsig=no] )
148+
139149AC_ARG_ENABLE ( external_default_callbacks ,
140150 AS_HELP_STRING ( [ --enable-external-default-callbacks] ,[ enable external default callback functions [ default=no] ] ) ,
141151 [ use_external_default_callbacks=$enableval] ,
@@ -168,7 +178,21 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
168178) ] ,
169179[ req_ecmult_gen_precision=$withval] , [ req_ecmult_gen_precision=auto] )
170180
171- AC_CHECK_HEADER ( [ valgrind/memcheck.h] , [ enable_valgrind=yes] , [ enable_valgrind=no] , [ ] )
181+ AC_ARG_WITH ( [ valgrind] , [ AS_HELP_STRING ( [ --with-valgrind=yes|no|auto] ,
182+ [ Build with extra checks for running inside Valgrind [ default=auto] ]
183+ ) ] ,
184+ [ req_valgrind=$withval] , [ req_valgrind=auto] )
185+
186+ if test x"$req_valgrind" = x"no"; then
187+ enable_valgrind=no
188+ else
189+ AC_CHECK_HEADER ( [ valgrind/memcheck.h] , [ enable_valgrind=yes] , [
190+ if test x"$req_valgrind" = x"yes"; then
191+ AC_MSG_ERROR ( [ Valgrind support explicitly requested but valgrind/memcheck.h header not available] )
192+ fi
193+ enable_valgrind=no
194+ ] , [ ] )
195+ fi
172196AM_CONDITIONAL([ VALGRIND_ENABLED] ,[ test "$enable_valgrind" = "yes"] )
173197
174198if test x"$enable_coverage" = x"yes"; then
@@ -421,6 +445,17 @@ if test x"$enable_module_recovery" = x"yes"; then
421445 AC_DEFINE ( ENABLE_MODULE_RECOVERY , 1 , [ Define this symbol to enable the ECDSA pubkey recovery module] )
422446fi
423447
448+ if test x"$enable_module_schnorrsig" = x"yes"; then
449+ AC_DEFINE ( ENABLE_MODULE_SCHNORRSIG , 1 , [ Define this symbol to enable the schnorrsig module] )
450+ enable_module_extrakeys=yes
451+ fi
452+
453+ # Test if extrakeys is set after the schnorrsig module to allow the schnorrsig
454+ # module to set enable_module_extrakeys=yes
455+ if test x"$enable_module_extrakeys" = x"yes"; then
456+ AC_DEFINE ( ENABLE_MODULE_EXTRAKEYS , 1 , [ Define this symbol to enable the extrakeys module] )
457+ fi
458+
424459if test x"$use_external_asm" = x"yes"; then
425460 AC_DEFINE ( USE_EXTERNAL_ASM , 1 , [ Define this symbol if an external (non-inline) assembly implementation is used] )
426461fi
@@ -434,11 +469,19 @@ if test x"$enable_experimental" = x"yes"; then
434469 AC_MSG_NOTICE ( [ WARNING: experimental build] )
435470 AC_MSG_NOTICE ( [ Experimental features do not have stable APIs or properties, and may not be safe for production use.] )
436471 AC_MSG_NOTICE ( [ Building ECDH module: $enable_module_ecdh] )
472+ AC_MSG_NOTICE ( [ Building extrakeys module: $enable_module_extrakeys] )
473+ AC_MSG_NOTICE ( [ Building schnorrsig module: $enable_module_schnorrsig] )
437474 AC_MSG_NOTICE ( [ ******] )
438475else
439476 if test x"$enable_module_ecdh" = x"yes"; then
440477 AC_MSG_ERROR ( [ ECDH module is experimental. Use --enable-experimental to allow.] )
441478 fi
479+ if test x"$enable_module_extrakeys" = x"yes"; then
480+ AC_MSG_ERROR ( [ extrakeys module is experimental. Use --enable-experimental to allow.] )
481+ fi
482+ if test x"$enable_module_schnorrsig" = x"yes"; then
483+ AC_MSG_ERROR ( [ schnorrsig module is experimental. Use --enable-experimental to allow.] )
484+ fi
442485 if test x"$set_asm" = x"arm"; then
443486 AC_MSG_ERROR ( [ ARM assembly optimization is experimental. Use --enable-experimental to allow.] )
444487 fi
@@ -457,6 +500,8 @@ AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])
457500AM_CONDITIONAL([ USE_ECMULT_STATIC_PRECOMPUTATION] , [ test x"$set_precomp" = x"yes"] )
458501AM_CONDITIONAL([ ENABLE_MODULE_ECDH] , [ test x"$enable_module_ecdh" = x"yes"] )
459502AM_CONDITIONAL([ ENABLE_MODULE_RECOVERY] , [ test x"$enable_module_recovery" = x"yes"] )
503+ AM_CONDITIONAL([ ENABLE_MODULE_EXTRAKEYS] , [ test x"$enable_module_extrakeys" = x"yes"] )
504+ AM_CONDITIONAL([ ENABLE_MODULE_SCHNORRSIG] , [ test x"$enable_module_schnorrsig" = x"yes"] )
460505AM_CONDITIONAL([ USE_EXTERNAL_ASM] , [ test x"$use_external_asm" = x"yes"] )
461506AM_CONDITIONAL([ USE_ASM_ARM] , [ test x"$set_asm" = x"arm"] )
462507
@@ -476,6 +521,8 @@ echo " with benchmarks = $use_benchmark"
476521echo " with coverage = $enable_coverage"
477522echo " module ecdh = $enable_module_ecdh"
478523echo " module recovery = $enable_module_recovery"
524+ echo " module extrakeys = $enable_module_extrakeys"
525+ echo " module schnorrsig = $enable_module_schnorrsig"
479526echo
480527echo " asm = $set_asm"
481528echo " bignum = $set_bignum"
0 commit comments