Skip to content

Commit

Permalink
Strip the target triplet GNU suffix more precisely.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ppentchev authored and ffesti committed Jan 18, 2022
1 parent e6277e4 commit 1cdb72a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -857,24 +857,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}"
Expand Down

0 comments on commit 1cdb72a

Please sign in to comment.