diff options
author | Peter Pentchev <roam@ringlet.net> | 2021-11-27 00:40:40 +0200 |
---|---|---|
committer | Michal Domonkos <mdomonko@redhat.com> | 2022-07-01 10:52:14 +0200 |
commit | 42fae2fa5bce5bf1ef5685619fa8d62a746c9dbd (patch) | |
tree | cb6fe0faa46b3cdd71cfb0fee3638e309a710e32 | |
parent | 63a45b6eeab91e4874abc88e36973f14c9c7b96e (diff) | |
download | rpm-42fae2fa5bce5bf1ef5685619fa8d62a746c9dbd.tar.gz |
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)
-rw-r--r-- | configure.ac | 13 |
1 files 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}" |