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}"