summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/ccompiler.py14
-rw-r--r--tests/scanner/test_ccompiler.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index d8b15bce..8ea99445 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -36,13 +36,13 @@ from . import utils
def customize_compiler(compiler):
"""This is a version of distutils.sysconfig.customize_compiler, without
- any macOS specific bits.
+ any macOS specific bits and which tries to avoid using any Python specific
+ defaults if alternatives through env vars are given.
"""
if compiler.compiler_type == "unix":
- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
+ (cc, cxx, ldshared, shlib_suffix, ar, ar_flags) = \
+ get_config_vars('CC', 'CXX', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
if 'CC' in os.environ:
cc = os.environ['CC']
@@ -57,8 +57,10 @@ def customize_compiler(compiler):
if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
- cflags = opt + ' ' + os.environ['CFLAGS']
+ cflags = os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
+ else:
+ cflags = ''
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
@@ -74,7 +76,7 @@ def customize_compiler(compiler):
compiler.set_executables(
preprocessor=cpp,
compiler=cc_cmd,
- compiler_so=cc_cmd + ' ' + ccshared,
+ compiler_so=cc_cmd,
compiler_cxx=cxx,
linker_so=ldshared,
linker_exe=cc,
diff --git a/tests/scanner/test_ccompiler.py b/tests/scanner/test_ccompiler.py
index 4a136d6a..ac50e245 100644
--- a/tests/scanner/test_ccompiler.py
+++ b/tests/scanner/test_ccompiler.py
@@ -191,7 +191,6 @@ class UnixCCompilerTest(unittest.TestCase):
args = self.preprocess_args()
self.assertIn('-I.', args)
- @unittest.skip("Currently Python build time CPPFLAGS are included as well")
def test_preprocess_command(self):
""""Checks complete preprocessing command."""
args = self.preprocess_args(environ=dict(CPP='gcc -E'),
@@ -199,7 +198,6 @@ class UnixCCompilerTest(unittest.TestCase):
self.assertEqual(['gcc', '-E', '-I.', '-C', '/tmp/file.c'],
args)
- @unittest.skip("Currently Python build time CFLAGS and CPPFLAGS are included as well")
def test_compile_command(self):
"""Checks complete compilation command."""
args = self.compile_args(environ=dict(CC='clang'),