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"
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"
EOF
+# construct config.h
+QQ='"'
+cat > config.h <<EOF
+/* Generated by configure */
+
+/* The prefix to which ${PROJECT} should be installed */
+#define CONFIG_PREFIX "${PREFIX}"
+
+/* The directory to which libraries should be installed */
+#define CONFIG_LIBDIR "${LIBDIR:-${QQ} CONFIG_PREFIX ${QQ}/lib}"
+
+/* The directory to which executables should be installed */
+#define CONFIG_BINDIR "${BINDIR:-${QQ} CONFIG_PREFIX ${QQ}/bin}"
+
+EOF
+
# construct the glaze.pc file
cat > glaze.pc <<EOF
prefix=${PREFIX}