about summary refs log tree commit diff
path: root/sysdeps/csky/preconfigure
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@embecosm.com>2022-05-13 17:07:23 +0100
committerMaciej W. Rozycki <macro@embecosm.com>2022-05-13 17:07:23 +0100
commit7c20479d082eb85ac1179df0411ef3e4a0634298 (patch)
tree9e3585841d3fd377c65b7d1343678d4ef58126d3 /sysdeps/csky/preconfigure
parentf39ff483f320878b2a2950353d05747eae623216 (diff)
downloadglibc-7c20479d082eb85ac1179df0411ef3e4a0634298.tar.gz
glibc-7c20479d082eb85ac1179df0411ef3e4a0634298.tar.xz
glibc-7c20479d082eb85ac1179df0411ef3e4a0634298.zip
C-SKY: Use an autoconf template to produce `preconfigure'
Avoid fiddling with autoconf internals and use AC_DEFINE_UNQUOTED to
define macros in the configuration headers rather than handcoding an
equivalent shell sequence with the use of the `as_echo' undocumented
variable.

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'.
Diffstat (limited to 'sysdeps/csky/preconfigure')
-rw-r--r--sysdeps/csky/preconfigure27
1 files changed, 17 insertions, 10 deletions
diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure
index 5f22416f95..8a6136dd8d 100644
--- a/sysdeps/csky/preconfigure
+++ b/sysdeps/csky/preconfigure
@@ -1,3 +1,6 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+# Local preconfigure fragment for sysdeps/csky
+
 case "$machine" in
 csky*)
     abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
@@ -11,16 +14,14 @@ csky*)
 
     case "$abi" in
     1)
-        echo "glibc does not support abiv1 yet" >&2
-        exit 1
-        ;;
+	as_fn_error 1 "glibc does not support abiv1 yet" "$LINENO" 5
+	;;
     2)
-        machine=abiv2
-        ;;
+	machine=abiv2
+	;;
     *)
-        echo "Unknown abi" >&2
-        exit 1
-        ;;
+	as_fn_error 1 "Unknown abi" "$LINENO" 5
+	;;
     esac
 
     # __CSKY_HARD_FLOAT_ABI__ was added on gcc 11 to specify whether
@@ -48,7 +49,13 @@ csky*)
     base_machine=csky
     machine=csky/$machine
 
-    $as_echo "#define CSKYABI $abi" >>confdefs.h
-    $as_echo "#define CSKY_HARD_FLOAT $with_fp_cond" >>confdefs.h
+    cat >>confdefs.h <<_ACEOF
+#define CSKYABI $abi
+_ACEOF
+
+    cat >>confdefs.h <<_ACEOF
+#define CSKY_HARD_FLOAT $with_fp_cond
+_ACEOF
+
     ;;
 esac