# HG changeset patch # User Mike Becker # Date 1698684034 -3600 # Node ID e3113d4e2fc0c6f8331c9d0058c0bbab63a73899 # Parent 593b604581570b537e3085393b7001505d4fb4cf update uwproj files diff -r 593b60458157 -r e3113d4e2fc0 configure --- a/configure Fri Oct 06 21:21:10 2023 +0200 +++ b/configure Mon Oct 30 17:40:34 2023 +0100 @@ -14,19 +14,23 @@ touch "$TEMP_DIR/features" # define standard variables -PREFIX=/usr -EPREFIX= -BINDIR= -SBINDIR= -LIBDIR= -LIBEXECDIR= -DATADIR= -SYSCONFDIR= -SHAREDSTATEDIR= -LOCALSTATEDIR= -INCLUDEDIR= -INFODIR= -MANDIR= +# 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 @@ -56,12 +60,14 @@ --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] __EOF__ } @@ -73,19 +79,21 @@ for ARG in "$@" do case "$ARG" in - "--prefix="*) PREFIX=${ARG#--prefix=} ;; - "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; - "--bindir="*) BINDIR=${ARG#----bindir=} ;; - "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; - "--libdir="*) LIBDIR=${ARG#--libdir=} ;; - "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; - "--datadir="*) DATADIR=${ARG#--datadir=} ;; - "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; - "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; - "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; - "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; - "--infodir="*) INFODIR=${ARG#--infodir=} ;; - "--mandir"*) MANDIR=${ARG#--mandir} ;; + "--prefix="*) prefix=${ARG#--prefix=} ;; + "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; + "--bindir="*) bindir=${ARG#----bindir=} ;; + "--sbindir="*) sbindir=${ARG#--sbindir=} ;; + "--libdir="*) libdir=${ARG#--libdir=} ;; + "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; + "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; + "--datadir="*) datadir=${ARG#--datadir=} ;; + "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; + "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; + "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; + "--includedir="*) includedir=${ARG#--includedir=} ;; + "--infodir="*) infodir=${ARG#--infodir=} ;; + "--mandir"*) mandir=${ARG#--mandir} ;; + "--localedir"*) localedir=${ARG#--localedir} ;; "--help"*) printhelp; abort_configure ;; "--debug") BUILD_TYPE="debug" ;; "--release") BUILD_TYPE="release" ;; @@ -94,19 +102,41 @@ done -# set dir variables -: ${EPREFIX:="$PREFIX"} -: ${BINDIR:="$EPREFIX/bin"} -: ${SBINDIR:="$EPREFIX/sbin"} -: ${LIBDIR:="$EPREFIX/lib"} -: ${LIBEXECDIR:="$EPREFIX/libexec"} -: ${DATADIR:="$PREFIX/share"} -: ${SYSCONFDIR:="$PREFIX/etc"} -: ${SHAREDSTATEDIR:="$PREFIX/com"} -: ${LOCALSTATEDIR:="$PREFIX/var"} -: ${INCLUDEDIR:="$PREFIX/include"} -: ${INFODIR:="$PREFIX/info"} -: ${MANDIR:="$PREFIX/man"} + +# set defaults for dir variables +: ${exec_prefix:="$prefix"} +: ${bindir:='${exec_prefix}/bin'} +: ${sbindir:='${exec_prefix}/sbin'} +: ${libdir:='${exec_prefix}/lib'} +: ${libexecdir:='${exec_prefix}/libexec'} +: ${datarootdir:='${prefix}/share'} +: ${datadir:='${datarootdir}'} +: ${sysconfdir:='${prefix}/etc'} +: ${sharedstatedir:='${prefix}/com'} +: ${localstatedir:='${prefix}/var'} +: ${runstatedir:='${localstatedir}/run'} +: ${includedir:='${prefix}/include'} +: ${infodir:='${datarootdir}/info'} +: ${mandir:='${datarootdir}/man'} +: ${localedir:='${datarootdir}/locale'} + +# check if a config.site exists and load it +if [ -n "$CONFIG_SITE" ]; then + # CONFIG_SITE may contain space separated file names + for cs in $CONFIG_SITE; do + printf "loading defaults from $cs... " + . "$cs" + echo ok + done +elif [ -f "$prefix/share/config.site" ]; then + printf "loading site defaults... " + . "$prefix/share/config.site" + echo ok +elif [ -f "$prefix/etc/config.site" ]; then + printf "loading site defaults... " + . "$prefix/etc/config.site" + echo ok +fi # Test for availability of pkg-config PKG_CONFIG=`command -v pkg-config` @@ -161,22 +191,23 @@ # generate vars.mk cat > "$TEMP_DIR/vars.mk" << __EOF__ -PREFIX="$PREFIX" -EPREFIX="$EPREFIX" -BINDIR="$BINDIR" -SBINDIR="$SBINDIR" -LIBDIR="$LIBDIR" -LIBEXECDIR="$LIBEXECDIR" -DATADIR="$DATADIR" -SYSCONFDIR="$SYSCONFDIR" -SHAREDSTATEDIR="$SHAREDSTATEDIR" -LOCALSTATEDIR="$LOCALSTATEDIR" -INCLUDEDIR="$INCLUDEDIR" -INFODIR="$INFODIR" -MANDIR="$MANDIR" +prefix="$prefix" +exec_prefix="$exec_prefix" +bindir="$bindir" +sbindir="$sbindir" +libdir="$libdir" +libexecdir="$libexecdir" +datarootdir="$datarootdir" +datadir="$datadir" +sysconfdir="$sysconfdir" +sharedstatedir="$sharedstatedir" +localstatedir="$localstatedir" +runstatedir="$runstatedir" +includedir="$includedir" +infodir="$infodir" +mandir="$mandir" +localedir="$localedir" __EOF__ -sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk" - # toolchain detection utilities . make/toolchain.sh @@ -405,8 +436,8 @@ echo "configure finished" echo echo "Build Config:" -echo " PREFIX: $PREFIX" -echo " TOOLCHAIN: $TOOLCHAIN_NAME" +echo " PREFIX: $prefix" +echo " TOOLCHAIN: $TOOLCHAIN_NAME" echo # generate the config.mk file diff -r 593b60458157 -r e3113d4e2fc0 make/cc.mk --- a/make/cc.mk Fri Oct 06 21:21:10 2023 +0200 +++ b/make/cc.mk Mon Oct 30 17:40:34 2023 +0100 @@ -6,6 +6,3 @@ DEBUG_CC_FLAGS = -g RELEASE_CC_FLAGS = -O3 -DNDEBUG LDFLAGS = - -SHLIB_CFLAGS = -fPIC -SHLIB_LDFLAGS = -shared \ No newline at end of file diff -r 593b60458157 -r e3113d4e2fc0 make/configure.vm --- a/make/configure.vm Fri Oct 06 21:21:10 2023 +0200 +++ b/make/configure.vm Mon Oct 30 17:40:34 2023 +0100 @@ -14,19 +14,23 @@ touch "$TEMP_DIR/features" # define standard variables -PREFIX=/usr -EPREFIX= -BINDIR= -SBINDIR= -LIBDIR= -LIBEXECDIR= -DATADIR= -SYSCONFDIR= -SHAREDSTATEDIR= -LOCALSTATEDIR= -INCLUDEDIR= -INFODIR= -MANDIR= +# 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 ) @@ -68,12 +72,14 @@ --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] #if( $options.size() > 0 ) Options: @@ -106,19 +112,21 @@ for ARG in "$@" do case "$ARG" in - "--prefix="*) PREFIX=${D}{ARG#--prefix=} ;; - "--exec-prefix="*) EPREFIX=${D}{ARG#--exec-prefix=} ;; - "--bindir="*) BINDIR=${D}{ARG#----bindir=} ;; - "--sbindir="*) SBINDIR=${D}{ARG#--sbindir=} ;; - "--libdir="*) LIBDIR=${D}{ARG#--libdir=} ;; - "--libexecdir="*) LIBEXECDIR=${D}{ARG#--libexecdir=} ;; - "--datadir="*) DATADIR=${D}{ARG#--datadir=} ;; - "--sysconfdir="*) SYSCONFDIR=${D}{ARG#--sysconfdir=} ;; - "--sharedstatedir="*) SHAREDSTATEDIR=${D}{ARG#--sharedstatedir=} ;; - "--localstatedir="*) LOCALSTATEDIR=${D}{ARG#--localstatedir=} ;; - "--includedir="*) INCLUDEDIR=${D}{ARG#--includedir=} ;; - "--infodir="*) INFODIR=${D}{ARG#--infodir=} ;; - "--mandir"*) MANDIR=${D}{ARG#--mandir} ;; + "--prefix="*) prefix=${D}{ARG#--prefix=} ;; + "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;; + "--bindir="*) bindir=${D}{ARG#----bindir=} ;; + "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;; + "--libdir="*) libdir=${D}{ARG#--libdir=} ;; + "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;; + "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;; + "--datadir="*) datadir=${D}{ARG#--datadir=} ;; + "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;; + "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;; + "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;; + "--includedir="*) includedir=${D}{ARG#--includedir=} ;; + "--infodir="*) infodir=${D}{ARG#--infodir=} ;; + "--mandir"*) mandir=${D}{ARG#--mandir} ;; + "--localedir"*) localedir=${D}{ARG#--localedir} ;; "--help"*) printhelp; abort_configure ;; "--debug") BUILD_TYPE="debug" ;; "--release") BUILD_TYPE="release" ;; @@ -135,19 +143,41 @@ ## Begin unparsed content. ** #[[ -# set dir variables -: ${EPREFIX:="$PREFIX"} -: ${BINDIR:="$EPREFIX/bin"} -: ${SBINDIR:="$EPREFIX/sbin"} -: ${LIBDIR:="$EPREFIX/lib"} -: ${LIBEXECDIR:="$EPREFIX/libexec"} -: ${DATADIR:="$PREFIX/share"} -: ${SYSCONFDIR:="$PREFIX/etc"} -: ${SHAREDSTATEDIR:="$PREFIX/com"} -: ${LOCALSTATEDIR:="$PREFIX/var"} -: ${INCLUDEDIR:="$PREFIX/include"} -: ${INFODIR:="$PREFIX/info"} -: ${MANDIR:="$PREFIX/man"} + +# set defaults for dir variables +: ${exec_prefix:="$prefix"} +: ${bindir:='${exec_prefix}/bin'} +: ${sbindir:='${exec_prefix}/sbin'} +: ${libdir:='${exec_prefix}/lib'} +: ${libexecdir:='${exec_prefix}/libexec'} +: ${datarootdir:='${prefix}/share'} +: ${datadir:='${datarootdir}'} +: ${sysconfdir:='${prefix}/etc'} +: ${sharedstatedir:='${prefix}/com'} +: ${localstatedir:='${prefix}/var'} +: ${runstatedir:='${localstatedir}/run'} +: ${includedir:='${prefix}/include'} +: ${infodir:='${datarootdir}/info'} +: ${mandir:='${datarootdir}/man'} +: ${localedir:='${datarootdir}/locale'} + +# check if a config.site exists and load it +if [ -n "$CONFIG_SITE" ]; then + # CONFIG_SITE may contain space separated file names + for cs in $CONFIG_SITE; do + printf "loading defaults from $cs... " + . "$cs" + echo ok + done +elif [ -f "$prefix/share/config.site" ]; then + printf "loading site defaults... " + . "$prefix/share/config.site" + echo ok +elif [ -f "$prefix/etc/config.site" ]; then + printf "loading site defaults... " + . "$prefix/etc/config.site" + echo ok +fi # Test for availability of pkg-config PKG_CONFIG=`command -v pkg-config` @@ -203,25 +233,26 @@ # generate vars.mk cat > "$TEMP_DIR/vars.mk" << __EOF__ -PREFIX="$PREFIX" -EPREFIX="$EPREFIX" -BINDIR="$BINDIR" -SBINDIR="$SBINDIR" -LIBDIR="$LIBDIR" -LIBEXECDIR="$LIBEXECDIR" -DATADIR="$DATADIR" -SYSCONFDIR="$SYSCONFDIR" -SHAREDSTATEDIR="$SHAREDSTATEDIR" -LOCALSTATEDIR="$LOCALSTATEDIR" -INCLUDEDIR="$INCLUDEDIR" -INFODIR="$INFODIR" -MANDIR="$MANDIR" +prefix="$prefix" +exec_prefix="$exec_prefix" +bindir="$bindir" +sbindir="$sbindir" +libdir="$libdir" +libexecdir="$libexecdir" +datarootdir="$datarootdir" +datadir="$datadir" +sysconfdir="$sysconfdir" +sharedstatedir="$sharedstatedir" +localstatedir="$localstatedir" +runstatedir="$runstatedir" +includedir="$includedir" +infodir="$infodir" +mandir="$mandir" +localedir="$localedir" #foreach( $var in $vars ) ${var.varName}="${D}${var.varName}" #end __EOF__ -sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk" - # toolchain detection utilities . make/toolchain.sh @@ -577,8 +608,8 @@ echo "configure finished" echo echo "Build Config:" -echo " PREFIX: $PREFIX" -echo " TOOLCHAIN: $TOOLCHAIN_NAME" +echo " PREFIX: $prefix" +echo " TOOLCHAIN: $TOOLCHAIN_NAME" #if ( $options.size() > 0 ) echo "Options:" cat "$TEMP_DIR/options" diff -r 593b60458157 -r e3113d4e2fc0 make/uwproj.xsd --- a/make/uwproj.xsd Fri Oct 06 21:21:10 2023 +0200 +++ b/make/uwproj.xsd Mon Oct 30 17:40:34 2023 +0100 @@ -8,6 +8,14 @@ + + + The root element of an uwproj project. + Consists of an optional config element + and an arbitrary number of dependency + and target elements. + + @@ -16,12 +24,31 @@ + + + The configuration section. + Consists of an arbitrary number of var elements. + + + + + The definition of a configuration variable. +

+ Configuration variables are supposed to be used in the configure script and are also + written to the resulting config file (in contrast to make variables, which are only + written to the config file). + The name attribute is mandatory, the value is defined by the text body of the element. + The optional Boolean exec attribute (false by default) controls, whether the entire + definition is automatically executed under command substitution. +

+
+
@@ -31,6 +58,13 @@
+ + + Instructs configure to invoke pkg-config, if present on the system, to determine + compiler and linker flags. The text body of this element defines the package name to search. + To constrain the allowed versions, use the attributes atleast, exact, max. + + @@ -41,6 +75,12 @@ + + + Requests a compiler for the specified language. Allowed values are + c, cpp. + + @@ -48,14 +88,40 @@ + + + Declares a dependency. +

+ If the optional name attribute is omitted, the dependency is global + and must be satisfied, otherwise configuration shall fail. + A named dependency can be referenced by a target (or is implicitly referenced + by the default target, if no targets are specified). + Multiple declarations for the same named dependency may exist, in which case each declaration + is checked one after another, until one block is satisfied. The result of the first satisfied + dependency declaration is supposed to be applied to the config file. +

+

+ 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 dependency declaration if the detected platform is not + matching the filter specification of these attributes. +

+
+
- - + + + + Specifies a custom command that shall be executed to test whether this dependency is satisfied. + + + + @@ -63,6 +129,13 @@
+ + + Instructs configure to append the contents of the element's body to the respective flags variable. + If the optional exec flag is set to true, the contents are supposed to be + executed under command substitution at configuration time before they are applied. + + @@ -71,6 +144,25 @@ + + + Declares a build target that is supposed to be configured. +

+ If no build target is declared explicitly, an implicit default + target is generated, which has the alldependencies + flag set. +

+

+ The optional name attribute is also used to generate a prefix + for the compiler and linker flags variables. + Furthermore, a target may consist of an arbitrary number of feature, + option, and define elements. + Named dependencies can be listed (separated by comma) in the dependencies + element. If this target shall use all available named dependencies, the empty + element alldependencies can be used as a shortcut. +

+
+
@@ -84,6 +176,18 @@
+ + + Declares an optional feature, that can be enabled during configuration, if all + dependencies are satisfied. + If a feature is enabled, all define and make definitions are + supposed to be applied to the config file. + 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 + specified with the arg attribute. Otherwise, the name is used by default. + + @@ -93,14 +197,31 @@ + + + Declares a configuration option. + The option argument name is specified with the arg attribute. + Then, the children of this element specify possible values by defining the conditions + (in terms of dependencies) and effects (in terms of defines and make variables) of each value. + Finally, a set of defaults is specified which supposed to automagically select the most + appropriate value for a specific platform under the available dependencies (in case the option is not + explicitly specified by using the command line argument). + + - + + + + Declares a possible value for the option (in the str attribute) and + the conditions (dependencies) and effects, the value has. + + @@ -108,6 +229,14 @@ + + + Specifies a default value for this option. Multiple default values can be specified, in which case + they are checked one after another for availability. With the optional platform attribute, + the default value can be constrained to a single specific platform and is supposed to be + skipped by configure, when this platform is not detected. + + @@ -116,16 +245,37 @@ - + + + + Specifies C/C++ pre-processor definitions that are supposed to + be appended to the compiler flags, if supported. + (Note: for example, Fortran also supports C/C++ style pre-processor definitions under + certain circumstances) + + + + A comma-separated list of named dependencies. + + + + + + + + The text contents in the body of this element are supposed to be appended literally + to the config file without prior processing. + + \ No newline at end of file