Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/cython/python_flags.py

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/chromoting/chromoting_integration_tests.isolate ('k') | third_party/harfbuzz-ng/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/cython/python_flags.py
diff --git a/third_party/cython/python_flags.py b/third_party/cython/python_flags.py
index 492c9a9fd4b9aa577fc5a97a0d8a795ddb824885..3c3b93627667e2ba0340819706bb6bea94623c6c 100644
--- a/third_party/cython/python_flags.py
+++ b/third_party/cython/python_flags.py
@@ -5,11 +5,7 @@
import argparse
import os
import sys
-
-from distutils import sysconfig
-from distutils.command import build_ext
-from distutils.dist import Distribution
-from distutils.extension import Extension
+import sysconfig
def main():
"""Command line utility to retrieve compilation options for python modules'
@@ -24,21 +20,22 @@ def main():
action='store_true')
opts = parser.parse_args()
- ext = Extension('Dummy', [])
- b = build_ext.build_ext(Distribution())
- b.initialize_options()
- b.finalize_options()
result = []
+
if opts.libraries:
- libraries = b.get_libraries(ext)
- if sys.platform == 'darwin':
- libraries.append('python%s' % sys.version[:3])
- result.extend(libraries)
+ python_lib = sysconfig.get_config_var('LDLIBRARY')
+ if python_lib.endswith(".so"):
+ python_lib = python_lib[:-3]
+ if python_lib.startswith("lib"):
+ python_lib = python_lib[3:]
+
+ result.append(python_lib)
+
if opts.includes:
- result = result + b.include_dirs
+ result.append(sysconfig.get_config_var('INCLUDEPY'))
+
if opts.library_dirs:
- if sys.platform == 'darwin':
- result.append('%s/lib' % sysconfig.get_config_vars('prefix')[0])
+ result.append(sysconfig.get_config_var('BINLIBDEST'))
for x in result:
print x
« no previous file with comments | « testing/chromoting/chromoting_integration_tests.isolate ('k') | third_party/harfbuzz-ng/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698