diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-12-29 19:42:08 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-12-30 13:15:57 +0000 |
commit | d1e234ec171e9f60bd54837071ef60ca7b0568c7 (patch) | |
tree | 776a270ac2c006e2496397ab1c93bda1cd5cb3e9 /giscanner/ccompiler.py | |
parent | e7dd95f4ea463fe355e12962c727eebffc913b92 (diff) | |
download | gobject-introspection-d1e234ec171e9f60bd54837071ef60ca7b0568c7.tar.gz |
customize_compiler: also replace the linker command if CC is set
Otherwise when you set CC=clang then distuils will still use gcc for linking.
While it seems we don't invoke the link command atm this shouldn't hurt.
The upstream customize_compiler() does the same thing on macOS and there is a bug
for enabling it everywhere: https://bugs.python.org/issue24935
Diffstat (limited to 'giscanner/ccompiler.py')
-rw-r--r-- | giscanner/ccompiler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py index 8ea99445..aee6a1af 100644 --- a/giscanner/ccompiler.py +++ b/giscanner/ccompiler.py @@ -45,7 +45,10 @@ def customize_compiler(compiler): get_config_vars('CC', 'CXX', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') if 'CC' in os.environ: - cc = os.environ['CC'] + newcc = os.environ['CC'] + if 'LDSHARED' not in os.environ and ldshared.startswith(cc): + ldshared = newcc + ldshared[len(cc):] + cc = newcc if 'CXX' in os.environ: cxx = os.environ['CXX'] if 'LDSHARED' in os.environ: |