From 42fae2fa5bce5bf1ef5685619fa8d62a746c9dbd Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Sat, 27 Nov 2021 00:40:40 +0200 Subject: Strip the target triplet GNU suffix more precisely. Make the regular expressions more precise (anchor them to the end of the input string), and try to catch any future unrecognized target triplets by checking for a "-gnu" part left over after the known variants were supposedly stripped. (cherry picked from commit 1cdb72ae48b7ba689c5c79118f4f0c1b4ffe6b7c) --- configure.ac | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 312cbe8f5..3fa1be3b8 100644 --- a/configure.ac +++ b/configure.ac @@ -830,24 +830,27 @@ AC_DEFINE_UNQUOTED([GID_0_GROUP],["$group_with_gid0"],[Get the group name having # get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os # host_os_gnu=-gnu -if echo "$host_os" | grep '.*-gnulibc1' > /dev/null ; then +if echo "$host_os" | grep '.*-gnulibc1$' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnulibc1$//'` fi -if echo "$host_os" | grep '.*-gnueabihf' > /dev/null ; then +if echo "$host_os" | grep '.*-gnueabihf$' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnueabihf$//'` host_os_gnu=-gnueabihf fi -if echo "$host_os" | grep '.*-gnueabi' > /dev/null ; then +if echo "$host_os" | grep '.*-gnueabi$' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnueabi$//'` host_os_gnu=-gnueabi fi -if echo "$host_os" | grep '.*-gnuabi64' > /dev/null ; then +if echo "$host_os" | grep '.*-gnuabi64$' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnuabi64$//'` host_os_gnu=-gnuabi64 fi -if echo "$host_os" | grep '.*-gnu' > /dev/null ; then +if echo "$host_os" | grep '.*-gnu$' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnu$//'` fi +if echo "$host_os" | grep '.*-gnu[[^-]]*$' > /dev/null ; then + AC_MSG_ERROR([unrecognized GNU build triplet $host_os]) +fi changequote(<, >) host_os_exact="${host_os}" -- cgit v1.2.1