m68k: Use an autoconf template to produce `preconfigure'

Switch to using AC_MSG_ERROR rather than `echo' and `exit' directly for
error handling.  Owing to the lack of any kind of error annotation it
makes it difficult to spot the message in the flood in a parallel build
and neither it is logged in `config.log'.
This commit is contained in:
Maciej W. Rozycki 2022-05-13 17:07:23 +01:00
parent 7c20479d08
commit fe7dd93db3
2 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,6 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local preconfigure fragment for sysdeps/m68k
# This fragment canonicalizes the machine names for m68k variants. # This fragment canonicalizes the machine names for m68k variants.
case "$machine" in case "$machine" in
@ -10,8 +13,7 @@ m68k) variant=`(echo "#ifdef __mcoldfire__"
$CC $CFLAGS $CPPFLAGS -E - | $CC $CFLAGS $CPPFLAGS -E - |
grep '^[a-z]'` grep '^[a-z]'`
if test -z "$variant"; then if test -z "$variant"; then
echo >&2 "Cannot determine m68k processor variant" as_fn_error 1 "Cannot determine m68k processor variant" "$LINENO" 5
exit 1
fi fi
base_machine=m68k machine=m68k/$variant base_machine=m68k machine=m68k/$variant
if test "$variant" = "coldfire"; then if test "$variant" = "coldfire"; then

View File

@ -0,0 +1,23 @@
GLIBC_PROVIDES[]dnl See aclocal.m4 in the top level source directory.
# Local preconfigure fragment for sysdeps/m68k
# This fragment canonicalizes the machine names for m68k variants.
case "$machine" in
m680?0) base_machine=m68k machine=m68k/m680x0/$machine ;;
m68k) variant=`(echo "#ifdef __mcoldfire__"
echo "coldfire"
echo "#else"
echo "m680x0/m68020"
echo "#endif") |
$CC $CFLAGS $CPPFLAGS -E - |
grep '^[[a-z]]'`
if test -z "$variant"; then
AC_MSG_ERROR([Cannot determine m68k processor variant], [1])
fi
base_machine=m68k machine=m68k/$variant
if test "$variant" = "coldfire"; then
with_fp_cond="defined __mcffpu__"
fi
;;
esac