summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-11 04:34:20 +0000
committermidipix <writeonce@midipix.org>2021-06-11 04:34:20 +0000
commit799bfafd4246c7b348ce9f44023fe7ce09bd42da (patch)
treec9a582a8e51ceb94e426ab60ffecbfea40616f3c /src
parent4850147c4017dc3713250b32caabc89d20473381 (diff)
downloadbautomake-799bfafd4246c7b348ce9f44023fe7ce09bd42da.tar.bz2
bautomake-799bfafd4246c7b348ce9f44023fe7ce09bd42da.tar.xz
config.guess: utilize slibtool's --dumpmachine feature.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/config.guess19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/config.guess b/src/config.guess
index 34469b5..dd6bd39 100755
--- a/src/config.guess
+++ b/src/config.guess
@@ -1,7 +1,9 @@
#!/bin/sh
# config.guess: an alternate implementation for modern (cross-)systems.
-# modern-hosts: native compiler must support the -dumpmachine argument.
+# modern-hosts: machine detection either via slibtool's --dumpmachine
+# output, or by way of a native compiler that implements
+# the -dumpmachine switch.
# this file is covered by COPYING.BAUTOMAKE.
@@ -21,7 +23,7 @@ set -eu
mb_script="$0"
mb_status=1
-mb_dstamp='2020-01-18'
+mb_dstamp='2021-06-11'
mb_target=
mb_extarg="${1:-}"
@@ -43,7 +45,8 @@ config_usage()
>&2
printf '\nThis is an alternate config.guess implementation for modern (cross-)systems.' >&2
- printf '\nThe priority native compiler must support the -dumpmachine argument.\n\n' >&2
+ printf '\nA native system is identified either via `slibtool --dumpmachine`, or by way' >&2
+ printf '\n of the -dumpmachine output of its priority native compiler.\n\n' >&2
printf 'Native compilers are tried in the following order:\n' >&2
printf '\t%s\n' '$NATIVE_CC' '$CC_FOR_BUILD' 'c99' 'cc' 'ucc' 'gcc' 'clang' 'cparser' >&2
@@ -93,6 +96,16 @@ if [ -n "$mb_extarg" ]; then
fi
+# try slibtool
+if command -v slibtool > /dev/null 2>&1; then
+ mb_target=$(slibtool --dumpmachine 2>/dev/null || true)
+
+ if [ -n "$mb_target" ]; then
+ config_output
+ fi
+fi
+
+
# explicit
mb_native_cc="${NATIVE_CC:-false}"
mb_cc_for_build="${CC_FOR_BUILD:-false}"