5 years agoFix python build inc_dirs[] and lib_dirs[] for linux/darwin master
Andrew Hsieh [Wed, 15 Jan 2014 19:06:42 +0000]
Fix python build inc_dirs[] and lib_dirs[] for linux/darwin

Previously setup.py excludes module like zlib because it
fails to locate zlib.h.  The reason on linux is that GCC-reported paths
(via gcc -E -v - < /dev/null) containing /gcc/ are excluded.
Unfortunately $NDK/build/tools/build-host-python.sh use GCC in
$AOSP/prebuilts/gcc/{linux-x86,darwin-x86}/host whose path
contains "/gcc/", and causes all paths being excluded, even though
zlib.h is under linux-x86/host's sysroot.  This CL fixes it by excluding
/lib/gcc/ instead.

The reason for darwin is that the old gcc 4.2.1 doesn't report
LIBRARY_PATH which causes lib_dirs[] to be empty.  Fix it to call
gcc with -print-search-dirs instead.  The library path may contain
non-existance paths, but work fine for our purpose

This CL enables additional modules:
linux: zlib, nis, crypt, _curses and _curses_panel
darwin: zlib, bz2, _curses, _curses_panel, _hashlib, _ssl

The mingw cross-tool doesn't have zlib, so the python.exe in
windows pacakges remain lack of zlib module (and some others)

See b.android.com/59902

Change-Id: I4d393624a9ceb808955ddea9687cb2013a4fd1d2

5 years agoPython 2.7.5: Regen configure and pyconfig.h.in
Ray Donnelly [Tue, 21 May 2013 22:00:03 +0000]
Python 2.7.5: Regen configure and pyconfig.h.in

5 years agoMSYS: Apply a monkeypatch to os.system
Ray Donnelly [Tue, 21 May 2013 22:00:03 +0000]
MSYS: Apply a monkeypatch to os.system

..so that the commands are run through sh.exe so that shell indirection
to /dev/null and other things requiring a Posix shell work as expected.

5 years agoAdd the build machine's Python's DESTSHARED path to PYTHONPATH
Ray Donnelly [Tue, 21 May 2013 22:00:03 +0000]
Add the build machine's Python's DESTSHARED path to PYTHONPATH

..before the path contained in pybuilddir.txt so that the shared modules
 for the host machine don't get loaded incorrectly during make install.

5 years agoMinGW-w64: Add path of python.exe or python2.7.dll to PATH
Ray Donnelly [Tue, 21 May 2013 22:00:03 +0000]
MinGW-w64: Add path of python.exe or python2.7.dll to PATH

..so that other dlls can be placed in the same location and loaded
correctly. This is used for example, when loading the shared tcltk.

5 years agoCross: Use full path for the cross Python interpreter
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
Cross: Use full path for the cross Python interpreter

..and ensure it is version 2.7.5 or greater.

5 years agoMinGW-w64: Added --build-sysroot config option
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Added --build-sysroot config option

..which I'm not so sure about the value of. CFLAGS and LDSHARED
are probably the right way to pass custom paths to distutils, but
it's not harmful to have this option.

5 years agoMinGW-w64: Installation fix for the shared Python library.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Installation fix for the shared Python library.

5 years agoMinGW-w64 Cross: MinGW-w64 headers are all lowercase.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64 Cross: MinGW-w64 headers are all lowercase.

When running natively on Windows filesysems this doesn't matter,
but when cross compiling on a case-sensitive filesystem it does.

5 years agoMinGW-w64: Simple compile fix.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Simple compile fix.

5 years agoMinGW-w64/MSYS: Do not search build system sysroot folders.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64/MSYS: Do not search build system sysroot folders.

/usr/include or /usr/lib must not be added to the search path
as they are MSYS system paths, not MinGW-w64 system paths.

5 years agoMSYS distutils: Path conversion for --root option.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MSYS distutils: Path conversion for --root option.

Converts --root=<MSYS/path> to --root=<Windows/path>
as our Python is Windows native.

Added a hack to convert_path because
os.path.join(['C:','folder','subfolder']) returns:
'C:folder\subfolder'
..which isn't the same as:
'C:\folder\subfolder'

5 years agoMinGW-w64: Replace forwardslashes with backslashes
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Replace forwardslashes with backslashes

..in compileall.py

5 years agoMSYS: Fix ln -s ordering
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MSYS: Fix ln -s ordering

..as when ln is really cp, as on MSYS, the source must exist
before creating any links to it.

5 years agoCross: Don't add multi-arch paths if cross compiling.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
Cross: Don't add multi-arch paths if cross compiling.

5 years agoMinGW-w64: Allow either nt-threads and pthreads.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Allow either nt-threads and pthreads.

I only ever build with nt-threads, and will continue to do so
until I'm convinced winpthreads is fully working, but having
the option is useful.

5 years agoCross: Add python-config.sh.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
Cross: Add python-config.sh.

Generate and use python-config.sh, which is a shell script
replacement for python-config which can therefore be used
in cross compilation scenarios.

5 years agoMinGW-w64: Don't compile dbm module.
Ray Donnelly [Tue, 21 May 2013 22:00:02 +0000]
MinGW-w64: Don't compile dbm module.

5 years agoMinGW-w64: Allow size_t (%z) format specifier.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Allow size_t (%z) format specifier.

Also, remove the error:
Python doesn't support sizeof(pid_t) > sizeof(long)
because it does on Win64 where long is only 32 bit.

5 years agoMinGW-w64: Allow static tcltk (which I don't recommend).
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Allow static tcltk (which I don't recommend).

5 years agoMinGW-w64: Add ISPAD define so that PDCurses can be used.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Add ISPAD define so that PDCurses can be used.

5 years agoMinGW-w64: Adopt unix filesystem layout for MinGW Python.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Adopt unix filesystem layout for MinGW Python.

5 years agoDarwin: Enable as a target for cross compilation.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
Darwin: Enable as a target for cross compilation.

5 years agoDistutils (cygwinccompiler): Use CC and LD env. variables
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
Distutils (cygwinccompiler): Use CC and LD env. variables

..also, if gcc is found then override LD with the output
from 'CC --print-prog-name ld'

5 years agoMSYS: Add building on MSYSVPATH configure argument.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MSYS: Add building on MSYSVPATH configure argument.

When building on MSYS, VPATH ends up containing
an un-translated path which then falls over in
distutils. So MSYSVPATH is VPATH translated to
the Windows version and this is passed to disutils
instead.

5 years agoMinGW-w64: Enable building the _msi module.
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Enable building the _msi module.

Note, this isn't enough for msi, but it's a good start.

5 years agoMinGW-w64: Use a different header for regen
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Use a different header for regen

..because /usr/include/netinet/in.h doesn't exist.
Instead we use include/stddef.h from the GCC installation,
located via -print-search-dirs trickery.

5 years agoMinGW-w64: Compile fix for REPARSE_DATA_BUFFER
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Compile fix for REPARSE_DATA_BUFFER

..which is not declared in the MinGW-w64 headers.

5 years agoMinGW-w64: Switch to using the Posix getpath code
Ray Donnelly [Tue, 21 May 2013 22:00:01 +0000]
MinGW-w64: Switch to using the Posix getpath code

..in Modules/getpathp.c rather than the Windows version
in PC/getpath.c. This is because we want the Posix
file layout.

5 years agoMinGW-w64: Add autoconf variable DELIM
Ray Donnelly [Tue, 21 May 2013 22:00:00 +0000]
MinGW-w64: Add autoconf variable DELIM

..which is the path delimiter to use. Usually a colon
but on Windows a semi-colon.

5 years agoMinGW-w64: --with-system-ffi now looks for ffi.h.
Ray Donnelly [Tue, 21 May 2013 22:00:00 +0000]
MinGW-w64: --with-system-ffi now looks for ffi.h.

Windows 64 fixes for ffi.
Some ctypes fixes for MinGW(-w64).
(by Alexey Pavlov).

5 years agoMinGW-w64: Removal of the libffi changes.
Ray Donnelly [Tue, 21 May 2013 22:00:00 +0000]
MinGW-w64: Removal of the libffi changes.

Done this way so that Roumen's and Alexey's
patches can be updated more easily.

5 years agoMinGW-w64: Initial MinGW(-w64) feature patch.
Ray Donnelly [Tue, 21 May 2013 22:00:00 +0000]
MinGW-w64: Initial MinGW(-w64) feature patch.

(by Roumen Petrov and LRN).

5 years agoAdded unmodified Python-2.7.5 sources
Andrew Hsieh [Tue, 21 May 2013 12:32:42 +0000]
Added unmodified Python-2.7.5 sources

Change-Id: I230169787cb61d59d4b31f81bcdf98b57454c70b

5 years agoUse greadlink in Mac
Andrew Hsieh [Wed, 8 May 2013 02:28:34 +0000]
Use greadlink in Mac

readlink in Mac doesn't support "-f", while greadlink (form MacPorts)
does.  Return the unmodified prefix if greadlink can't be found.

Change-Id: Iadf46089b9569018b4392f4e61237a525d65c3fe

5 years agoPython 2.7.4: Regen configure/pyconfig.h.in
Ray Donnelly [Tue, 7 May 2013 21:26:06 +0000]
Python 2.7.4: Regen configure/pyconfig.h.in

5 years agoMinGW-w64: Add path of python.exe or python2.7.dll to PATH
Ray Donnelly [Tue, 7 May 2013 20:31:25 +0000]
MinGW-w64: Add path of python.exe or python2.7.dll to PATH

..so that other dlls can be placed in the same location and loaded
correctly. This is used for example, when loading the shared tcltk

5 years agoCross: Use full path for the cross Python interpreter
Ray Donnelly [Tue, 7 May 2013 20:30:40 +0000]
Cross: Use full path for the cross Python interpreter

..and ensure it is version 2.7.4 or greater.

5 years agoMinGW-w64: Added --build-sysroot config option
Ray Donnelly [Tue, 7 May 2013 20:29:41 +0000]
MinGW-w64: Added --build-sysroot config option

..which I'm not so sure about the value of. CFLAGS and LDSHARED
are probably the right way to pass custom paths to distutils, but
it's not harmful to have this option.

5 years agoMinGW-w64: Installation fix for the shared Python library
Ray Donnelly [Tue, 7 May 2013 20:28:50 +0000]
MinGW-w64: Installation fix for the shared Python library

5 years agoMinGW-w64 Cross: MinGW-w64 headers are all lowercase.
Ray Donnelly [Tue, 7 May 2013 20:27:30 +0000]
MinGW-w64 Cross: MinGW-w64 headers are all lowercase.

When running natively on Windows filesysems this doesn't matter,
but when cross compiling on a case-sensitive filesystem it does.

5 years agoMinGW-w64: Simple compile fix
Ray Donnelly [Tue, 7 May 2013 20:27:06 +0000]
MinGW-w64: Simple compile fix

5 years agoMinGW-w64/MSYS: Do not search build system sysroot folders
Ray Donnelly [Tue, 7 May 2013 20:23:25 +0000]
MinGW-w64/MSYS: Do not search build system sysroot folders

/usr/include or /usr/lib must not be added to the search path
as they are MSYS system paths, not MinGW-w64 system paths.

5 years agoMSYS distutils: Path conversion for --root option
Ray Donnelly [Tue, 7 May 2013 20:19:58 +0000]
MSYS distutils: Path conversion for --root option

Converts --root=<MSYS/path> to --root=<Windows/path>
as our Python is Windows native. Also, adds a hack to
convert_path because
os.path.join(['C:','folder','subfolder']) returns:
'C:folder\subfolder'
..which isn't the same as:
'C:\folder\subfolder'

5 years agoMinGW-w64: Replace forwardslashes with backslashes
Ray Donnelly [Tue, 7 May 2013 20:19:16 +0000]
MinGW-w64: Replace forwardslashes with backslashes

..in compileall.py

5 years agoMSYS: Fix ln -s ordering.
Ray Donnelly [Tue, 7 May 2013 20:17:47 +0000]
MSYS: Fix ln -s ordering.

..as when ln is really cp, as on MSYS, the source must exist
before creating any links to it.

5 years agoCross: Don't add multi-arch paths if cross compiling
Ray Donnelly [Tue, 7 May 2013 20:15:57 +0000]
Cross: Don't add multi-arch paths if cross compiling

5 years agoMinGW-w64: Allow either nt-threads and pthreads
Ray Donnelly [Tue, 7 May 2013 20:15:06 +0000]
MinGW-w64: Allow either nt-threads and pthreads

I only ever build with nt-threads, and will continue to do so
until I'm convinced winpthreads is fully finished, but having
the option is useful.

5 years agoCross: Add python-config.sh
Ray Donnelly [Tue, 7 May 2013 20:13:59 +0000]
Cross: Add python-config.sh

Generate and use python-config.sh, which is a shell script
replacement for python-config which can therefore be used
in cross compilation scenarios

5 years agoMinGW-w64: Don't compile dbm module
Ray Donnelly [Tue, 7 May 2013 20:12:41 +0000]
MinGW-w64: Don't compile dbm module

5 years agoMinGW-w64: Allow size_t (%z) format specifier.
Ray Donnelly [Tue, 7 May 2013 20:12:17 +0000]
MinGW-w64: Allow size_t (%z) format specifier.

..also, remove error:
Python doesn't support sizeof(pid_t) > sizeof(long)
because it does on Win64 where long is only 32 bit.

5 years agoMinGW-w64: Allow static tcltk (which I don't recommend)
Ray Donnelly [Tue, 7 May 2013 20:11:45 +0000]
MinGW-w64: Allow static tcltk (which I don't recommend)

5 years agoMinGW-w64: Add ISPAD define so that PDCurses can be used.
Ray Donnelly [Tue, 7 May 2013 20:11:29 +0000]
MinGW-w64: Add ISPAD define so that PDCurses can be used.

5 years agoMinGW-w64: Adopt unix filesystem layout for MinGW Python.
Ray Donnelly [Tue, 7 May 2013 20:11:05 +0000]
MinGW-w64: Adopt unix filesystem layout for MinGW Python.

5 years agoDarwin: Enable as a target for cross compilation
Ray Donnelly [Tue, 7 May 2013 20:10:37 +0000]
Darwin: Enable as a target for cross compilation

5 years agoDistutils (cygwinccompiler): Use CC and LD env. variables
Ray Donnelly [Tue, 7 May 2013 20:09:48 +0000]
Distutils (cygwinccompiler): Use CC and LD env. variables

..also, if gcc is found then override LD with the output
from 'CC --print-prog-name ld'

5 years agoMSYS: Add building on MSYSVPATH configure argument.
Ray Donnelly [Tue, 7 May 2013 20:07:41 +0000]
MSYS: Add building on MSYSVPATH configure argument.

When building on MSYS, VPATH ends up containing
un-translated paths which then fall over in
distutils. So VPATH also gets translated to
the Windows version and that version is passed
to disutils instead.

5 years agoMinGW-w64: Enable building the _msi module.
Ray Donnelly [Tue, 7 May 2013 20:06:51 +0000]
MinGW-w64: Enable building the _msi module.

note, this isn't enough for msi, but it's a good start

5 years agoMinGW-w64: Use a different header for regen
Ray Donnelly [Tue, 7 May 2013 20:05:32 +0000]
MinGW-w64: Use a different header for regen

..because /usr/include/netinet/in.h doesn't exist.
Instead we use include/stddef.h from the GCC installation,
located via -print-search-dirs trickery.

5 years agoMinGW-w64: Compile fix for REPARSE_DATA_BUFFER
Ray Donnelly [Tue, 7 May 2013 20:04:29 +0000]
MinGW-w64: Compile fix for REPARSE_DATA_BUFFER

..which is not declared in the MinGW-w64 headers.

5 years agoMinGW-w64: Switch to using the posix getpath code
Ray Donnelly [Tue, 7 May 2013 20:03:09 +0000]
MinGW-w64: Switch to using the posix getpath code

..in Modules/getpathp.c rather than the Windows version
in PC/getpath.c. This is because we want the posix
file layout.

5 years agoMinGW-w64: Add autoconf variable DELIM
Ray Donnelly [Tue, 7 May 2013 20:02:21 +0000]
MinGW-w64: Add autoconf variable DELIM

..Which is the path delimiter to use. Usually a colon
but on Windows a semi-colon.

5 years agoMinGW-w64: --with-system-ffi now looks for ffi.h.
Ray Donnelly [Tue, 7 May 2013 20:01:39 +0000]
MinGW-w64: --with-system-ffi now looks for ffi.h.

Windows 64 fixes for ffi.
Some ctypes fixes for MinGW(-w64).
(by Alexey Pavlov)

5 years agoMinGW-w64: Removal of the libffi changes
Ray Donnelly [Tue, 7 May 2013 19:59:56 +0000]
MinGW-w64: Removal of the libffi changes
Done this way so that Roumen's and Alexey's
patches can be updated more easily.

5 years agoMinGW-w64: Initial MinGW(-w64) feature patch.
Ray Donnelly [Tue, 7 May 2013 19:55:33 +0000]
MinGW-w64: Initial MinGW(-w64) feature patch.
(by Roumen Petrov and LRN)

5 years agoAdded unmodified Python-2.7.4 sources
Ray Donnelly [Tue, 7 May 2013 19:52:25 +0000]
Added unmodified Python-2.7.4 sources

Sha1sum of Python-2.7.4.tar.bz2 was:
deb8609d8e356b3388f33b6a4d6526911994e5b1

6 years agoRemove *.info
Andrew Hsieh [Fri, 11 Jan 2013 06:31:05 +0000]
Remove *.info

This concludes pushing out 12 local patches from
platform/ndk.git/build/tools/toolchain-patches/python/Python-2.7.3

Change-Id: I96234c594993d3913273b8a9f3dca7c439453575

6 years ago0011-re-configure-d.patch
Ray Donnelly [Fri, 11 Jan 2013 06:29:55 +0000]
0011-re-configure-d.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I10cce17063be87735a04c210ab2c6cb73c16c4de

6 years ago0010-add-python-config-sh.patch
Ray Donnelly [Fri, 11 Jan 2013 06:29:35 +0000]
0010-add-python-config-sh.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: Id62eede8ab164e44c92ebe8585b48eee8f655c4f

6 years ago0009-Disable-Grammar-dependency-on-pgen-executable.patch
Ray Donnelly [Fri, 11 Jan 2013 06:29:03 +0000]
0009-Disable-Grammar-dependency-on-pgen-executable.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: If8002d308d33313a3af7e0d1f3ef726caf6514d4

6 years ago0008-Python-disable-dbm.patch
Ray Donnelly [Fri, 11 Jan 2013 06:28:42 +0000]
0008-Python-disable-dbm.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: Ic31bf8b704269e502698ffa9937fd7f94265baa0

6 years ago0007-MINGW-x86_64-size_t-format-specifier-pid_t.patch
Ray Donnelly [Fri, 11 Jan 2013 06:28:16 +0000]
0007-MINGW-x86_64-size_t-format-specifier-pid_t.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: Iaa3ed3339b0089a5aa80504eb45cfee43c152a41

6 years ago0006-MINGW-static-tcltk.patch
Ray Donnelly [Fri, 11 Jan 2013 06:27:48 +0000]
0006-MINGW-static-tcltk.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I31e0c5c9ede5b0892b35a0f761ae7e880e5e6203

6 years ago0005-MINGW-pdcurses_ISPAD.patch
Ray Donnelly [Fri, 11 Jan 2013 06:27:28 +0000]
0005-MINGW-pdcurses_ISPAD.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I8357acaacd68fc6b597793455d8028f9dd5fcca4

6 years ago0004-MINGW-FIXES-sysconfig-like-posix.patch
Ray Donnelly [Fri, 11 Jan 2013 06:26:22 +0000]
0004-MINGW-FIXES-sysconfig-like-posix.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: Ic24813ec483ebb6faedf083b9518f6afe7ce81fc

6 years ago0003-DARWIN-CROSS.patch
Ray Donnelly [Fri, 11 Jan 2013 06:25:53 +0000]
0003-DARWIN-CROSS.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I9fb90152e843f94fd464025b55cc260d70c1d8eb

6 years ago0002-MINGW-use-posix-getpath.patch
Ray Donnelly [Fri, 11 Jan 2013 06:25:14 +0000]
0002-MINGW-use-posix-getpath.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I5da6b72e910cabbe77e1fa4629ae74c963728bde

6 years ago0001-MINGW.patch
Ray Donnelly [Fri, 11 Jan 2013 06:24:37 +0000]
0001-MINGW.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I336e93c288ef9e2e04da8958129b3dc36270dee4

6 years ago0000-CROSS.patch
Ray Donnelly [Fri, 11 Jan 2013 06:23:15 +0000]
0000-CROSS.patch

Used to be local patch in platform/ndk.git 4ec84cccdda14ab4ebcafbc6f3200a2cd2868586

Change-Id: I2871628c6e7eb4e1861910f97a8cbc952f466a10

6 years agoInitial commit of python 2.7.3
Andrew Hsieh [Fri, 11 Jan 2013 05:47:28 +0000]
Initial commit of python 2.7.3

Unmodified from http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2

Change-Id: I039eda3f4c19ad7d2ab6d0df728a6071f03d53c3

6 years agoInitial empty commit
Jean-Baptiste Queru [Fri, 14 Dec 2012 17:29:06 +0000]
Initial empty commit