summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in6
-rw-r--r--NEWS5
-rw-r--r--configure.ac40
-rwxr-xr-xinclude_server/setup.py24
4 files changed, 49 insertions, 26 deletions
diff --git a/Makefile.in b/Makefile.in
index 2813ec6..073482e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -17,6 +17,7 @@ SHELL = @SHELL@
CFLAGS = @CFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
POPT_CFLAGS = @POPT_CFLAGS@
POPT_INCLUDES = @POPT_INCLUDES@
@@ -561,7 +562,7 @@ include-server:
mkdir -p "$(include_server_builddir)" && \
DISTCC_VERSION="$(VERSION)" \
SRCDIR="$(srcdir)" \
- CFLAGS="$(CFLAGS)" \
+ CFLAGS="$(CFLAGS) $(PYTHON_CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
$(INCLUDESERVER_PYTHON) "$(srcdir)/include_server/setup.py" \
build \
@@ -920,7 +921,7 @@ clean-include-server:
if test -n "$(INCLUDESERVER_PYTHON)"; then \
DISTCC_VERSION="$(VERSION)" \
SRCDIR="$(srcdir)" \
- CFLAGS="$(CFLAGS)" \
+ CFLAGS="$(CFLAGS) $(PYTHON_CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
$(INCLUDESERVER_PYTHON) "$(srcdir)/include_server/setup.py" \
clean \
@@ -1041,6 +1042,7 @@ install-include-server: include-server pump
DESTDIR=`cd "$(DESTDIR)/" && pwd` && \
DISTCC_VERSION="$(VERSION)" \
SRCDIR="$(srcdir)" \
+ CFLAGS="$(CFLAGS) $(PYTHON_CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
$(INCLUDESERVER_PYTHON) "$(srcdir)/include_server/setup.py" \
build \
diff --git a/NEWS b/NEWS
index 5e895c5..a3a71e7 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,11 @@ distcc-3.1 "Humming along" 2008-11-21
without actually compiling anything. This provides a simple
interface to the include server.
+ * New "--disable-Werror" option to configure.
+ This disables the use of gcc's -Werror option when building
+ distcc, allowing compilation of distcc to succeed even if
+ gcc issues warnings.
+
DOCUMENTATION:
* Document all of the exit codes in the man page
diff --git a/configure.ac b/configure.ac
index 07f83f4..757dbe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,8 @@ then
CFLAGS="$CFLAGS -pg -g"
fi
+AC_ARG_ENABLE(Werror,
+ AC_HELP_STRING([--disable-Werror], [don't use gcc's -Werror option when building]))
# Now get the package configuration information for whatever packages
# we need. It's faster to just do it once during configuration.
@@ -160,31 +162,57 @@ AC_SUBST(UNINSTALL_GNOME)
dnl Checks for programs
AC_PROG_CC
-POPT_CFLAGS=""
WERROR_CFLAGS=""
-if test x"$GCC" = xyes
+POPT_CFLAGS=""
+PYTHON_CFLAGS=""
+if test x"$GCC" = xyes
then
CFLAGS="$CFLAGS -MD \
--W -Wall -Wimplicit -Wuninitialized \
+-W -Wall -Wimplicit \
-Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings \
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Wmissing-declarations"
+
+ # -Wuninitialized requires -O
+ case "$CFLAGS" in "-O"*|*" -O"*)
+ CFLAGS="$CFLAGS -Wuninitialized"
+ ;;
+ esac
# Would like -Wunreachable-code here, but it generates too many false
# positives.
- # We want warnings to be treated as errors.
+ # We want warnings to be treated as errors,
+ # unless the --disable-Werror configure option was used.
# Note that we can't include this in CFLAGS,
# because that would affect the configure tests,
# causing some of the tests to fail when they should succeed.
- WERROR_CFLAGS="-Werror"
+ if test x"$enable_Werror" != xno
+ then
+ WERROR_CFLAGS="-Werror"
+ fi
+
+ # Additional flags for compiling Python extension modules.
+ # We disable -Wmissing-prototypes and -Wmissing-declarations,
+ # which don't apply to python extensions (it exports global fns via a
+ # pointer), and -Wwrite-strings, which just had too many false
+ # positives (for Python 2.2, anyway; looks like these may be fixed
+ # in Python 2.5).
+ # -Wp,-U_FORTIFY_SOURCE is to turn off _FORTIFY_SOURCE on systems where
+ # it's in the Python Makefile (and hence inherited by us).
+ # _FORTIFY_SOURCE gives compiler errors for some distcc routines that
+ # ignore the return value from libc functions (like getcwd).
+ # That would cause this code to not compile, which is no good.
+ PYTHON_CFLAGS="-Wno-missing-prototypes -Wno-missing-declarations \
+-Wno-write-strings -Wp,-U_FORTIFY_SOURCE"
# For popt/*.c, we disable unused variable warnings.
POPT_CFLAGS="-Wno-unused"
AC_MSG_NOTICE([Adding gcc options: $CFLAGS])
fi
-AC_SUBST(POPT_CFLAGS)
AC_SUBST(WERROR_CFLAGS)
+AC_SUBST(POPT_CFLAGS)
+AC_SUBST(PYTHON_CFLAGS)
AC_ISC_POSIX
diff --git a/include_server/setup.py b/include_server/setup.py
index ff172f6..6d2dd7e 100755
--- a/include_server/setup.py
+++ b/include_server/setup.py
@@ -109,6 +109,11 @@ if not cpp_flags_env:
# in order to identify the include directory options.
cpp_flags_includes = GetIncludes(cpp_flags_env)
+python_cflags_env = os.getenv('PYTHON_CFLAGS', '')
+if not python_cflags_env:
+ # Don't quit; perhaps the user is asking for help using '--help'.
+ print >> sys.stderr, 'setup.py: PYTHON_CFLAGS must be defined.'
+
# SRCDIR checking.
if not os.getenv('SRCDIR'):
# Don't quit; perhaps the user is asking for help using '--help'.
@@ -160,24 +165,7 @@ ext = distutils.extension.Extension(
libraries=[],
runtime_library_dirs=[],
extra_objects=[],
- # This is the same list as is in configure.ac, except we leave out
- # -Wmissing-prototypes and -Wmissing-declarations, which don't
- # apply to python extensions (it exports global fns via a
- # pointer), and -Wwrite-strings, which just had too many false
- # positives.
- extra_compile_args=(('-W -Wall -Wimplicit -Wuninitialized '
- '-Wshadow -Wpointer-arith -Wcast-align '
- '-Waggregate-return -Wstrict-prototypes '
- '-Wnested-externs -Werror').split()
- # -Wp,-U_FORTIFY_SOURCE is to turn off
- # _FORTIFY_SOURCE on systems where it's in the
- # Python Makefile (and hence inherited by us).
- # _FORTIFY_SOURCE gives compiler errors for
- # some distcc routines that ignore the return
- # value from libc functions (like getcwd).
- # That would cause this code to not compile,
- # which is no good.
- + ['-Wp,-U_FORTIFY_SOURCE'])
+ extra_compile_args=python_cflags_env.split()
)
args = {