|
From: Paul F. <pa...@so...> - 2022-04-19 20:22:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8187a60ac362a1efc4ce3244ef845ccb1fb2e18c commit 8187a60ac362a1efc4ce3244ef845ccb1fb2e18c Author: Paul Floyd <pj...@wa...> Date: Tue Apr 19 22:21:37 2022 +0200 Add a configure test for -ansi and use it for none/tests/ansi Diff: --- configure.ac | 18 ++++++++++++++++++ none/tests/Makefile.am | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c627a9c17a..eda617fc58 100755 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 2ac09e6202..727c2661bb 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -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 |