configure: Test for -Wno-initializer-overrides
authorMatt Turner <mattst88@gmail.com>
Fri, 7 Jul 2017 05:19:15 +0000 (22:19 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 29 Aug 2017 22:20:57 +0000 (15:20 -0700)
Clang has "-Wno-initializer-overrides", while gcc has
"-Wno-override-init". Quiets a lot of warnings with clang.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
configure.ac
src/intel/Makefile.am

index 50876b08466d92b465dfc4437cf80337545350b1..ac64a38d4373b9bd319179a672ea6837286d2594 100644 (file)
@@ -339,6 +339,10 @@ esac
 AC_SUBST([VISIBILITY_CFLAGS])
 AC_SUBST([VISIBILITY_CXXFLAGS])
 
+AX_CHECK_COMPILE_FLAG([-Wno-override-init],                    [WNO_OVERRIDE_INIT="-Wno-override-init"])         # gcc
+AX_CHECK_COMPILE_FLAG([-Wno-initializer-overrides],            [WNO_OVERRIDE_INIT="-Wno-initializer-overrides"]) # clang
+AC_SUBST([WNO_OVERRIDE_INIT])
+
 dnl
 dnl Optional flags, check for compiler support
 dnl
index 9946f6752d0a1ae609c03d7081779c52e0b93f5e..a34e301449742a84759aad73fb52236c5147d492 100644 (file)
@@ -44,7 +44,7 @@ AM_CPPFLAGS = \
 
 AM_CFLAGS = \
        $(VISIBILITY_CFLAGS) \
-       -Wno-override-init
+       $(WNO_OVERRIDE_INIT)
 
 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)