diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-05-15 22:09:29 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-05-15 22:09:29 (GMT) |
commit | 6461e10158db1f1d41dc9449e233551b2889ebb5 (patch) | |
tree | c1860ecebd924e489948471797e0beb81174c29b /Lib/distutils/command/build_ext.py | |
parent | b645bc7b775b85e3520a561413905a7a1c4ae11c (diff) | |
download | cpython-6461e10158db1f1d41dc9449e233551b2889ebb5.zip cpython-6461e10158db1f1d41dc9449e233551b2889ebb5.tar.gz cpython-6461e10158db1f1d41dc9449e233551b2889ebb5.tar.bz2 |
Merged revisions 62914-62916,62918-62919,62921-62922,62924-62942,62944-62945,62947-62949 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62914 | skip.montanaro | 2008-05-08 20:45:00 -0400 (Thu, 08 May 2008) | 4 lines
Add an example about using NamedTemporaryFile() to replace mktemp(). I'm
unclear whether the verbatim text should have been indented or by how much.
........
r62915 | benjamin.peterson | 2008-05-08 20:50:40 -0400 (Thu, 08 May 2008) | 2 lines
reindent example
........
r62927 | georg.brandl | 2008-05-09 02:09:25 -0400 (Fri, 09 May 2008) | 2 lines
#2788: add .hgignore file.
........
r62928 | georg.brandl | 2008-05-09 02:10:43 -0400 (Fri, 09 May 2008) | 2 lines
#2781: fix function name.
........
r62929 | georg.brandl | 2008-05-09 02:18:27 -0400 (Fri, 09 May 2008) | 2 lines
Add a sentence to basicConfig() that is in the docstring.
........
r62930 | georg.brandl | 2008-05-09 02:26:54 -0400 (Fri, 09 May 2008) | 2 lines
Add another link to colorsys docs.
........
r62931 | georg.brandl | 2008-05-09 02:36:07 -0400 (Fri, 09 May 2008) | 2 lines
Add Kodos as a re reference.
........
r62932 | georg.brandl | 2008-05-09 02:39:58 -0400 (Fri, 09 May 2008) | 2 lines
Add a note about using reload().
........
r62933 | andrew.kuchling | 2008-05-09 07:46:05 -0400 (Fri, 09 May 2008) | 3 lines
Update planned release date.
Uncomment PEP 370 section.
Add some module items
........
r62934 | christian.heimes | 2008-05-09 08:19:09 -0400 (Fri, 09 May 2008) | 1 line
Add --user option to build_ext
........
r62948 | mark.dickinson | 2008-05-09 13:54:23 -0400 (Fri, 09 May 2008) | 3 lines
Issue #2487. math.ldexp(x, n) raised OverflowError when n was large and
negative; fix to return an (appropriately signed) zero instead.
........
r62949 | martin.v.loewis | 2008-05-09 14:21:55 -0400 (Fri, 09 May 2008) | 1 line
Use the CHM file name that Sphinx assigns.
........
Diffstat (limited to 'Lib/distutils/command/build_ext.py')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index e011219..73cc00b 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -7,6 +7,7 @@ extensions ASAP).""" __revision__ = "$Id$" import sys, os, re +from site import USER_BASE, USER_SITE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version @@ -90,9 +91,11 @@ class build_ext(Command): "list of SWIG command line options"), ('swig=', None, "path to the SWIG executable"), + ('user', None, + "add user include, library and rpath"), ] - boolean_options = ['inplace', 'debug', 'force', 'swig-cpp'] + boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user'] help_options = [ ('help-compiler', None, @@ -120,6 +123,7 @@ class build_ext(Command): self.swig = None self.swig_cpp = None self.swig_opts = None + self.user = None def finalize_options(self): from distutils import sysconfig @@ -253,6 +257,16 @@ class build_ext(Command): else: self.swig_opts = self.swig_opts.split(' ') + # Finally add the user include and library directories if requested + if self.user: + user_include = os.path.join(USER_BASE, "include") + user_lib = os.path.join(USER_BASE, "lib") + if os.path.isdir(user_include): + self.include_dirs.append(user_include) + if os.path.isdir(user_lib): + self.library_dirs.append(user_lib) + self.rpath.append(user_lib) + def run(self): from distutils.ccompiler import new_compiler |