configure

changeset 607
cfcc3fb12d7d
parent 573
2360c1696a34
child 647
e93dc5b1da07
--- a/configure	Thu Jun 05 19:29:04 2025 +0200
+++ b/configure	Fri Jun 06 12:31:09 2025 +0200
@@ -58,6 +58,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"
@@ -202,6 +203,22 @@
 : ${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
@@ -218,6 +235,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
 
 
@@ -645,6 +684,7 @@
         cat >> "$TEMP_DIR/make.mk" << __EOF__
 OBJ_EXT = .o
 LIB_EXT = .a
+SHLIB_EXT = .dylib
 LIB_PREFIX = lib
 PACKAGE_SCRIPT = package_osx.sh
 __EOF__
@@ -666,6 +706,7 @@
         cat >> "$TEMP_DIR/make.mk" << __EOF__
 OBJ_EXT = .o
 LIB_EXT = .a
+SHLIB_EXT = .so
 LIB_PREFIX = lib
 PACKAGE_SCRIPT = package_unix.sh
 __EOF__
@@ -690,12 +731,12 @@
 
 # build type
 if [ "$BUILD_TYPE" = "debug" ]; then
-    TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS"
-    TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS"
+    TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS"
+    TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS"
 fi
 if [ "$BUILD_TYPE" = "release" ]; then
-    TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS"
-    TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS"
+    TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS"
+    TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS"
 fi
 
 # add general dependency flags to flags.mk
@@ -1030,9 +1071,67 @@
 
 echo "configure finished"
 echo
+echo "Toolchain"
+echo "  name:           $TOOLCHAIN_NAME"
+if [ -n "$TOOLCHAIN_CC" ]; then
+    echo "  cc:             $TOOLCHAIN_CC"
+fi
+if [ -n "$TOOLCHAIN_CXX" ]; then
+    echo "  cxx:            $TOOLCHAIN_CXX"
+fi
+if [ -n "$TOOLCHAIN_WSIZE" ]; then
+    echo "  word size:      $TOOLCHAIN_WSIZE bit"
+fi
+if [ -n "$TOOLCHAIN_CSTD" ]; then
+    echo "  default C std:  $TOOLCHAIN_CSTD"
+fi
+echo
 echo "Build Config:"
-echo "  PREFIX:      $prefix"
-echo "  TOOLCHAIN:   $TOOLCHAIN_NAME"
+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
 echo "Options:"
 cat "$TEMP_DIR/options"
 echo

mercurial