Repository: mesos
Updated Branches:
  refs/heads/master a31dd52ab -> 3587ca14c


Added configure flag to disable fatal errors.

This commits adds a configure option '--disable-werror' which can be
used to disable the use of '-Werror'.

Review: https://reviews.apache.org/r/60000/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d03c650c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d03c650c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d03c650c

Branch: refs/heads/master
Commit: d03c650c9ad47c4ce6c5844dfa2260c8bdf643da
Parents: a31dd52
Author: Benjamin Bannier <benjamin.bann...@mesosphere.io>
Authored: Wed Aug 9 18:38:19 2017 +0200
Committer: Till Toenshoff <toensh...@me.com>
Committed: Wed Aug 9 18:38:19 2017 +0200

----------------------------------------------------------------------
 configure.ac          | 11 +++++++++++
 docs/configuration.md |  8 ++++++++
 src/Makefile.am       |  2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d03c650c/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5a6e42c..9e588fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,6 +284,11 @@ AC_ARG_ENABLE([parallel_test_execution],
                              [execute tests in parallel where possible]),
             [], [enable_parallel_test_execution=no])
 
+AC_ARG_ENABLE([werror],
+              AS_HELP_STRING([--disable-werror],
+                             [do not treat compiler warnings as fatal errors]))
+
+
 ###############################################################################
 # Optional packages.
 ###############################################################################
@@ -677,6 +682,12 @@ AS_IF([test "x$enable_parallel_test_execution" = "xyes"],
       [AC_SUBST([TEST_DRIVER],
        '${abs_top_srcdir}/support/mesos-gtest-runner.py'[' 
--sequential='*ROOT_*'']]))
 
+# Define `WERROR` if the use of `-Werror` was not disabled, leave
+# unset otherwise. An unset variable evaluates to an empty string
+# in autoconf's substitution.
+AS_IF([test "x$enable_werror" != "xno"],
+      [AC_SUBST([WERROR], [-Werror])])
+
 # Check for libunwind, and link it in if present.
 if test "x$OS_NAME" = "xfreebsd"; then
   AC_CHECK_LIB(execinfo, backtrace, LIBS="$LIBS -lexecinfo")

http://git-wip-us.apache.org/repos/asf/mesos/blob/d03c650c/docs/configuration.md
----------------------------------------------------------------------
diff --git a/docs/configuration.md b/docs/configuration.md
index 041c3df..4f72fcf 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -2582,6 +2582,14 @@ quotas for container sandbox directories. Valid project 
IDs range from
       greatly improves message passing performance!
     </td>
   </tr>
+  <tr>
+    <td>
+      --disable-werror
+    </td>
+    <td>
+      Disables treating compiler warnings as fatal errors.
+    </td>
+  </tr>
 </table>
 
 ### Autotools `configure` script optional package flags

http://git-wip-us.apache.org/repos/asf/mesos/blob/d03c650c/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 5712bad..4cf3535 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -122,7 +122,7 @@ AM_LIBS = $(PTHREAD_LIBS)
 
 # Setup CPPFLAGS that are used for most source files.
 MESOS_CPPFLAGS = $(AM_CPPFLAGS)
-MESOS_CPPFLAGS += -Werror
+MESOS_CPPFLAGS += @WERROR@
 MESOS_CPPFLAGS += -DLIBDIR=\"$(libdir)\"
 MESOS_CPPFLAGS += -DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
 MESOS_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"

Reply via email to