]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a configure test for -ansi and use it for none/tests/ansi
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 19 Apr 2022 20:21:37 +0000 (22:21 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 19 Apr 2022 20:21:37 +0000 (22:21 +0200)
configure.ac
none/tests/Makefile.am

index c627a9c17a4a35ff3fa88c5fddf3d4fc0d957f2a..eda617fc5831cb2aead71cea8e12ffcc9469946a 100755 (executable)
@@ -2900,6 +2900,24 @@ AC_MSG_RESULT([no])
 ])
 CFLAGS=$safe_CFLAGS
 
+AC_MSG_CHECKING([if gcc accepts -ansi])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-ansi"
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+   return 0;
+]])], [
+ac_have_ansi=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_ansi=no
+AC_MSG_RESULT([no])
+])
+AM_CONDITIONAL([HAVE_ANSI], [test x$ac_have_ansi = xyes])
+
+CFLAGS=$safe_CFLAGS
+
 
 # Does this compiler support -no-pie?
 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
index 2ac09e6202082890f464c556c03da875b351dbf4..727c2661bb6ebf7b7ced313c12907db2e166758d 100644 (file)
@@ -282,8 +282,8 @@ if ! VGCONF_OS_IS_DARWIN
    check_PROGRAMS += ppoll_alarm
 endif
 
-# clang does not know -ansi
-if ! COMPILER_IS_CLANG
+# older (?) clang does not know -ansi
+if HAVE_ANSI
    check_PROGRAMS += ansi
 endif