initial commit with build for python 2.7.1 and sdl 1.3

This commit is contained in:
Stéphane Planquart 2011-11-29 19:48:05 +01:00
commit f387566b26
4426 changed files with 373874 additions and 0 deletions

167
build_python.sh Executable file
View file

@ -0,0 +1,167 @@
#!/bin/zsh
set -o errexit
set -x
echo "Starting =========="
# credit to:
# http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
# http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
export IOS_VERSION="5.0"
PATH_SIMU=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}-simulator
PATH_DEV=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}-device
PATH_ALL=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}
# download python and patch if they aren't there
if [[ ! -a Python-2.7.1.tar.bz2 ]]; then
curl http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tar.bz2 > python_files/Python-2.7.1.tar.bz2
fi
# get rid of old build
rm -rf Python-2.7.1
rm -rf $PATH_SIMU
rm -rf $PATH_DEV
rm -rf $PATH_ALL
if [[ -a libpython2.7-iOS5.a ]]; then
rm -fr libpython2.7-iOS5.a
fi
tar -xjf python_files/Python-2.7.1.tar.bz2
pushd ./Python-2.7.1
# Patch Python for temporary reduce PY_SSIZE_T_MAX otherzise, splitting string doesnet work
patch -p1 < ../python_files/Python-2.7.1-ssize-t-max.patch
echo "Building for native machine ============================================"
# Compile some stuff statically; Modules/Setup taken from pgs4a-kivy
cp ../python_files/ModulesSetup Modules/Setup.local
#CC=clang ./configure
./configure CC="clang -Qunused-arguments -fcolor-diagnostics"
make python.exe Parser/pgen
#make python Parser/pgen
mv python.exe hostpython
#mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean
# patch python to cross-compile
patch -p1 < ../python_files/Python-2.7.1-xcompile.patch
# avoid iphone builddd
#if [ "X" == "C" ]; then
echo "Building for iPhone Simulator ==========================================="
export MACOSX_DEPLOYMENT_TARGET=10.6
# set up environment variables for simulator compilation
export DEVROOT="/Developer/Platforms/iPhoneSimulator.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneSimulator${IOS_VERSION}.sdk"
if [ ! -d "$DEVROOT" ]; then
echo "DEVROOT doesn't exist. DEVROOT=$DEVROOT"
exit 1
fi
if [ ! -d "$SDKROOT" ]; then
echo "SDKROOT doesn't exist. SDKROOT=$SDKROOT"
exit 1
fi
export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$SDKROOT/usr/include/"
export CFLAGS="$CPPFLAGS -pipe -no-cpp-precomp -isysroot $SDKROOT"
export LDFLAGS="-isysroot $SDKROOT"
export CPP="/usr/bin/cpp $CPPFLAGS"
# Compile some stuff statically; Modules/Setup taken from pgs4a-kivy
cp ../python_files/ModulesSetup Modules/Setup.local
./configure CC="$DEVROOT/usr/bin/i686-apple-darwin11-llvm-gcc-4.2 -m32" \
LD="$DEVROOT/usr/bin/ld" --disable-toolbox-glue --host=i386-apple-darwin --prefix=/python
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \
CROSS_COMPILE_TARGET=yes
make install HOSTPYTHON=./hostpython CROSS_COMPILE_TARGET=yes prefix="$PWD/_install-simulator"
pushd _install-simulator/lib
mv libpython2.7.a libpython2.7-i386.a
popd
pushd _install-simulator
mkdir $PATH_SIMU
cp -R . $PATH_SIMU
popd
make distclean
#fi
export MACOSX_DEPLOYMENT_TARGET=
echo "Building for iOS ======================================================="
# set up environment variables for cross compilation
export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS${IOS_VERSION}.sdk"
if [ ! -d "$DEVROOT" ]; then
echo "DEVROOT doesn't exist. DEVROOT=$DEVROOT"
exit 1
fi
if [ ! -d "$SDKROOT" ]; then
echo "SDKROOT doesn't exist. SDKROOT=$SDKROOT"
exit 1
fi
export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$SDKROOT/usr/include/"
export CFLAGS="$CPPFLAGS -pipe -no-cpp-precomp -isysroot $SDKROOT"
export LDFLAGS="-isysroot $SDKROOT -Lextralibs/"
export CPP="/usr/bin/cpp $CPPFLAGS"
export CFLAGS = "$CFLAGS -march=armv7 -mcpu=arm1176jzf-s -mcpu=cortex-a8"
export LDFLAGS = "$LDFLAGS -march=armv7 -mcpu=arm1176jzf-s -mcpu=cortex-a8"
#export CFLAGS = "$CFLAGS -march=armv7"
#export LDFLAGS = "$LDFLAGS -march=armv7"
# make a link to a differently named library for who knows what reason
mkdir extralibs||echo "foo"
ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo "sdf"
#ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.6.dylib || echo "sdf"
# Compile some stuff statically; Modules/Setup taken from pgs4a-kivy
cp ../python_files/ModulesSetup Modules/Setup.local
# Put arm compiler in path, then ccache can use it
OLDPATH=$PATH
export PATH=$PATH:$DEVROOT/usr/bin
# XXX Should prolly use armv7 as well?
./configure CC="arm-apple-darwin10-llvm-gcc-4.2" \
LD="$DEVROOT/usr/bin/ld" --disable-toolbox-glue --host=armv7-apple-darwin --prefix=/python
# --without-doc-strings
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \
CROSS_COMPILE_TARGET=yes
make install HOSTPYTHON=./hostpython CROSS_COMPILE_TARGET=yes prefix="$PWD/_install"
# Restore old path
export PATH=$OLDPATH
pushd _install/lib
mv libpython2.7.a libpython2.7-arm.a
#lipo -create -output libpython2.7.a ../../libpython2.7-i386.a libpython2.7-arm.a
popd
pushd _install
mkdir $PATH_DEV
cp -R . $PATH_DEV
mkdir $PATH_ALL
cp -R . $PATH_ALL
lipo $PATH_DEV/lib/libpython2.7-arm.a $PATH_SIMU/lib/libpython2.7-i386.a -create -output $PATH_ALL/lib/libpython2.7-iOS5.a
find python2.7 | grep -E '*\.(py|pyc|so\.o|so\.a|so\.libs)$' | xargs rm
find python2.7 | grep -E '*test*' | xargs rm -rdf

3
build_sdl.sh Executable file
View file

@ -0,0 +1,3 @@
pushd sdl/sdl1.3/Xcode-iPhoneOS/SDL
xcodebuild -project SDLiPhoneOS.xcodeproj -alltargets
#the binarie is under sdl/sdl1.3/Xcode-iPhoneOS/SDL/build/Release-Universal/

24
clean_python.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/zsh
set -o errexit
set -x
echo "Starting cleaning=========="
# credit to:
# http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
# http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
export IOS_VERSION="5.0"
PATH_SIMU=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}-simulator
PATH_DEV=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}-device
PATH_ALL=${PWD}/python_files/Python-2.7.1-IOS${IOS_VERSION}
# get rid of old build
rm -rf Python-2.7.1
rm -rf $PATH_SIMU
rm -rf $PATH_DEV
rm -rf $PATH_ALL
if [[ -a libpython2.7-iOS5.a ]]; then
rm -fr libpython2.7-iOS5.a
fi

36
python_files/ModulesSetup Normal file
View file

@ -0,0 +1,36 @@
posix posixmodule.c # posix (UNIX) system calls
errno errnomodule.c # posix (UNIX) errno values
pwd pwdmodule.c # this is needed to find out the user's home dir
# if $HOME is not set
_sre _sre.c # Fredrik Lundh's new regular expressions
_codecs _codecsmodule.c # access to the builtin codecs and codec registry
zipimport zipimport.c
_symtable symtablemodule.c
array arraymodule.c # array objects
cmath cmathmodule.c # -lm # complex math library functions
math mathmodule.c # -lm # math library functions, e.g. sin()
_struct _struct.c # binary structure packing/unpacking
time timemodule.c # -lm # time operations and variables
operator operator.c # operator.add() and similar goodies
_weakref _weakref.c # basic weak reference support
_random _randommodule.c # Random number generator
_collections _collectionsmodule.c # Container types
itertools itertoolsmodule.c # Functions creating iterators for efficient looping
strop stropmodule.c # String manipulations
_functools _functoolsmodule.c # Tools for working with functions and callable objects
_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
datetime datetimemodule.c # date/time type
_bisect _bisectmodule.c # Bisection algorithms
fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
select selectmodule.c # select(2); not on ancient System V
_socket socketmodule.c
_md5 md5module.c md5.c
_sha shamodule.c
_sha256 sha256module.c
_sha512 sha512module.c
binascii binascii.c
parser parsermodule.c
cStringIO cStringIO.c
cPickle cPickle.c
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
xxsubtype xxsubtype.c

View file

@ -0,0 +1,301 @@
diff -uN Python-2.6.2/configure Python-2.6.2POld/configure
--- Python-2.6.2/configure 2009-03-31 03:56:14.000000000 +1000
@@ -24326,14 +24326,14 @@
{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
-if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-else
- cat >conftest.$ac_ext <<_ACEOF
+#if test "$cross_compiling" = yes; then
+# { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+#See \`config.log' for more details." >&5
+#echo "$as_me: error: cannot run test program while cross compiling
+#See \`config.log' for more details." >&2;}
+# { (exit 1); exit 1; }; }
+#else
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -24411,7 +24411,7 @@
echo "${ECHO_T}no" >&6; }
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+#fi
diff -uN Python-2.6.2/configure.in Python-2.6.2POld/configure.in
--- Python-2.6.2/configure.in 2009-03-31 03:56:14.000000000 +1000
+++ Python-2.6.2POld/configure.in 2009-08-17 12:19:15.000000000 +1000
@@ -3656,48 +3656,48 @@
AC_MSG_RESULT(no)
fi
-AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_SSIZE_T
-typedef ssize_t Py_ssize_t;
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-typedef long Py_ssize_t;
-#else
-typedef int Py_ssize_t;
-#endif
-
-int main()
-{
- char buffer[256];
-
- if(sprintf(buffer, "%zd", (size_t)123) < 0)
- return 1;
-
- if (strcmp(buffer, "123"))
- return 1;
-
- if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
- return 1;
-
- if (strcmp(buffer, "-123"))
- return 1;
-
- return 0;
-}],
-[AC_MSG_RESULT(yes)
- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+#AC_MSG_CHECKING(for %zd printf() format support)
+#AC_TRY_RUN([#include <stdio.h>
+##include <stddef.h>
+##include <string.h>
+
+##ifdef HAVE_SYS_TYPES_H
+##include <sys/types.h>
+##endif
+
+##ifdef HAVE_SSIZE_T
+#typedef ssize_t Py_ssize_t;
+##elif SIZEOF_VOID_P == SIZEOF_LONG
+#typedef long Py_ssize_t;
+##else
+#typedef int Py_ssize_t;
+##endif
+#
+#int main()
+#{
+# char buffer[256];
+#
+# if(sprintf(buffer, "%zd", (size_t)123) < 0)
+# return 1;#
+#
+# if (strcmp(buffer, "123"))
+# return 1;
+#
+# if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
+# return 1;
+#
+# if (strcmp(buffer, "-123"))
+# return 1;
+#
+# return 0;
+#}],
+#[AC_MSG_RESULT(yes)
+# AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
+# AC_MSG_RESULT(no))
AC_CHECK_TYPE(socklen_t,,
AC_DEFINE(socklen_t,int,
- Define to `int' if <sys/socket.h> does not define.),[
+ Define to 'int' if <sys/socket.h> does not define.),[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff -uN Python-2.6.2/Makefile.pre.in Python-2.6.2POld/Makefile.pre.in
--- Python-2.6.2/Makefile.pre.in 2009-02-24 21:07:44.000000000 +1000
+++ Python-2.6.2POld/Makefile.pre.in 2009-08-17 12:19:15.000000000 +1000
@@ -175,6 +175,7 @@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON)
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
@@ -206,6 +207,8 @@
# Parser
PGEN= Parser/pgen$(EXE)
+HOSTPGEN= $(PGEN)
+
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -394,8 +397,8 @@
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -517,7 +520,7 @@
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -886,24 +889,24 @@
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
@@ -1001,7 +1004,8 @@
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall:
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff -uN Python-2.6.2/setup.py Python-2.6.2POld/setup.py
--- Python-2.6.2/setup.py 2009-04-01 04:20:48.000000000 +1000
+++ Python-2.6.2POld/setup.py 2009-08-17 12:19:15.000000000 +1000
@@ -17,7 +17,7 @@
from distutils.command.install_lib import install_lib
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ['_ctypes']
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -267,33 +267,40 @@
self.announce('WARNING: skipping import check for Cygwin-based "%s"'
% ext.name)
return
+ if os.environ.get('CROSS_COMPILE_TARGET') == 'yes':
+ return
+
ext_filename = os.path.join(
self.build_lib,
self.get_ext_filename(self.get_ext_fullname(ext.name)))
try:
imp.load_dynamic(ext.name, ext_filename)
except ImportError, why:
- self.failed.append(ext.name)
- self.announce('*** WARNING: renaming "%s" since importing it'
- ' failed: %s' % (ext.name, why), level=3)
- assert not self.inplace
- basename, tail = os.path.splitext(ext_filename)
- newname = basename + "_failed" + tail
- if os.path.exists(newname):
- os.remove(newname)
- os.rename(ext_filename, newname)
-
- # XXX -- This relies on a Vile HACK in
- # distutils.command.build_ext.build_extension(). The
- # _built_objects attribute is stored there strictly for
- # use here.
- # If there is a failure, _built_objects may not be there,
- # so catch the AttributeError and move on.
- try:
- for filename in self._built_objects:
- os.remove(filename)
- except AttributeError:
- self.announce('unable to remove files (ignored)')
+ if os.environ.get('CROSS_COMPILE_TARGET') != "yes":
+ self.announce('*** WARNING: renaming "%s" since importing it'
+ ' failed: %s' % (ext.name, why), level=3)
+ assert not self.inplace
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+ if os.path.exists(newname):
+ os.remove(newname)
+ os.rename(ext_filename, newname)
+
+ # XXX -- This relies on a Vile HACK in
+ # distutils.command.build_ext.build_extension(). The
+ # _built_objects attribute is stored there strictly for
+ # use here.
+ # If there is a failure, _built_objects may not be there,
+ # so catch the AttributeError and move on.
+ try:
+ for filename in self._built_objects:
+ os.remove(filename)
+ except AttributeError:
+ self.announce('unable to remove files (ignored)')
+ else:
+ self.announce('WARNING: "%s" failed importing, but we leave it '
+ 'because we are cross-compiling' %
+ ext.name)
except:
exc_type, why, tb = sys.exc_info()
self.announce('*** WARNING: importing extension "%s" '
@@ -665,7 +672,7 @@
if (ssl_incs is not None and
ssl_libs is not None and
- openssl_ver >= 0x00907000):
+ openssl_ver >= 0x00907000 and False):
# The _hashlib module wraps optimized implementations
# of hash functions from the OpenSSL library.
exts.append( Extension('_hashlib', ['_hashopenssl.c'],
@@ -685,7 +692,7 @@
depends = ['md5.h']) )
missing.append('_hashlib')
- if (openssl_ver < 0x00908000):
+ if (True or openssl_ver < 0x00908000):
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
exts.append( Extension('_sha256', ['sha256module.c']) )
exts.append( Extension('_sha512', ['sha512module.c']) )

View file

@ -0,0 +1,17 @@
diff -Naur Python-2.7.1.orig/Include/pyport.h Python-2.7.1/Include/pyport.h
--- Python-2.7.1.orig/Include/pyport.h 2010-09-14 18:10:22.000000000 +0200
+++ Python-2.7.1/Include/pyport.h 2011-05-13 12:24:53.000000000 +0200
@@ -186,9 +186,11 @@
#endif
/* Largest positive value of type Py_ssize_t. */
-#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
+//#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
/* Smallest negative value of type Py_ssize_t. */
-#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
+//#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
+#define PY_SSIZE_T_MAX TMP_MAX
+#define PY_SSIZE_T_MIN -TMP_MAX
#if SIZEOF_PID_T > SIZEOF_LONG
# error "Python doesn't support sizeof(pid_t) > sizeof(long)"

View file

@ -0,0 +1,138 @@
diff -Naur Python-2.7-old/Makefile.pre.in Python-2.7-new/Makefile.pre.in
--- Python-2.7-old/Makefile.pre.in 2010-04-11 17:10:46.000000000 -0700
+++ Python-2.7-new/Makefile.pre.in 2010-07-09 13:40:47.000000000 -0700
@@ -179,6 +179,7 @@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON)
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
@@ -212,6 +213,8 @@
# Parser
PGEN= Parser/pgen$(EXE)
+HOSTPGEN= $(PGEN)
+
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -404,8 +407,8 @@
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -538,7 +541,7 @@
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -919,26 +922,26 @@
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
@@ -1042,8 +1045,10 @@
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
-sharedinstall: sharedmods
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+sharedinstall: sharedmods
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ --skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff -Naur Python-2.7-old/setup.py Python-2.7-new/setup.py
--- Python-2.7-old/setup.py 2010-06-27 05:36:16.000000000 -0700
+++ Python-2.7-new/setup.py 2010-07-09 13:54:29.000000000 -0700
@@ -23,6 +23,10 @@
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
+# _ctypes fails to cross-compile due to the libffi configure script.
+if os.environ.has_key('PYTHONXCPREFIX'):
+ disabled_module_list.append('_ctypes')
+
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
1) 'dir' is not already in 'dirlist'
@@ -278,6 +282,14 @@
(ext.name, sys.exc_info()[1]))
self.failed.append(ext.name)
return
+
+ # Inport check will not work when cross-compiling.
+ if os.environ.has_key('PYTHONXCPREFIX'):
+ self.announce(
+ 'WARNING: skipping inport check for cross-compiled: "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:
--- Python-2.7Orig/configure 2011-04-29 22:30:59.231331437 +1000
+++ Python-2.7/configure 2010-05-29 01:28:47.000000000 +1000
@@ -13517,7 +13517,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_have_long_long_format=no
+ ac_cv_have_long_long_format="cross -- assuming yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13569,7 +13569,7 @@
$as_echo "$ac_cv_have_long_long_format" >&6; }
fi
-if test "$ac_cv_have_long_long_format" = yes
+if test "$ac_cv_have_long_long_format" != no
then
$as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h

View file

@ -0,0 +1,24 @@
Index: Modules/posixmodule.c
===================================================================
--- Modules/posixmodule.c (revision 52827)
+++ Modules/posixmodule.c (working copy)
@@ -314,7 +314,7 @@
#endif
/* Return a dictionary corresponding to the POSIX environment table */
-#ifdef WITH_NEXT_FRAMEWORK
+#ifdef __APPLE__
/* On Darwin/MacOSX a shared library or framework has no access to
** environ directly, we must obtain it with _NSGetEnviron().
*/
@@ -332,7 +332,7 @@
d = PyDict_New();
if (d == NULL)
return NULL;
-#ifdef WITH_NEXT_FRAMEWORK
+#ifdef __APPLE__
if (environ == NULL)
environ = *_NSGetEnviron();
#endif

View file

@ -0,0 +1,57 @@
[patterns]
.hgeol = native
.hgignore = native
BUGS = native
CREDITS = native
INSTALL = native
NOTES = native
TODO = native
WhatsNew = native
**COPYING = native
**README = native
**doxyfile = native
**Doxyfile = native
**install-sh = LF
**mkinstalldirs = LF
**Makefile = LF
**Makefile.* = LF
test/automated/rwops/read = LF
**README.* = native
**.S = native
**.bmp = BIN
**.c = native
**.cc = native
**.cpp = native
**.csh = LF
**.dat = BIN
**.gdbinit = LF
build-scripts/config.guess = LF
**.h = native
**.htm = native
**.html = native
**.icns = BIN
**.in = LF
**.java = native
**.m = native
**.m4 = native
**.mk = LF
**.nib = BIN
**.pch = BIN
**.pdf = BIN
**.pl = native
**.plist = native
**.png = BIN
.indent.pro = LF
**.rc = native
**.rtf = BIN
**.sh = LF
**.sln = native
**.txt = native
**.vcp = native
**.vcproj = native
**.vcw = native
**.vcxproj = native
**.wav = BIN
**.xbm = BIN
**.xml = native
**.zip = BIN

Binary file not shown.

1
sdl/sdl1.3/.hg/branch Normal file
View file

@ -0,0 +1 @@
default

16
sdl/sdl1.3/.hg/cache/branchheads vendored Normal file
View file

@ -0,0 +1,16 @@
c781fe3628a1d9ebfe5beb62dabf551fcef053aa 6098
2bf2dee62ea78891c2d412d7bbabfd6c37782216 SDL-ryan-multiple-audio-device
f2d8e0b59ccac6688e7a5c89399f7c842507968e default
c781fe3628a1d9ebfe5beb62dabf551fcef053aa default
119b676a2600d56045c30dd8123e66ad102649f9 gsoc2008_force_feedback
21196203ffa418741817dbea53ad8913edd68784 gsoc2009_IME
6f025b97c55c675b335c708414de782ee7347fec gsoc2008_iphone
ab53c78e0f3bb72ddeacb70e2183153e18bbb8c0 gsoc2009_ps3
2e253188dcd2148f595b30a52abdf53e56e3aa39 SDL-1.2-olpc
e2188009f029855da921a041bbcf95303ca509cc gsoc2008_nds
185f8588deaa9c9790cb91730eb6e59dd9a27392 SDL-1.2
06be4b33029d9e4012380084dd37dc1730062921 SDL-1.3
c5616d36b2ac4723906170b4608a0ad49f1f98d9 gsoc2009_unit_tests
14a08e45a4d36b93c8db8f850f483316c2f3ae25 gsoc2008_audio_resampling
b95bb58b703af987349d3603a7d008e11a061d7a experimental
c62835c40174a087d0082bf6e52103d6d6f02c27 gsoc2008_manymouse

31
sdl/sdl1.3/.hg/cache/tags vendored Normal file
View file

@ -0,0 +1,31 @@
6098 c781fe3628a1d9ebfe5beb62dabf551fcef053aa a1616a61e966c1b1136d6ca57a0e7165441d603a
6087 185f8588deaa9c9790cb91730eb6e59dd9a27392
5551 b95bb58b703af987349d3603a7d008e11a061d7a a1616a61e966c1b1136d6ca57a0e7165441d603a
5079 f2d8e0b59ccac6688e7a5c89399f7c842507968e a1616a61e966c1b1136d6ca57a0e7165441d603a
4416 06be4b33029d9e4012380084dd37dc1730062921
4415 2bf2dee62ea78891c2d412d7bbabfd6c37782216
4414 2e253188dcd2148f595b30a52abdf53e56e3aa39
4413 14a08e45a4d36b93c8db8f850f483316c2f3ae25
4412 c62835c40174a087d0082bf6e52103d6d6f02c27
4411 6f025b97c55c675b335c708414de782ee7347fec
4410 119b676a2600d56045c30dd8123e66ad102649f9
4409 e2188009f029855da921a041bbcf95303ca509cc
4408 c5616d36b2ac4723906170b4608a0ad49f1f98d9
4407 21196203ffa418741817dbea53ad8913edd68784
4406 ab53c78e0f3bb72ddeacb70e2183153e18bbb8c0
cfcb2e1c36ebe9809577adf768b0ec53e8768af9 release-1.2.8
e044e7c70a50a2f54d14ee20d0933e904e5853b6 release-1.2.9
86de11faf082881ad9b73a1a1d78733ca07f8db8 release-1.2.6
0afe0e38e02cf2048e93582f01c52fbb91d3c7bb release-1.2.7
3c052d3bcc76c899dfd4846be76243a78e8c7180 release-1.2.4
230b156829ed13b31134d96f689c917981f57b84 release-1.2.5
bb051fa871aa0b53ea57df56a446cec3bb85924c release-1.2.2
2fe3fbd2bff50165b3cad33bf40d70b3bb3c9fd0 release-1.2.3
6e28dae59e3baf4447c83e833a8d2ac912536f5b release-1.2.1
39c22a953456f6c9e2c8993c8ff973824104102a pre-touch-removal
3c5eed71a3320962551af3b3dfbee0c99fcf0086 release-1.2.10
27cab50ec9c746e886ce0f3fdaa0b0cdc55a594f release-1.2.11
4867f7f7dd3426d1dbbeef48b3f3b3aa19590cc4 release-1.2.12
7c2589fb8d4df54c6faabd3faebd0c0e73f67879 release-1.2.13
f14cf9d71233934811774f941d0de121d5f96ccf release-1.2.14

BIN
sdl/sdl1.3/.hg/dirstate Normal file

Binary file not shown.

2
sdl/sdl1.3/.hg/hgrc Normal file
View file

@ -0,0 +1,2 @@
[paths]
default = http://hg.libsdl.org/SDL

4
sdl/sdl1.3/.hg/requires Normal file
View file

@ -0,0 +1,4 @@
revlogv1
store
fncache
dotencode

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more