# HG changeset patch # User Mike Becker # Date 1730377479 -3600 # Node ID a8a5f3dd5c3da20033da32945daef30c2b1e9f4e # Parent 0e1bf3c199bfef9df6ba8e00f13f995eb45bf016 test coverage does not really work with clang diff -r 0e1bf3c199bf -r a8a5f3dd5c3d configure --- a/configure Thu Oct 31 12:15:45 2024 +0100 +++ b/configure Thu Oct 31 13:24:39 2024 +0100 @@ -1,5 +1,122 @@ #!/bin/sh + +# some utility functions +isplatform() +{ + for p in $PLATFORM + do + if [ "$p" = "$1" ]; then + return 0 + fi + done + return 1 +} +notisplatform() +{ + for p in $PLATFORM + do + if [ "$p" = "$1" ]; then + return 1 + fi + done + return 0 +} +istoolchain() +{ + for t in $TOOLCHAIN + do + if [ "$t" = "$1" ]; then + return 0 + fi + done + return 1 +} +notistoolchain() +{ + for t in $TOOLCHAIN + do + if [ "$t" = "$1" ]; then + return 1 + fi + done + return 0 +} + +# clean abort +abort_configure() +{ + rm -Rf "$TEMP_DIR" + exit 1 +} + +# Test for availability of pkg-config +PKG_CONFIG=`command -v pkg-config` +: ${PKG_CONFIG:="false"} + +# Simple uname based platform detection +# $PLATFORM is used for platform dependent dependency selection +OS=`uname -s` +OS_VERSION=`uname -r` +printf "detect platform... " +if [ "$OS" = "SunOS" ]; then + PLATFORM="solaris sunos unix svr4" +elif [ "$OS" = "Linux" ]; then + PLATFORM="linux unix" +elif [ "$OS" = "FreeBSD" ]; then + PLATFORM="freebsd bsd unix" +elif [ "$OS" = "OpenBSD" ]; then + PLATFORM="openbsd bsd unix" +elif [ "$OS" = "NetBSD" ]; then + PLATFORM="netbsd bsd unix" +elif [ "$OS" = "Darwin" ]; then + PLATFORM="macos osx bsd unix" +elif echo "$OS" | grep -i "MINGW" > /dev/null; then + PLATFORM="windows mingw" +fi +: ${PLATFORM:="unix"} + +PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` +echo "$PLATFORM_NAME" + + +# help text +printhelp() +{ + echo "Usage: $0 [OPTIONS]..." + cat << __EOF__ +Installation directories: + --prefix=PREFIX path prefix for architecture-independent files + [$prefix] + --exec-prefix=EPREFIX path prefix for architecture-dependent files + [PREFIX] + + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR system configuration files [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --mandir=DIR man documentation [DATAROOTDIR/man] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + +Options: + --debug add extra compile flags for debug builds + --release add extra compile flags for release builds + --with-docs=(all|html|api|none) + +Optional Features: + --enable-coverage + +__EOF__ +} + # create temporary directory TEMP_DIR=".tmp-`uname -n`" rm -Rf "$TEMP_DIR" @@ -33,56 +150,15 @@ mandir= # custom variables -src_dir=`pwd` -DOXYGEN=`command -v doxygen` -PANDOC=`command -v pandoc` +if true \ + ; then + src_dir=`pwd` + DOXYGEN=`command -v doxygen` + PANDOC=`command -v pandoc` +fi # features -# clean abort -abort_configure() -{ - rm -Rf "$TEMP_DIR" - exit 1 -} - -# help text -printhelp() -{ - echo "Usage: $0 [OPTIONS]..." - cat << __EOF__ -Installation directories: - --prefix=PREFIX path prefix for architecture-independent files - [/usr] - --exec-prefix=EPREFIX path prefix for architecture-dependent files - [PREFIX] - - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR system configuration files [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --mandir=DIR man documentation [DATAROOTDIR/man] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - -Options: - --debug add extra compile flags for debug builds - --release add extra compile flags for release builds - --with-docs=(all|html|api|none) - -Optional Features: - --enable-coverage - -__EOF__ -} - # # parse arguments # @@ -152,76 +228,6 @@ echo ok fi -# Test for availability of pkg-config -PKG_CONFIG=`command -v pkg-config` -: ${PKG_CONFIG:="false"} - -# Simple uname based platform detection -# $PLATFORM is used for platform dependent dependency selection -OS=`uname -s` -OS_VERSION=`uname -r` -printf "detect platform... " -if [ "$OS" = "SunOS" ]; then - PLATFORM="solaris sunos unix svr4" -elif [ "$OS" = "Linux" ]; then - PLATFORM="linux unix" -elif [ "$OS" = "FreeBSD" ]; then - PLATFORM="freebsd bsd unix" -elif [ "$OS" = "OpenBSD" ]; then - PLATFORM="openbsd bsd unix" -elif [ "$OS" = "NetBSD" ]; then - PLATFORM="netbsd bsd unix" -elif [ "$OS" = "Darwin" ]; then - PLATFORM="macos osx bsd unix" -elif echo "$OS" | grep -i "MINGW" > /dev/null; then - PLATFORM="windows mingw" -fi -: ${PLATFORM:="unix"} - -PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` -echo "$PLATFORM_NAME" - -isplatform() -{ - for p in $PLATFORM - do - if [ "$p" = "$1" ]; then - return 0 - fi - done - return 1 -} -notisplatform() -{ - for p in $PLATFORM - do - if [ "$p" = "$1" ]; then - return 1 - fi - done - return 0 -} -istoolchain() -{ - for t in $TOOLCHAIN - do - if [ "$t" = "$1" ]; then - return 0 - fi - done - return 1 -} -notistoolchain() -{ - for t in $TOOLCHAIN - do - if [ "$t" = "$1" ]; then - return 1 - fi - done - return 0 -} - # generate vars.mk cat > "$TEMP_DIR/vars.mk" << __EOF__ @@ -241,9 +247,6 @@ infodir=$infodir mandir=$mandir localedir=$localedir -src_dir=$src_dir -DOXYGEN=$DOXYGEN -PANDOC=$PANDOC __EOF__ # toolchain detection utilities @@ -287,10 +290,10 @@ dependency_error_coverage() { print_check_msg "$dep_checked_coverage" "checking for coverage... " - # dependency coverage toolchain="gnuc" + # dependency coverage toolchain="gcc" while true do - if notistoolchain "gnuc"; then + if notistoolchain "gcc"; then break fi TEMP_CFLAGS="$TEMP_CFLAGS \${COVERAGE_CFLAGS}" diff -r 0e1bf3c199bf -r a8a5f3dd5c3d make/clang.mk --- a/make/clang.mk Thu Oct 31 12:15:45 2024 +0100 +++ b/make/clang.mk Thu Oct 31 13:24:39 2024 +0100 @@ -9,6 +9,3 @@ SHLIB_CFLAGS = -fPIC SHLIB_LDFLAGS = -shared - -COVERAGE_CFLAGS = --coverage -COVERAGE_LDFLAGS = --coverage diff -r 0e1bf3c199bf -r a8a5f3dd5c3d make/configure.vm --- a/make/configure.vm Thu Oct 31 12:15:45 2024 +0100 +++ b/make/configure.vm Thu Oct 31 13:24:39 2024 +0100 @@ -1,52 +1,48 @@ #!/bin/sh -# create temporary directory -TEMP_DIR=".tmp-`uname -n`" -rm -Rf "$TEMP_DIR" -if mkdir -p "$TEMP_DIR"; then - : -else - echo "Cannot create tmp dir $TEMP_DIR" - echo "Abort" - exit 1 -fi -touch "$TEMP_DIR/options" -touch "$TEMP_DIR/features" - -# define standard variables -# also define standard prefix (this is where we will search for config.site) -prefix=/usr -exec_prefix= -bindir= -sbindir= -libdir= -libexecdir= -datarootdir= -datadir= -sysconfdir= -sharedstatedir= -localstatedir= -runstatedir= -includedir= -infodir= -localedir= -mandir= - -# custom variables -#foreach( $var in $vars ) -#if( $var.exec ) -${var.varName}=`${var.value}` -#else -${var.varName}="${var.value}" -#end -#end - -# features -#foreach( $feature in $features ) -#if( ${feature.auto} ) -${feature.varName}=auto -#end -#end +#set( $D = '$' ) +#[[ +# some utility functions +isplatform() +{ + for p in $PLATFORM + do + if [ "$p" = "$1" ]; then + return 0 + fi + done + return 1 +} +notisplatform() +{ + for p in $PLATFORM + do + if [ "$p" = "$1" ]; then + return 1 + fi + done + return 0 +} +istoolchain() +{ + for t in $TOOLCHAIN + do + if [ "$t" = "$1" ]; then + return 0 + fi + done + return 1 +} +notistoolchain() +{ + for t in $TOOLCHAIN + do + if [ "$t" = "$1" ]; then + return 1 + fi + done + return 0 +} # clean abort abort_configure() @@ -55,6 +51,36 @@ exit 1 } +# Test for availability of pkg-config +PKG_CONFIG=`command -v pkg-config` +: ${PKG_CONFIG:="false"} + +# Simple uname based platform detection +# $PLATFORM is used for platform dependent dependency selection +OS=`uname -s` +OS_VERSION=`uname -r` +printf "detect platform... " +if [ "$OS" = "SunOS" ]; then + PLATFORM="solaris sunos unix svr4" +elif [ "$OS" = "Linux" ]; then + PLATFORM="linux unix" +elif [ "$OS" = "FreeBSD" ]; then + PLATFORM="freebsd bsd unix" +elif [ "$OS" = "OpenBSD" ]; then + PLATFORM="openbsd bsd unix" +elif [ "$OS" = "NetBSD" ]; then + PLATFORM="netbsd bsd unix" +elif [ "$OS" = "Darwin" ]; then + PLATFORM="macos osx bsd unix" +elif echo "$OS" | grep -i "MINGW" > /dev/null; then + PLATFORM="windows mingw" +fi +: ${PLATFORM:="unix"} + +PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` +echo "$PLATFORM_NAME" +]]# + # help text printhelp() { @@ -62,7 +88,7 @@ cat << __EOF__ Installation directories: --prefix=PREFIX path prefix for architecture-independent files - [/usr] + [${D}prefix] --exec-prefix=EPREFIX path prefix for architecture-dependent files [PREFIX] @@ -100,11 +126,69 @@ __EOF__ } +# create temporary directory +TEMP_DIR=".tmp-`uname -n`" +rm -Rf "$TEMP_DIR" +if mkdir -p "$TEMP_DIR"; then + : +else + echo "Cannot create tmp dir $TEMP_DIR" + echo "Abort" + exit 1 +fi +touch "$TEMP_DIR/options" +touch "$TEMP_DIR/features" + +# define standard variables +# also define standard prefix (this is where we will search for config.site) +prefix=/usr +exec_prefix= +bindir= +sbindir= +libdir= +libexecdir= +datarootdir= +datadir= +sysconfdir= +sharedstatedir= +localstatedir= +runstatedir= +includedir= +infodir= +localedir= +mandir= + +# custom variables +#foreach( $cfg in $config ) +if true \ +#if( $cfg.platform ) + && isplatform "${cfg.platform}" \ +#end +#foreach( $np in $cfg.notList ) + && notisplatform "${np}" \ +#end + ; then + #foreach( $var in $cfg.vars ) + #if( $var.exec ) + ${var.varName}=`${var.value}` + #else + ${var.varName}="${var.value}" + #end + #end +fi +#end + +# features +#foreach( $feature in $features ) +#if( ${feature.auto} ) +${feature.varName}=auto +#end +#end + # # parse arguments # BUILD_TYPE="default" -#set( $D = '$' ) for ARG in "$@" do case "$ARG" in @@ -174,76 +258,6 @@ . "$prefix/etc/config.site" echo ok fi - -# Test for availability of pkg-config -PKG_CONFIG=`command -v pkg-config` -: ${PKG_CONFIG:="false"} - -# Simple uname based platform detection -# $PLATFORM is used for platform dependent dependency selection -OS=`uname -s` -OS_VERSION=`uname -r` -printf "detect platform... " -if [ "$OS" = "SunOS" ]; then - PLATFORM="solaris sunos unix svr4" -elif [ "$OS" = "Linux" ]; then - PLATFORM="linux unix" -elif [ "$OS" = "FreeBSD" ]; then - PLATFORM="freebsd bsd unix" -elif [ "$OS" = "OpenBSD" ]; then - PLATFORM="openbsd bsd unix" -elif [ "$OS" = "NetBSD" ]; then - PLATFORM="netbsd bsd unix" -elif [ "$OS" = "Darwin" ]; then - PLATFORM="macos osx bsd unix" -elif echo "$OS" | grep -i "MINGW" > /dev/null; then - PLATFORM="windows mingw" -fi -: ${PLATFORM:="unix"} - -PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` -echo "$PLATFORM_NAME" - -isplatform() -{ - for p in $PLATFORM - do - if [ "$p" = "$1" ]; then - return 0 - fi - done - return 1 -} -notisplatform() -{ - for p in $PLATFORM - do - if [ "$p" = "$1" ]; then - return 1 - fi - done - return 0 -} -istoolchain() -{ - for t in $TOOLCHAIN - do - if [ "$t" = "$1" ]; then - return 0 - fi - done - return 1 -} -notistoolchain() -{ - for t in $TOOLCHAIN - do - if [ "$t" = "$1" ]; then - return 1 - fi - done - return 0 -} ]]# ## End of unparsed content ** diff -r 0e1bf3c199bf -r a8a5f3dd5c3d make/project.xml --- a/make/project.xml Thu Oct 31 12:15:45 2024 +0100 +++ b/make/project.xml Thu Oct 31 13:24:39 2024 +0100 @@ -73,7 +73,7 @@ test -n "$PANDOC" - + \${COVERAGE_CFLAGS} \${COVERAGE_LDFLAGS} diff -r 0e1bf3c199bf -r a8a5f3dd5c3d make/uwproj.xsd --- a/make/uwproj.xsd Thu Oct 31 12:15:45 2024 +0100 +++ b/make/uwproj.xsd Thu Oct 31 13:24:39 2024 +0100 @@ -17,7 +17,7 @@ - + @@ -26,13 +26,23 @@ - The configuration section. - Consists of an arbitrary number of var elements. +

+ The configuration section. + Consists of an arbitrary number of var elements. +

+

+ The optional platform attribute may specify a single platform identifier and + the optional not attribute may specify a comma-separated list of platform identifiers. + The configure script shall skip this config declaration if the detected platform is not matching + the filter specification of these attributes. +

+ +
@@ -195,11 +205,11 @@ + -