From 788f320f0bd4f78dc8281fc03203adbea6be2ff0 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 5 Mar 2015 13:32:35 +1100 Subject: [PATCH] configure: only use -Werror=vla on gcc >= 4.3 -Wvla was introduced with GCC 4.3 and is not present in 4.2. Fixes the build on OpenBSD. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89433 Signed-off-by: Jonathan Gray --- configure.ac | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 83c323a..f226f7a 100644 --- a/configure.ac +++ b/configure.ac @@ -271,8 +271,13 @@ if test "x$GCC" = xyes; then # - non-Linux/Posix OpenGL portions needs to build on MSVC 2013 (which # supports most of C99) # - the rest has no compiler compiler restrictions - MSVC2013_COMPAT_CFLAGS="-Werror=vla -Werror=pointer-arith" - MSVC2013_COMPAT_CXXFLAGS="-Werror=vla -Werror=pointer-arith" + if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 3 ; then + MSVC2013_COMPAT_CFLAGS="-Werror=pointer-arith" + MSVC2013_COMPAT_CXXFLAGS="-Werror=pointer-arith" + else + MSVC2013_COMPAT_CFLAGS="-Werror=vla -Werror=pointer-arith" + MSVC2013_COMPAT_CXXFLAGS="-Werror=vla -Werror=pointer-arith" + fi MSVC2008_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=declaration-after-statement" MSVC2008_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS" fi -- 2.3.0