diff mbox series

[v2,2/4] m68k: Use an autoconf template to produce `preconfigure'

Message ID alpine.DEB.2.20.2205122257100.10833@tpp.orcam.me.uk
State New
Headers show
Series Avoid relying on autoconf internals in `preconfigure' scripts | expand

Commit Message

Maciej W. Rozycki May 12, 2022, 10:28 p.m. UTC
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'.
---
New change in v2.
---
 sysdeps/m68k/preconfigure    |    6 ++++--
 sysdeps/m68k/preconfigure.ac |   23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

glibc-m68k-preconfigure-as-fn-error.diff

Comments

Andreas Schwab May 13, 2022, 8:12 a.m. UTC | #1
On Mai 12 2022, Maciej W. Rozycki wrote:

> 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'.

Ok.
diff mbox series

Patch

Index: glibc/sysdeps/m68k/preconfigure
===================================================================
--- glibc.orig/sysdeps/m68k/preconfigure
+++ glibc/sysdeps/m68k/preconfigure
@@ -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.
 
 case "$machine" in
@@ -10,8 +13,7 @@  m68k)		variant=`(echo "#ifdef __mcoldfir
 			 $CC $CFLAGS $CPPFLAGS -E - |
 			 grep '^[a-z]'`
 		if test -z "$variant"; then
-		  echo >&2 "Cannot determine m68k processor variant"
-		  exit 1
+		  as_fn_error 1 "Cannot determine m68k processor variant" "$LINENO" 5
 		fi
 		base_machine=m68k machine=m68k/$variant
 		if test "$variant" = "coldfire"; then
Index: glibc/sysdeps/m68k/preconfigure.ac
===================================================================
--- /dev/null
+++ glibc/sysdeps/m68k/preconfigure.ac
@@ -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