make/configure.vm

changeset 1492
cc83ce484bf7
parent 1413
c5a225d7228c
--- a/make/configure.vm	Thu Nov 13 17:47:00 2025 +0100
+++ b/make/configure.vm	Sat Nov 15 08:30:00 2025 +0100
@@ -115,7 +115,7 @@
 
 Options:
 #foreach( $opt in $options )
-  --${opt.argument}=${opt.valuesString}
+${opt.helpText}
 #end
 #end
 #if( $features.size() > 0 )
@@ -206,6 +206,7 @@
         "--sysconfdir="*)     sysconfdir=${D}{ARG#--sysconfdir=} ;;
         "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;;
         "--localstatedir="*)  localstatedir=${D}{ARG#--localstatedir=} ;;
+        "--runstatedir="*)    runstatedir=${D}{ARG#--runstatedir=} ;;
         "--includedir="*)     includedir=${D}{ARG#--includedir=} ;;
         "--infodir="*)        infodir=${D}{ARG#--infodir=} ;;
         "--mandir"*)          mandir=${D}{ARG#--mandir} ;;
@@ -214,8 +215,8 @@
         "--debug")            BUILD_TYPE="debug" ;;
         "--release")          BUILD_TYPE="release" ;;
     #foreach( $opt in $options )
-        "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
-        "--${opt.argument}")  echo "option '$ARG' needs a value:"; echo "  $ARG=${opt.valuesString}"; abort_configure ;;
+        "--${opt.arg}="*) ${opt.varName}=${D}{ARG#--${opt.arg}=} ;;
+        "--${opt.arg}")  echo "option '$ARG' needs a value:"; echo "  $ARG=${opt.valuesString}"; abort_configure ;;
     #end
     #foreach( $feature in $features )
         "--enable-${feature.arg}") ${feature.varName}=on ;;
@@ -236,10 +237,28 @@
 : ${libexecdir:='${exec_prefix}/libexec'}
 : ${datarootdir:='${prefix}/share'}
 : ${datadir:='${datarootdir}'}
-: ${sysconfdir:='${prefix}/etc'}
 : ${sharedstatedir:='${prefix}/com'}
-: ${localstatedir:='${prefix}/var'}
-: ${runstatedir:='${localstatedir}/run'}
+if [ -z "$sysconfdir" ]; then
+    if [ "$prefix" = '/usr' ]; then
+        sysconfdir='/etc'
+    else
+        sysconfdir='${prefix}/etc'
+    fi
+fi
+if [ -z "$localstatedir" ]; then
+    if [ "$prefix" = '/usr' ]; then
+        localstatedir='/var'
+    else
+        localstatedir='${prefix}/var'
+    fi
+fi
+if [ -z "$runstatedir" ]; then
+    if [ "$prefix" = '/usr' ]; then
+        runstatedir='/var/run'
+    else
+        runstatedir='${prefix}/var'
+    fi
+fi
 : ${includedir:='${prefix}/include'}
 : ${infodir:='${datarootdir}/info'}
 : ${mandir:='${datarootdir}/man'}
@@ -651,9 +670,9 @@
 #end
 
 #foreach( $opt in $target.options )
-# Option: --${opt.argument}
+# Option: --${opt.arg}
 if [ -z "${D}${opt.varName}" ]; then
-    echo "auto-detecting option '${opt.argument}'"
+    echo "auto-detecting option '${opt.arg}'"
     SAVED_ERROR="$ERROR"
     SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
     ERROR=1
@@ -664,7 +683,7 @@
         if isplatform "$optdef.platform"; then
         #end
         if $optdef.func ; then
-            echo "  ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options"
+            echo "  ${opt.arg}: ${optdef.valueName}" >> "$TEMP_DIR/options"
             ERROR=0
             break
         fi
@@ -676,28 +695,28 @@
     done
     if [ $ERROR -ne 0 ]; then
         SAVED_ERROR=1
-        SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED"
+        SAVED_DEPENDENCIES_FAILED="option '${opt.arg}' $SAVED_DEPENDENCIES_FAILED"
     fi
     ERROR="$SAVED_ERROR"
     DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
 else
-    echo "checking option ${opt.argument} = ${D}${opt.varName}"
+    echo "checking option ${opt.arg} = ${D}${opt.varName}"
     if false; then
         false
     #foreach( $optval in $opt.values )
     elif [ "${D}${opt.varName}" = "${optval.value}" ]; then
-        echo "  ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options
+        echo "  ${opt.arg}: ${D}${opt.varName}" >> $TEMP_DIR/options
         if $optval.func ; then
             :
         else
             ERROR=1
-            DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED"
+            DEPENDENCIES_FAILED="option '${opt.arg}' $DEPENDENCIES_FAILED"
         fi
     #end
     else
         echo
         echo "Invalid option value - usage:"
-        echo "  --${opt.argument}=${opt.valuesString}"
+        echo "  --${opt.arg}=${opt.valuesString}"
         abort_configure
     fi
 fi

mercurial