]> git.cworth.org Git - glaze/commitdiff
Add hard-coded library directory paths for systems without --print-multiarch
authorCarl Worth <cworth@cworth.org>
Thu, 29 Aug 2013 22:35:18 +0000 (15:35 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 29 Aug 2013 22:40:09 +0000 (15:40 -0700)
Apparently, the very convenient "gcc --print-multiarch" option is something
that Debian and Ubuntu have patched into gcc.

For other systems, we hard-code either "i386-linux-gnu" or
"x86_64-linux-gnu" and warn the user to fix things up if those are
wrong.

configure

index 4df846b278b113b63d0d8cf0d4e021f565c3bd0a..d53522930009126a17aff731207bbdd1e211389f 100755 (executable)
--- a/configure
+++ b/configure
@@ -180,7 +180,16 @@ then
     printf "   Target directory for 32-bit targets... "
 
     lib32_dir=$(gcc -m32 --print-multiarch)
-    printf "${lib32_dir}\n"
+
+    if [ "$lib32_dir" = "" ]; then
+       lib32_dir="i386-linux-gnu"
+       printf "\n\n"
+       printf "\t\t*** Warning: Failed to query target directory.\n"
+       printf "\t\tHard-coding to $lib32_dir\n"
+       printf "\t\tFix  LIB32_DIR in Makefile.config as needed.\n\n"
+    else
+       printf "${lib32_dir}\n"
+    fi
 
 else
     printf "No.\n"
@@ -196,7 +205,16 @@ then
     printf "   Target directory for 64-bit targets... "
 
     lib64_dir=$(gcc -m64 --print-multiarch)
-    printf "${lib64_dir}\n"
+
+    if [ "$lib64_dir" = "" ]; then
+       lib64_dir="x86_64-linux-gnu"
+       printf "\n\n"
+       printf "\t\t*** Warning: Failed to query target directory.\n"
+       printf "\t\tHard-coding to $lib64_dir\n"
+       printf "\t\tFix LIB64_DIR in Makefile.config as needed.\n\n"
+    else
+       printf "${lib64_dir}\n"
+    fi
 
 else
     printf "No.\n"