test/configure

changeset 16
4fac0e25ee04
parent 15
971ac4f0f1df
child 18
0df7309d498e
child 19
e05f3e8ec2cb
--- a/test/configure	Sat Oct 24 17:36:00 2020 +0200
+++ b/test/configure	Sat Nov 14 20:43:14 2020 +0100
@@ -67,40 +67,25 @@
 #
 for ARG in $@
 do
-    if [[ $ARG == --prefix=* ]]; then
-        PREFIX=${ARG:9}
-    elif [[ $ARG = --exec-prefix=* ]]; then
-    	EPREFIX=${ARG:14}
-    elif [[ $ARG = --bindir=* ]]; then
-    	BINDIR=${ARG:9}
-    elif [[ $ARG = --sbindir=* ]]; then
-    	SBINDIR=${ARG:10}
-    elif [[ $ARG = --libdir=* ]]; then
-    	LIBDIR=${ARG:9}
-    elif [[ $ARG = --libexecdir=* ]]; then
-    	LIBEXECDIR=${ARG:13}
-    elif [[ $ARG = --datadir=* ]]; then
-    	DATADIR=${ARG:10}
-    elif [[ $ARG = --sysconfdir=* ]]; then
-    	SYSCONFDIR=${ARG:13}
-    elif [[ $ARG = --sharedstatedir=* ]]; then
-    	SHAREDSTATEDIR=${ARG:17}
-    elif [[ $ARG = --localstatedir=* ]]; then
-    	LOCALSTATEDIR=${ARG:16}
-    elif [[ $ARG = --includedir=* ]]; then
-    	INCLUDEDIR=${ARG:12}
-    elif [[ $ARG = --infodir=* ]]; then
-    	INFODIR=${ARG:10}
-    elif [[ $ARG = --mandir=* ]]; then
-    	MANDIR=${ARG:9}
-    elif [ $ARG = "--help" ]; then
-		printhelp
-        exit 0	
-    elif [[ $ARG == --enable-pg ]]; then
-    	FEATURE_PG=on
-    elif [[ $ARG == --disable-pg ]]; then
-    	unset FEATURE_PG
-    fi
+    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} ;;
+		"--help"*) printhelp; exit 1 ;;
+		"--enable-pg") FEATURE_PG=on ;;
+		"--disable-pg") unset FEATURE_PG ;;
+		"-"*) echo "unknown option: $ARG"; exit 1 ;;
+	esac
 done
 
 # set dir variables

mercurial