Commit baa762fc authored by pgal.u-szeged's avatar pgal.u-szeged Committed by Commit bot

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}
parent 04a15eeb
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment