From patchwork Tue May 10 14:32:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9058441 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 49D3C9F1C1 for ; Tue, 10 May 2016 14:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EFD420148 for ; Tue, 10 May 2016 14:29:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50319200E7 for ; Tue, 10 May 2016 14:29:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 982F26E66B; Tue, 10 May 2016 14:29:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 243C06E66B for ; Tue, 10 May 2016 14:29:22 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 10 May 2016 07:29:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,604,1455004800"; d="scan'208";a="950117406" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by orsmga001.jf.intel.com with ESMTP; 10 May 2016 07:29:13 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Tue, 10 May 2016 17:32:15 +0300 Message-Id: <1462890735-13599-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1462800224-29338-1-git-send-email-marius.c.vlad@intel.com> References: <1462800224-29338-1-git-send-email-marius.c.vlad@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] benchmarks/, overlay/, demos/, tools/, tests/: Add optional Werror. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v2: Initially added Werror by default. Make it optional so it doesn't break android build and (potential) distros maintaing the package (Hinted by Damien Lespiau). --enable-werror will enable -Werror compiler flag. Signed-off-by: Marius Vlad Acked-by: Damien Lespiau --- benchmarks/Makefile.am | 3 ++- configure.ac | 10 ++++++++++ demos/Makefile.am | 3 ++- overlay/Makefile.am | 3 ++- tests/Makefile.am | 2 +- tools/Makefile.am | 4 +++- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 2c2d100..49d2f64 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -2,7 +2,8 @@ include Makefile.sources AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) +AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \ + $(WERROR_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la benchmarks_LTLIBRARIES = gem_exec_tracer.la diff --git a/configure.ac b/configure.ac index 0589782..11b1d46 100644 --- a/configure.ac +++ b/configure.ac @@ -229,6 +229,11 @@ AC_ARG_ENABLE(debug, [Build tests without debug symbols]), [], [enable_debug=yes]) +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror], + [Fail on warnings]), + [], [enable_werror=no]) + if test "x$enable_debug" = xyes; then AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"]) AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives @@ -236,6 +241,10 @@ if test "x$enable_debug" = xyes; then AC_SUBST([DEBUG_CFLAGS]) fi +if test "x$enable_werror" = xyes; then + AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"]) +fi + # prevent relinking the world on every commit for developers AC_ARG_ENABLE(git-hash, AS_HELP_STRING([--disable-git-hash], @@ -313,6 +322,7 @@ echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overla echo " x86-specific tools : ${build_x86}" echo "" echo " • API-Documentation : ${enable_gtk_doc}" +echo " • Fail on warnings: : ${enable_werror}" echo "" # vim: set ft=config ts=8 sw=8 tw=0 noet : diff --git a/demos/Makefile.am b/demos/Makefile.am index e6fbb3b..f5725f4 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -3,5 +3,6 @@ bin_PROGRAMS = \ $(NULL) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) +AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la diff --git a/overlay/Makefile.am b/overlay/Makefile.am index c648875..c926557 100644 --- a/overlay/Makefile.am +++ b/overlay/Makefile.am @@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay endif AM_CPPFLAGS = -I. -AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) +AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS) LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS) intel_gpu_overlay_SOURCES = \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 45e3359..32b9115 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\ -include "$(srcdir)/../lib/check-ndebug.h" \ -DIGT_SRCDIR=\""$(abs_srcdir)"\" \ -DIGT_DATADIR=\""$(pkgdatadir)"\" \ - $(LIBUNWIND_CFLAGS) \ + $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \ $(NULL) LDADD = ../lib/libintel_tools.la $(GLIB_LIBS) diff --git a/tools/Makefile.am b/tools/Makefile.am index df48d94..5f45144 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,7 +3,9 @@ include Makefile.sources SUBDIRS = null_state_gen registers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" +AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \ + $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \ + $(WERROR_CFLAGS) LDADD = $(top_builddir)/lib/libintel_tools.la AM_LDFLAGS = -Wl,--as-needed