]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: SVE ACLE configure test cleanups
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 4 May 2023 09:14:43 +0000 (10:14 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 5 May 2023 09:28:29 +0000 (10:28 +0100)
Use more idiomatic configure test for better autoconf cache and logs.

sysdeps/aarch64/configure
sysdeps/aarch64/configure.ac

index d0d78d69f1da8bf0cb64c200a4ed57ac4ff41a50..030996c55abc7b56831d134330b785997192a1c5 100644 (file)
@@ -335,18 +335,26 @@ fi
 # Check if compiler is sufficient to build mathvec (needs SVE ACLE)
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for availability of SVE ACLE" >&5
 $as_echo_n "checking for availability of SVE ACLE... " >&6; }
-if ${libc_cv_has_sve_acle+:} false; then :
+if ${libc_cv_aarch64_sve_acle+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    if test $build_mathvec = yes; then
     cat > conftest.c <<EOF
 #include <arm_sve.h>
 EOF
-    if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then
-      as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)."
-    fi
-    rm conftest.c
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    libc_cv_aarch64_sve_acle=yes
+  else
+    libc_cv_aarch64_sve_acle=no
   fi
+  rm conftest.c
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_sve_acle" >&5
+$as_echo "$libc_cv_aarch64_sve_acle" >&6; }
+if test $build_mathvec = yes && test $libc_cv_aarch64_sve_acle = no; then
+  as_fn_error $? "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)." "$LINENO" 5
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_sve_acle" >&5
-$as_echo "$libc_cv_has_sve_acle" >&6; }
index 259edc3de8df017689a466ef69ab71cd7fd31b9d..76f78fcba90f45f7560fc4429ce0c2bf0e58ef79 100644 (file)
@@ -107,13 +107,16 @@ if test x"$build_mathvec" = xnotset; then
 fi
 
 # Check if compiler is sufficient to build mathvec (needs SVE ACLE)
-AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_has_sve_acle, [dnl
-  if test $build_mathvec = yes; then
-    cat > conftest.c <<EOF
+AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_aarch64_sve_acle, [dnl
+  cat > conftest.c <<EOF
 #include <arm_sve.h>
 EOF
-    if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then
-      as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)."
-    fi
-    rm conftest.c
-  fi])
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c]); then
+    libc_cv_aarch64_sve_acle=yes
+  else
+    libc_cv_aarch64_sve_acle=no
+  fi
+  rm conftest.c])
+if test $build_mathvec = yes && test $libc_cv_aarch64_sve_acle = no; then
+  AC_MSG_ERROR([mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI).])
+fi