test/configure

changeset 165
f4f11f755ee7
parent 161
3d1cd23f88f7
child 167
fa31a6d0ec56
--- a/test/configure	Sat Nov 29 13:50:15 2025 +0100
+++ b/test/configure	Sat Nov 29 17:31:03 2025 +0100
@@ -85,27 +85,40 @@
 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]
+    echo 'Configuration:'
+if true \
+      ; then
+    :
+    if test -z "$prefix__described__"; then
+        prefix__described__=1
+        cat << '__EOF__'
+  --prefix                path prefix for architecture-independent files [/usr]
+__EOF__
+    fi
+    if test -z "$exec_prefix__described__"; then
+        exec_prefix__described__=1
+        cat << '__EOF__'
+  --exec-prefix           path prefix for architecture-dependent files [PREFIX]
+__EOF__
+    fi
+    if test -z "$libdir__described__"; then
+        libdir__described__=1
+        cat << '__EOF__'
+  --libdir                object code libraries [EPREFIX/lib]
+__EOF__
+    fi
+fi
+if true \
+      && notisplatform "mingw" \
+      ; then
+    :
+fi
+if true \
+    && isplatform "mingw" \
+      ; then
+    :
+fi
+    cat << '__EOF__'
 
 Build Types:
   --debug                 add extra compile flags for debug builds
@@ -115,6 +128,7 @@
   --disable-pg
 
 __EOF__
+    abort_configure
 }
 
 # create temporary directory
@@ -130,39 +144,32 @@
 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
+# config variables
+if true \
+      ; then
+    :
+    if test -z "$prefix__initialized__"; then
+        prefix__initialized__=1
+        prefix="/usr"
+    fi
+    if test -z "$exec_prefix__initialized__"; then
+        exec_prefix__initialized__=1
+        exec_prefix=""
+    fi
+    if test -z "$libdir__initialized__"; then
+        libdir__initialized__=1
+        libdir=""
+    fi
+fi
 if true \
       && notisplatform "mingw" \
       ; then
-    PWD="pwd"
+    :
 fi
 if true \
     && isplatform "mingw" \
       ; then
-    PWD="pwd -W"
-fi
-if true \
-      ; then
-    HOST=`uname -n`
+    :
 fi
 
 # features
@@ -175,25 +182,12 @@
 for ARG in "$@"
 do
     case "$ARG" in
-        "--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=} ;;
-        "--runstatedir="*)    runstatedir=${ARG#--runstatedir=} ;;
-        "--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" ;;
+        "--prefix="*) prefix=${ARG#--prefix=} ;;
+        "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;;
+        "--libdir="*) libdir=${ARG#--libdir=} ;;
+        "--help"*) printhelp ;;
+        "--debug") BUILD_TYPE="debug" ;;
+        "--release") BUILD_TYPE="release" ;;
         "--enable-pg") FEATURE_PG=on ;;
         "--disable-pg") unset FEATURE_PG ;;
         "-"*) echo "unknown option: $ARG"; abort_configure ;;
@@ -237,22 +231,6 @@
 : ${mandir:='${datarootdir}/man'}
 : ${localedir:='${datarootdir}/locale'}
 
-# remember the above values and compare them later
-orig_bindir="$bindir"
-orig_sbindir="$sbindir"
-orig_libdir="$libdir"
-orig_libexecdir="$libexecdir"
-orig_datarootdir="$datarootdir"
-orig_datadir="$datadir"
-orig_sysconfdir="$sysconfdir"
-orig_sharedstatedir="$sharedstatedir"
-orig_localstatedir="$localstatedir"
-orig_runstatedir="$runstatedir"
-orig_includedir="$includedir"
-orig_infodir="$infodir"
-orig_mandir="$mandir"
-orig_localedir="$localedir"
-
 # check if a config.site exists and load it
 if [ -n "$CONFIG_SITE" ]; then
     # CONFIG_SITE may contain space separated file names
@@ -298,20 +276,8 @@
 cat > "$TEMP_DIR/vars.mk" << __EOF__
 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
+HOST=$HOST
 __EOF__
 
 # toolchain detection utilities
@@ -681,7 +647,7 @@
 
 echo "configure finished"
 echo
-echo "Toolchain"
+echo "Toolchain:"
 echo "  name:           $TOOLCHAIN_NAME"
 if [ -n "$TOOLCHAIN_CC" ]; then
     echo "  cc:             $TOOLCHAIN_CC"
@@ -696,57 +662,20 @@
     echo "  default C std:  $TOOLCHAIN_CSTD"
 fi
 echo
-echo "Build Config:"
-echo "  prefix:         $prefix"
-echo "  exec_prefix:    $exec_prefix"
-if [ "$orig_bindir" != "$bindir" ]; then
-    echo "  bindir:      $bindir"
-fi
-if [ "$orig_sbindir" != "$sbindir" ]; then
-    echo "  sbindir:     $sbindir"
-fi
-if [ "$orig_libdir" != "$libdir" ]; then
-    echo "  libdir:         $libdir"
-fi
-if [ "$orig_libexecdir" != "$libexecdir" ]; then
-    echo "  libexecdir:     $libexecdir"
-fi
-if [ "$orig_datarootdir" != "$datarootdir" ]; then
-    echo "  datarootdir:    $datarootdir"
-fi
-if [ "$orig_datadir" != "$datadir" ]; then
-    echo "  datadir:        $datadir"
-fi
-if [ "$orig_sysconfdir" != "$sysconfdir" ]; then
-    echo "  sysconfdir:     $sysconfdir"
-fi
-if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then
-    echo "  sharedstatedir: $sharedstatedir"
-fi
-if [ "$orig_localstatedir" != "$localstatedir" ]; then
-    echo "  localstatedir:  $localstatedir"
-fi
-if [ "$orig_runstatedir" != "$runstatedir" ]; then
-    echo "  runstatedir:    $runstatedir"
-fi
-if [ "$orig_includedir" != "$includedir" ]; then
-    echo "  includedir:     $includedir"
-fi
-if [ "$orig_infodir" != "$infodir" ]; then
-    echo "  infodir:        $infodir"
-fi
-if [ "$orig_mandir" != "$mandir" ]; then
-    echo "  mandir:         $mandir"
-fi
-if [ "$orig_localedir" != "$localedir" ]; then
-    echo "  localedir:      $localedir"
-fi
+echo "Config:"
+    printf '  %-16s' 'prefix:'
+    echo "$prefix"
+    printf '  %-16s' 'exec-prefix:'
+    echo "$exec_prefix"
+    printf '  %-16s' 'libdir:'
+    echo "$libdir"
 echo
 echo "Features:"
+printf '  %-16s' 'pg:'
 if [ -n "$FEATURE_PG" ]; then
-echo "  pg: on"
+    echo 'on'
 else
-echo "  pg: off"
+    echo 'off'
 fi
 echo
 

mercurial