diff options
author | pgal.u-szeged <pgal.u-szeged@partner.samsung.com> | 2014-08-29 09:42:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-29 16:54:03 +0000 |
commit | baa762fca6052320388d85932712f9d9b6eb5f47 (patch) | |
tree | 391c39261ad0b5e9cbffd12df3a91bd401640b15 /third_party/cython | |
parent | 04a15eeb2cee36d202fc92e6ab62dd44454d0cac (diff) | |
download | chromium_src-baa762fca6052320388d85932712f9d9b6eb5f47.zip chromium_src-baa762fca6052320388d85932712f9d9b6eb5f47.tar.gz chromium_src-baa762fca6052320388d85932712f9d9b6eb5f47.tar.bz2 |
Fix library link option generation on Linux.
On Linux the distutil returns only the name of the python library.
Passing only the library name is not good for a compiler (in this case
it was a simple 'python2.7'), the script should return the correct
compiler option (which should be the '-lpython2.7')
BUG=408979
TEST=ninja -C out/Release libmojo_python_system.so
Review URL: https://codereview.chromium.org/521653002
Cr-Commit-Position: refs/heads/master@{#292654}
Diffstat (limited to 'third_party/cython')
-rw-r--r-- | third_party/cython/python_flags.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/third_party/cython/python_flags.py b/third_party/cython/python_flags.py index 03c4ad7..542b477 100644 --- a/third_party/cython/python_flags.py +++ b/third_party/cython/python_flags.py @@ -34,9 +34,13 @@ def main(): result = [] if opts.libraries: libraries = b.get_libraries(ext) - if sys.platform == 'darwin': - libraries += [ '-lpython%s' % sys.version[:3] ] - result = result + libraries + if sys.platform in ['darwin', 'linux2']: + # In case of darwin and linux prefix all libraries (if there is any) + # so it can be used as a compiler argument. + libraries = ['-l%s' % library for library in libraries] + if sys.platform == 'darwin': + libraries.append('-lpython%s' % sys.version[:3]) + result.extend(libraries) if opts.includes: result = result + b.include_dirs if opts.library_dirs: |