test/configure

branch
configure-evo
changeset 54
2b8f40c58944
parent 53
704368f1bb23
child 60
43d6680e6410
--- a/test/configure	Fri Sep 15 11:33:35 2023 +0200
+++ b/test/configure	Fri Sep 15 14:06:50 2023 +0200
@@ -1,9 +1,20 @@
 #!/bin/sh
 
+failed()
+{
+    $@
+    if [ $? -ne 0 ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+
 # create temporary directory
 TEMP_DIR=".tmp-`uname -n`"
 rm -Rf "$TEMP_DIR"
-if ! mkdir -p "$TEMP_DIR"; then
+if failed mkdir -p "$TEMP_DIR"; then
     echo "Cannot create tmp dir $TEMP_DIR"
     echo "Abort"
     exit 1
@@ -28,7 +39,7 @@
 
 # custom variables
 HOST=`uname -n`
-PREFIX=$(pwd)/work
+PREFIX=`pwd`/work
 INSTALL_DIR=$PREFIX
 
 # features
@@ -191,6 +202,7 @@
     abort_configure
 fi
 
+
 #
 # DEPENDENCIES
 #
@@ -207,7 +219,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if ! $PKG_CONFIG libpq ; then
+        if failed $PKG_CONFIG libpq ; then
             break
         fi
         TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`"
@@ -228,7 +240,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if ! $PKG_CONFIG openssl ; then
+        if failed $PKG_CONFIG openssl ; then
             break
         fi
         TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`"
@@ -240,7 +252,7 @@
     # dependency openssl platform="bsd"
     while true
     do
-        if ! isplatform "bsd"; then
+        if failed isplatform "bsd"; then
             break
         fi
         TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
@@ -257,7 +269,7 @@
     # dependency libxml2 platform="macos"
     while true
     do
-        if ! isplatform "macos"; then
+        if failed isplatform "macos"; then
             break
         fi
         if tmp_flags=`xml2-config --cflags` ; then
@@ -280,7 +292,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if ! $PKG_CONFIG libxml-2.0 ; then
+        if failed $PKG_CONFIG libxml-2.0 ; then
             break
         fi
         TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`"
@@ -329,11 +341,11 @@
 TEMP_CFLAGS=
 TEMP_LDFLAGS=
 
-if ! dependency_libxml2; then
+if failed dependency_libxml2; then
     DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 "
     ERROR=1
 fi
-if ! dependency_openssl; then
+if failed dependency_openssl; then
     DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
     ERROR=1
 fi
@@ -341,7 +353,7 @@
 # Features
 if [ -n "$FEATURE_PG" ]; then
     # check dependency
-    if ! dependency_libpq ; then
+    if failed dependency_libpq ; then
         # "auto" features can fail and are just disabled in this case
         if [ "$FEATURE_PG" = "auto" ]; then
             unset FEATURE_PG

mercurial