summaryrefslogtreecommitdiff
path: root/include_server
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-12-02 21:44:21 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-12-02 21:44:21 +0000
commit369fda0a4d5ca955dddc79dd0f61568f8ca72aa0 (patch)
tree70bf47df1d7bacf3e900f4e67e70e815999e1032 /include_server
parentb357e22c72cc1a8fd075fb76bb01217f24d89bee (diff)
downloaddistcc-369fda0a4d5ca955dddc79dd0f61568f8ca72aa0.tar.gz
1. Fix some compilation errors arising from the use of
-Wwrite-strings when compiling the python extension module, due to lack of const correctness in the Python 2.2 "Python.h" header file. This problem was introduced by the fix for distcc issue 26 <http://code.google.com/p/distcc/issues/detail?id=26>. The solution was to explicitly disable these warnings with -Wno-write-strings. 2. Centralize the use of gcc-specific compilation options in conditional code in configure.ac that is only executed if we're using gcc. Previously include_server/setup.py was hard-coding gcc-specific options, regardless of whether we're using gcc. 3. Don't use -Wuninitialized if CFLAGS doesn't contain "-O*", because -Wuninitialized only works if optimization is enabled. This avoids a gcc warning (and hence an error with -Werror) about -Wuninitialized not having any effect when distcc is configured with "CFLAGS=-g ./configure". 4. Add a new configure option "--disable-Werror". For the 3.0 release of distcc, some people porting distcc resorted to patching distcc to remove the -Werror option. -Werror is useful, so I want to keep it enabled by default, but I'd prefer that people are able to port distcc easily, hence the configure option. This addresses distcc issue 20 <http://code.google.com/p/distcc/issues/detail?id=20>. Reviewers: Craig Silverstein git-svn-id: http://distcc.googlecode.com/svn/trunk@627 01de4be4-8c4a-0410-9132-4925637da917
Diffstat (limited to 'include_server')
-rwxr-xr-xinclude_server/setup.py24
1 files changed, 6 insertions, 18 deletions
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 = {