make/configure.vm

changeset 69
f70ba8f14b41
parent 45
2cb7fdd2ba18
--- a/make/configure.vm	Thu Oct 09 10:58:12 2025 +0200
+++ b/make/configure.vm	Tue Nov 04 22:26:27 2025 +0100
@@ -59,6 +59,7 @@
 # $PLATFORM is used for platform dependent dependency selection
 OS=`uname -s`
 OS_VERSION=`uname -r`
+ARCH=`uname -m`
 printf "detect platform... "
 if [ "$OS" = "SunOS" ]; then
     PLATFORM="solaris sunos unix svr4"
@@ -276,6 +277,28 @@
     printf "loading site defaults... "
     . "$prefix/etc/config.site"
     echo ok
+else
+    # try to detect the correct libdir on our own, except it was changed by the user
+    if test "$libdir" = '${exec_prefix}/lib'; then
+        if [ "$OS" = "SunOS" ]; then
+            test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64'
+        else
+            # check if the standard libdir even exists
+            if test -d "${exec_prefix}/lib" ; then
+                :
+            else
+                # if it does not, maybe a lib32 exists
+                test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
+            fi
+            # now check if there is a special 64bit libdir that we should use
+            for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do
+                if [ $ARCH = $i ]; then
+                    test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64'
+                    break
+                fi
+            done
+        fi
+    fi
 fi
 ]]#
 ## End of unparsed content **
@@ -377,7 +400,7 @@
         fi
         #end
         #foreach( $test in $sub.tests )
-        if $test > /dev/null ; then
+        if $test > /dev/null 2>&1 ; then
             :
         else
             break
@@ -479,7 +502,6 @@
 
         #foreach( $flags in $dependency.flags )
         #if( $flags.exec )
-        $flags.value > /dev/null
         if tmp_flags=`$flags.value` ; then
             TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
         else

mercurial