# HG changeset patch # User Mike Becker # Date 1731429244 -3600 # Node ID 53e22f112b1183fead6fdda15af2926fe8aa9e97 # Parent 38fa7e41194cc988dc4538fcba25e16bbcc71161 add configure option for szmul diff -r 38fa7e41194c -r 53e22f112b11 check-all.sh --- a/check-all.sh Mon Nov 11 21:42:14 2024 +0100 +++ b/check-all.sh Tue Nov 12 17:34:04 2024 +0100 @@ -1,15 +1,27 @@ #!/bin/sh -for cc in clang gcc; do - make clean > /dev/null - CC=$cc ./configure --debug > /dev/null - printf "Check $cc... " - if ! make check > /dev/null ; then +# backup config +cp config.mk config.mk.bak + +function perform_check +{ + if ! make clean check > /dev/null ; then echo "fail." - exit 1 else echo "ok." fi +} + +for cc in clang gcc; do + CC=$cc ./configure --debug > /dev/null + printf "Check $cc... " + perform_check done +printf "Check w/o szmul builtin... " +./configure --debug --disable-szmul-builtin > /dev/null +perform_check +# clean build files and restore config +make clean > /dev/null +mv config.mk.bak config.mk diff -r 38fa7e41194c -r 53e22f112b11 configure --- a/configure Mon Nov 11 21:42:14 2024 +0100 +++ b/configure Tue Nov 12 17:34:04 2024 +0100 @@ -113,6 +113,7 @@ Optional Features: --enable-coverage + --disable-szmul-builtin use custom implementation, instead __EOF__ } @@ -158,6 +159,7 @@ fi # features +FEATURE_SZMUL_BUILTIN=auto # # parse arguments @@ -187,6 +189,8 @@ "--with-docs="*) OPT_WITH_DOCS=${ARG#--with-docs=} ;; "--enable-coverage") FEATURE_COVERAGE=on ;; "--disable-coverage") unset FEATURE_COVERAGE ;; + "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; + "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; "-"*) echo "unknown option: $ARG"; abort_configure ;; esac done @@ -603,6 +607,23 @@ unset FEATURE_COVERAGE fi fi +if [ -n "$FEATURE_COVERAGE" ]; then + : +else + : +fi +if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then + if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then + unset FEATURE_SZMUL_BUILTIN + fi +fi +if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then + : +else + : + TEMP_CFLAGS="$TEMP_CFLAGS -DCX_NO_SZMUL_BUILTIN" + TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DCX_NO_SZMUL_BUILTIN" +fi # Option: --with-docs if [ -z "$OPT_WITH_DOCS" ]; then @@ -727,6 +748,11 @@ else echo " coverage: off" fi +if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then +echo " szmul-builtin: on" +else +echo " szmul-builtin: off" +fi echo # generate the config.mk file diff -r 38fa7e41194c -r 53e22f112b11 make/configure.vm --- a/make/configure.vm Mon Nov 11 21:42:14 2024 +0100 +++ b/make/configure.vm Tue Nov 12 17:34:04 2024 +0100 @@ -568,6 +568,35 @@ unset ${feature.varName} fi fi +if [ -n "${D}${feature.varName}" ]; then + : +#foreach( $def in $feature.defines ) + TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" + TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" +#end +#if( $feature.hasMake() ) + cat >> "$TEMP_DIR/make.mk" << __EOF__ +$feature.make +__EOF__ +#end +else + : +#foreach( $def in $feature.disabled.defines ) + TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}" + TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}" +#end +#if( $feature.disabled.hasMake() ) + cat >> "$TEMP_DIR/make.mk" << __EOF__ +$feature.disabled.make +__EOF__ +#end +#foreach( $dependency in $feature.disabled.dependencies ) + if dependency_error_$dependency ; then + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} " + ERROR=1 + fi +#end +fi #end #foreach( $opt in $target.options ) diff -r 38fa7e41194c -r 53e22f112b11 make/project.xml --- a/make/project.xml Mon Nov 11 21:42:14 2024 +0100 +++ b/make/project.xml Tue Nov 12 17:34:04 2024 +0100 @@ -1,5 +1,5 @@ - + pwd command -v doxygen @@ -114,6 +114,12 @@ coverage + + use custom implementation, instead + + + + c,file-tools diff -r 38fa7e41194c -r 53e22f112b11 make/uwproj.xsd --- a/make/uwproj.xsd Mon Nov 11 21:42:14 2024 +0100 +++ b/make/uwproj.xsd Tue Nov 12 17:34:04 2024 +0100 @@ -3,7 +3,7 @@ xmlns="http://unixwork.de/uwproj" targetNamespace="http://unixwork.de/uwproj" elementFormDefault="qualified" - version="0.2" + version="0.3" > @@ -21,6 +21,7 @@ + @@ -195,6 +196,9 @@ dependencies are satisfied. If a feature is enabled, all define and make definitions are supposed to be applied to the config file. + If a feature is disabled, an optional disabled element may specify which + define and make definitions are supposed to be applied. + There might also be dependencies when the feature is disabled (e.g. specifying a fallback). In case the optional default attribute is set to true, the feature is enabled by default and is supposed to be automatically disabled (without error) when the dependencies are not satisfied. The name that is supposed to be used for the --enable and --disable arguments can be optionally @@ -206,6 +210,13 @@ + + + + + + +