From: Paul Floyd Date: Tue, 19 Apr 2022 20:21:37 +0000 (+0200) Subject: Add a configure test for -ansi and use it for none/tests/ansi X-Git-Tag: VALGRIND_3_20_0~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8187a60ac362a1efc4ce3244ef845ccb1fb2e18c;p=thirdparty%2Fvalgrind.git Add a configure test for -ansi and use it for none/tests/ansi --- 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