Commit Graph

91 Commits

Author SHA1 Message Date
Ronald Oussoren 68776dbd3c Half of the fix for issue 6957: ensure that distutils
ignores the '-isysroot' option on OSX when the
corresponding SDK is not installed.

This ensures that the user can compile extensions
on OSX 10.6 using the Python.org installer and a
default installation of Xcode.
2009-09-22 19:27:44 +00:00
Tarek Ziadé 2d36afd15e removed the last string.split() call 2009-06-11 08:43:26 +00:00
Tarek Ziadé 25d2bae1c9 Fixed #5201: now distutils.sysconfig.parse_makefile() understands '53264' in Makefiles 2009-06-11 08:12:20 +00:00
Tarek Ziadé 99f660af3f Fixed #5941: added ARFLAGS for the archiver command. 2009-05-07 21:20:34 +00:00
Tarek Ziadé 74fbf60e8c Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib 2009-02-10 12:31:09 +00:00
Neil Schemenauer aa397d1806 Convert "srcdir" into an absolute path if that seems prudent. Currrently
the only user of this is Lib/distutils/tests/test_build_ext.py (in order
to find the source for xxmodule.c).  I'm not sure if other platforms
need similar tweaks, I'm not brave enough to attempt it without being
able to test.
2009-02-06 21:33:45 +00:00
Tarek Ziadé 05adf073cc fixed #1520877: now distutils reads Read from the environment/Makefile 2009-02-06 01:15:51 +00:00
Neil Schemenauer 444df45739 Fix get_python_inc() to work when building in a directory separate from
the source.  Also, define 'srcdir' on non-posix platforms.
2009-02-05 16:14:39 +00:00
Ronald Oussoren 5640ce2f1e MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX:
        --with-universal-archs=[32-bit|64-bit|all]

When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).

This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.

I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
2008-06-05 12:58:24 +00:00
Trent Nelson b27745fb6d Issue2290: Support x64 Windows builds that live in pcbuild/amd64. Without it, sysutils._python_build() returns the wrong directory, which causes the test_get_config_h_filename method in Lib/distutils/tests/test_sysconfig.py to fail. 2008-03-19 06:28:24 +00:00
Guido van Rossum 8bc0965adf Removed uses of dict.has_key() from distutils, and uses of
callable() from copy_reg.py, so the interpreter now starts up
without warnings when '-3' is given.  More work like this needs to
be done in the rest of the stdlib.
2008-02-21 18:18:37 +00:00
Marc-André Lemburg 2db7cd3ae2 Keep distutils Python 2.1 compatible (or even Python 2.4 in this case). 2008-02-05 14:50:40 +00:00
Christian Heimes 9a1d8cec11 Added support for new Windows build dirs in PC/ to distutils.sysconfig 2008-01-01 14:37:32 +00:00
Christian Heimes c67a15d865 Fixed bug #1628
The detection now works on Unix with Makefile, Makefile with VPATH and on Windows.
2007-12-14 23:42:36 +00:00
Christian Heimes 0a0e583259 Fixed bug #1613: Makefile's VPATH feature is broken 2007-12-13 19:23:16 +00:00
Christian Heimes d3fc07a4a0 Fixed get_config_h_filename for Windows. Without the patch it can't find the pyconfig.h file inside a build tree.
Added several small unit tests for sysconfig.
2007-12-06 13:15:13 +00:00
Ronald Oussoren d610369e8b MacOSX: distutils changes the values of BASECFLAGS and LDFLAGS when using a
universal build of python on OSX 10.3 to ensure that those flags can be used
to compile code (the universal build uses compiler flags that aren't supported
on 10.3). This patches gives the same treatment to CFLAGS, PY_CFLAGS and
BLDSHARED.
2006-10-08 17:49:52 +00:00
Ronald Oussoren 7b9053a274 MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
2006-06-27 10:08:25 +00:00
Ronald Oussoren b02daf794b Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
2006-05-23 12:01:11 +00:00
Ronald Oussoren 988117fd63 Patch 1471883: --enable-universalsdk on Mac OS X 2006-04-29 11:31:35 +00:00
Ronald Oussoren 59075eb264 disutils checks if MACOSX_DEPLOYMENT_TARGET is consistent with the value at
configure time. The current check is too strict and doesn't allow building
extensions that can only run on newer versions of the OS than the version
python was build for, that is python build for 10.3 or later and an extension
for 10.4. This patch relaxes this check.

This turned out to be a reimplementation of patch 1193190.
2006-04-17 14:43:30 +00:00
Armin Rigo dfde91a79e Fix for a bug exposed by r45232:
/path/to/uninstalled/python setup.py build_ext

now failed with pyconfig.h not found.  Prior to r45232
the above command did not look for pyconfig.h, but the
bug is really in the look-up code: expecting to find it
in os.curdir is a rather fragile idea.
2006-04-17 09:22:35 +00:00
Martin v. Löwis 10acfd00b2 Patch #1429775: Link Python modules to libpython on linux if
--enable-shared. Fixes #832799.
2006-04-10 12:39:36 +00:00
Guido van Rossum f8480a7856 Instead of relative imports, use (implicitly) absolute ones. 2006-03-15 23:08:13 +00:00
Guido van Rossum 87de069e4e Use relative imports in a few places where I noticed the need.
(Ideally, all packages in Python 2.5 will use the relative import
syntax for all their relative import needs.)
2006-03-15 04:33:54 +00:00
Tim Peters fffc4b7b3a Whitespace normalization. 2005-05-18 02:18:09 +00:00
Martin v. Löwis d7c795e729 Make parse_makefile fallback to environment variables if nothing is
defined in the makefile. Get CFLAGS from the Makefile, instead of
getting OPT, BASE_CFLAGS and EXTRA_CFLAGS individually.
2005-04-25 07:14:03 +00:00
Brett Cannon 08cd598c21 Introduced EXTRA_CFLAGS as an environment variable used by the Makefile. Meant
to be used for flags that change binary compatibility.

Distutils was tweaked to also use the variable if used during compilation of
the interpreter.
2005-04-24 22:26:38 +00:00
Martin v. Löwis df37c8c1ad Patch #1046831: Use get_python_version where appropriate in sysconfig.py. 2005-03-03 11:08:03 +00:00
Jack Jansen be95462c1c After discussion on the PythonMac-SIG it was decided that it is better
to make using "-undefined dynamic_lookup" for linking extensions more
automatic on 10.3 and later. So if we're on that platform and
MACOSX_DEPLOYMENT_TARGET is not set we now set it to the current OSX
version during configure. Additionally, distutils will pick up the
configure-time value by default.

Will backport.
2004-12-26 23:07:48 +00:00
Anthony Baxter 22dcf66f84 Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)
2004-10-13 15:54:17 +00:00
Tim Peters 182b5aca27 Whitespace normalization, via reindent.py. 2004-07-18 06:16:08 +00:00
Jack Jansen 6b08a40442 Partial fix for #887242 (link extensions with dynamic_lookup in stead
of hard linking against the framework).

If $MACOSX_DEPLOYMENT_TARGET is set, and >= 10.3, during configure we
setup extensions to link with dynamic lookup. We also record the
value in the Makefile.

Distutils checks whether a value for MACOSX_DEPLOYMENT_TARGET was
recorded in the Makefile, and if it was insists that the current
value matches.

This is only a partial fix because it only applies to 2.4, and the
"two python problem" exists with Python 2.3 shipped with MacOSX 10.3,
which we have no influence over.
2004-06-03 12:41:45 +00:00
Martin v. Löwis 23b44a39ce Patch #812378: Normalize white space. 2003-10-24 20:09:23 +00:00
Jack Jansen 4f82a513ca Pick up Makefile variable BASECFLAGS too. This is needed since OPT was
split into OPT and BASECFLAGS (Makefile.pre.in rev. 1.108), because
now there are essential CFLAGS in BASECFLAGS.
2003-02-10 14:02:33 +00:00
Andrew M. Kuchling a6483d2e9a Remove 'created by' lines; people can use CVS for this, and the information is often out of date 2002-11-14 02:25:42 +00:00
Andrew M. Kuchling 0ff98b9346 [Bug #550364] Add get_python_version() 2002-11-14 01:43:00 +00:00
Andrew M. Kuchling 33635aaf93 Back out part of rev. 1.53, restoring the use of the string module.
The two long lines have been reflowed differently; hopefully someone on
BeOS can test them.  Rev. 1.53 also converted string.atoi() to int(); I've
left that alone.
2002-11-13 17:03:05 +00:00
Jeremy Hylton a5f4c071b5 Remove use of string module and reflow a couple of long lines. 2002-11-05 20:11:08 +00:00
Gustavo Niemeyer 6b016852f8 This patch fixes the following bugs:
[#413582] g++ must be called for c++ extensions
[#454030] distutils cannot link C++ code with GCC

topdir = "Lib/distutils"

* bcppcompiler.py
  (BCPPCompiler.create_static_lib): Fixed prototype, removing extra_preargs
  and extra_postargs parameters. Included target_lang parameter.
  (BCPPCompiler.link): Included target_lang parameter.

* msvccompiler.py
  (MSVCCompiler.create_static_lib): Fixed prototype, removing extra_preargs
  and extra_postargs parameters. Included target_lang parameter.
  (MSVCCompiler.link): Included target_lang parameter.

* ccompiler.py
  (CCompiler): New language_map and language_order attributes, used by
  CCompiler.detect_language().

  (CCompiler.detect_language): New method, will return the language of
  a given source, or list of sources. Individual source language is
  detected using the language_map dict. When mixed sources are used,
  language_order will stablish the language precedence.

  (CCompiler.create_static_lib, CCompiler.link, CCompiler.link_executable,
   CCompiler.link_shared_object, CCompiler.link_shared_lib):
  Inlcuded target_lang parameter.

* cygwinccompiler.py
  (CygwinCCompiler.link): Included target_lang parameter.

* emxccompiler.py
  (EMXCCompiler.link): Included target_lang parameter.

* mwerkscompiler.py
  (MWerksCompiler.link): Included target_lang parameter.

* extension.py
  (Extension.__init__): New 'language' parameter/attribute, initialized
  to None by default. If provided will overlap the automatic detection
  made by CCompiler.detect_language(), in build_ext command.

* sysconfig.py
  (customize_compiler): Check Makefile for CXX option, and also the
  environment variable CXX. Use the resulting value in the 'compiler_cxx'
  parameter of compiler.set_executables().

* unixccompiler.py
  (UnixCCompiler): Included 'compiler_cxx' in executables dict, defaulting
  to 'cc'.
  (UnixCCompiler.create_static_lib): Included target_lang parameter.
  (UnixCCompiler.link): Included target_lang parameter, and made
  linker command use compiler_cxx, if target_lang is 'c++'.

* command/build_ext.py
  (build_ext.build_extension): Pass new ext.language attribute
  to compiler.link_shared_object()'s target_lang parameter. If
  ext.language is not provided, detect language using
  compiler.detect_language(sources) instead.

* command/config.py
  (config._link): Pass already available lang parameter as target_lang
  parameter of compiler.link_executable().
2002-11-05 16:12:02 +00:00
Andrew M. Kuchling 29c8623e5c [Patch #588809] LDFLAGS support for build_ext.py, from Robert Weber
customize_compiler() now looks at various environment variables and uses
   their values to override the configured C compiler/preprocessor/linker
   binary and flags.
2002-11-04 19:53:24 +00:00
Michael W. Hudson 6b7d69d9b4 Well, Fred never did explain why the code to determine whether the
calling Python was installed was so complicated, so I simplified it.

This should get the snake-farm's build scripts working again.
2002-07-12 09:16:44 +00:00
Neal Norwitz 80a3e0a604 Whitespace normalization (remove tabs) 2002-06-26 22:05:33 +00:00
Jack Jansen ab5320bfd9 Fixed various MacPython-specific issues found by attempting to use the standard core setup.py for MacPython. 2002-06-26 15:42:49 +00:00
Jeremy Hylton a2f9989c1a Fix unused local variables caught by pychecker.
Fixes a bug for Solaris pkgtool (bdist_pkgtool) that would have
prevented it from building subpackages.
2002-06-04 20:26:44 +00:00
Fred Drake 16c8d702a4 When using a Python that has not been installed to build 3rd-party
modules, distutils does not understand that the build version of the
source tree is needed.

This patch fixes distutils.sysconfig to understand that the running
Python is part of the build tree and needs to use the appropriate
"shape" of the tree. This does not assume anything about the current
directory, so can be used to build 3rd-party modules using Python's
build tree as well.

This is useful since it allows us to use a non-installed debug-mode
Python with 3rd-party modules for testing. It as the side-effect that
set_python_build() is no longer needed (the hack which was added to
allow distutils to be used to build the "standard" extension modules).

This closes SF patch #547734.
2002-06-04 15:28:21 +00:00
Marc-André Lemburg 2544f51036 OS/2 patches by Andrew I MacIntyre for distutils.
Closes patch #435381.
2002-01-31 18:56:00 +00:00
Fred Drake b94b849d65 Whitespace normalization. 2001-12-06 20:51:35 +00:00
Andrew M. Kuchling 045af6f8d8 [Bug #404274] Restore some special-case code for AIX and BeOS under 1.5.2.
This will have to stay until we decide to drop 1.5.2 compatibility
   completely.
2001-09-05 12:02:59 +00:00
Jack Jansen 212a2e1f9f On the mac some library paths returned were outdated, some were outright funny.
Fixed.
2001-09-04 12:01:49 +00:00