diff --git a/pythonforandroid/bootstraps/pygame/build/jni/Application.mk b/pythonforandroid/bootstraps/pygame/build/jni/Application.mk index d2f9b30214..d5df075c52 100644 --- a/pythonforandroid/bootstraps/pygame/build/jni/Application.mk +++ b/pythonforandroid/bootstraps/pygame/build/jni/Application.mk @@ -5,7 +5,7 @@ APP_PROJECT_PATH := $(call my-dir)/.. # sdl_image depends on png and jpeg # sdl_ttf depends on freetype -APP_MODULES := application sdl sdl_main tremor png jpeg freetype sdl_ttf sdl_image sqlite3 +APP_MODULES := application sdl sdl_main tremor png jpeg freetype sdl_ttf sdl_image APP_ABI := $(ARCH) # AND: I have no idea why I have to specify app_platform when distribute.sh seems to just set the sysroot cflag diff --git a/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonActivity.java b/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonActivity.java index aed7e9ed89..a7d18986e2 100644 --- a/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonActivity.java +++ b/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonActivity.java @@ -45,6 +45,22 @@ public class PythonActivity extends Activity implements Runnable { private static String TAG = "Python"; + // The libraries + protected static String[] getLibraries() { + return new String[] { + "sdl", + "sdl_image", + "sdl_ttf", + "sdl_mixer", + "sqlite3", + "ffi", + "python2.7", + "application", + "sdl_main", + }; + } + + // The audio thread for streaming audio... private static AudioThread mAudioThread = null; @@ -247,30 +263,25 @@ public void run() { unpackData("private", getFilesDir()); unpackData("public", externalStorage); - System.loadLibrary("sdl"); - System.loadLibrary("sdl_image"); - System.loadLibrary("sdl_ttf"); - System.loadLibrary("sdl_mixer"); - System.loadLibrary("python2.7"); - System.loadLibrary("application"); - System.loadLibrary("sdl_main"); + for (String lib : getLibraries()) { + try { + System.loadLibrary(lib); + } catch(UnsatisfiedLinkError e) { + if (lib.startsWith("sqlite3")) { + Log.i("python", "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } + if (lib.startsWith("ffi")) { + Log.i("python", "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } + throw e; + } + } System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so"); System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so"); - try { - System.loadLibrary("sqlite3"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_sqlite3.so"); - } catch(UnsatisfiedLinkError e) { - } - - try { - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imaging.so"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imagingft.so"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imagingmath.so"); - } catch(UnsatisfiedLinkError e) { - } - if ( mAudioThread == null ) { Log.i("python", "Starting audio thread"); mAudioThread = new AudioThread(this); diff --git a/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonService.java b/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonService.java index 321ee6094d..6b4bddcda2 100644 --- a/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonService.java +++ b/pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/PythonService.java @@ -12,6 +12,21 @@ public class PythonService extends Service implements Runnable { + // The libraries + protected static String[] getLibraries() { + return new String[] { + "sdl", + "sdl_image", + "sdl_ttf", + "sdl_mixer", + "sqlite3", + "ffi", + "python2.7", + "application", + "sdl_main", + }; + } + // Thread for Python code private Thread pythonThread = null; @@ -78,30 +93,25 @@ public void onDestroy() { public void run(){ // libraries loading, the same way PythonActivity.run() do - System.loadLibrary("sdl"); - System.loadLibrary("sdl_image"); - System.loadLibrary("sdl_ttf"); - System.loadLibrary("sdl_mixer"); - System.loadLibrary("python2.7"); - System.loadLibrary("application"); - System.loadLibrary("sdl_main"); + for (String lib : getLibraries()) { + try { + System.loadLibrary(lib); + } catch(UnsatisfiedLinkError e) { + if (lib.startsWith("sqlite3")) { + Log.i("python", "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } + if (lib.startsWith("ffi")) { + Log.i("python", "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } + throw e; + } + } System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so"); System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so"); - try { - System.loadLibrary("sqlite3"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_sqlite3.so"); - } catch(UnsatisfiedLinkError e) { - } - - try { - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imaging.so"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imagingft.so"); - System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_imagingmath.so"); - } catch(UnsatisfiedLinkError e) { - } - this.mService = this; nativeInitJavaEnv(); nativeStart(androidPrivate, androidArgument, pythonHome, pythonPath, diff --git a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java index a488a1b878..8326477a3c 100644 --- a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java +++ b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java @@ -14,6 +14,8 @@ protected static String[] getLibraries() { "SDL2_image", "SDL2_mixer", "SDL2_ttf", + "sqlite3", + "ffi", "python2.7", "python3.5m", "main" @@ -33,6 +35,14 @@ public static void loadLibraries(File filesDir) { skippedPython = true; continue; } + if (lib.startsWith("sqlite3")) { + Log.v(TAG, "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } + if (lib.startsWith("ffi")) { + Log.v(TAG, "Failed to load lib" + lib + ".so, but that's okay, it's an optional library"); + continue; + } throw e; } } @@ -43,13 +53,6 @@ public static void loadLibraries(File filesDir) { } catch(UnsatisfiedLinkError e) { Log.v(TAG, "Failed to load _io.so or unicodedata.so...but that's okay."); } - - try { - // System.loadLibrary("ctypes"); - System.load(filesDirPath + "/lib/python2.7/lib-dynload/_ctypes.so"); - } catch(UnsatisfiedLinkError e) { - Log.v(TAG, "Unsatisfied linker when loading ctypes"); - } Log.v(TAG, "Loaded everything!"); } diff --git a/pythonforandroid/recipes/hostpython2/Setup b/pythonforandroid/recipes/hostpython2/Setup index d21c893650..bf30747406 100644 --- a/pythonforandroid/recipes/hostpython2/Setup +++ b/pythonforandroid/recipes/hostpython2/Setup @@ -109,7 +109,7 @@ PYTHONPATH=$(COREPYTHONPATH) # various reasons; therefore they are listed here instead of in the # normal order. -# This only contains the minimal set of modules required to run the +# This only contains the minimal set of modules required to run the # setup.py script in the root of the Python source tree. posix posixmodule.c # posix (UNIX) system calls @@ -118,6 +118,7 @@ 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 +_weakref _weakref.c # weak references # The zipimport module is always imported at startup. Having it as a # builtin module avoids some bootstrapping problems and reduces overhead. @@ -126,9 +127,9 @@ zipimport zipimport.c # The rest of the modules listed in this file are all commented out by # default. Usually they can be detected and built as dynamically # loaded modules by the new setup.py script added in Python 2.1. If -# you're on a platform that doesn't support dynamic loading, want to -# compile modules statically into the Python binary, or need to -# specify some odd set of compiler switches, you can uncomment the +# you're on a platform that doesn't support dynamic loading, want to +# compile modules statically into the Python binary, or need to +# specify some odd set of compiler switches, you can uncomment the # appropriate lines below. # ====================================================================== @@ -168,16 +169,16 @@ GLHACK=-Dclear=__GLclear # Modules that should always be present (non UNIX dependent): array arraymodule.c # array objects -cmath cmathmodule.c # -lm # complex math library functions -math mathmodule.c # -lm # math library functions, e.g. sin() +cmath cmathmodule.c _math.c # -lm # complex math library functions +math mathmodule.c # _math.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 #_testcapi _testcapimodule.c # Python C API test module _random _randommodule.c # Random number generator _collections _collectionsmodule.c # Container types -itertools itertoolsmodule.c # Functions creating iterators for efficient looping +#_heapq _heapqmodule.c # Heapq type +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 @@ -190,13 +191,16 @@ _bisect _bisectmodule.c # Bisection algorithms # access to ISO C locale support #_locale _localemodule.c # -lintl +# Standard I/O baseline +#_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c + # Modules with some UNIX dependencies -- on by default: # (If you have a really backward UNIX, select and socket may not be # supported...) fcntl fcntlmodule.c # fcntl(2) and ioctl(2) -#spwd spwdmodule.c # spwd(3) +#spwd spwdmodule.c # spwd(3) #grp grpmodule.c # grp(3) select selectmodule.c # select(2); not on ancient System V @@ -299,7 +303,7 @@ _sha512 sha512module.c #sunaudiodev sunaudiodev.c -# A Linux specific module -- off by default; this may also work on +# A Linux specific module -- off by default; this may also work on # some *BSDs. #linuxaudiodev linuxaudiodev.c @@ -365,7 +369,7 @@ _sha512 sha512module.c #_curses _cursesmodule.c -lcurses -ltermcap # Wrapper for the panel library that's part of ncurses and SYSV curses. -#_curses_panel _curses_panel.c -lpanel -lncurses +#_curses_panel _curses_panel.c -lpanel -lncurses # Generic (SunOS / SVR4) dynamic loading module. diff --git a/pythonforandroid/recipes/hostpython2/__init__.py b/pythonforandroid/recipes/hostpython2/__init__.py index 785c4b7387..c7f909fd27 100644 --- a/pythonforandroid/recipes/hostpython2/__init__.py +++ b/pythonforandroid/recipes/hostpython2/__init__.py @@ -1,13 +1,13 @@ from pythonforandroid.toolchain import Recipe, shprint, current_directory, info, warning from os.path import join, exists -from os import chdir +from os import environ import sh class Hostpython2Recipe(Recipe): - version = '2.7.2' - url = 'http://python.org/ftp/python/{version}/Python-{version}.tar.bz2' + version = '2.7.11' + url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz' name = 'hostpython2' conflicts = ['hostpython3'] @@ -20,14 +20,24 @@ def get_build_container_dir(self, arch=None): def get_build_dir(self, arch=None): return join(self.get_build_container_dir(), self.name) + def should_build(self, arch): + if exists(join(self.get_build_dir(), 'hostpython')): + info('Setting ctx hostpython2 from previous build...') + self.ctx.hostpython = join(self.get_build_dir(), 'hostpython') + self.ctx.hostpgen = join(self.get_build_dir(), 'hostpgen') + return False + else: + info('Must build hostpython2...') + return True + def prebuild_arch(self, arch): # Override hostpython Setup? shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'), join(self.get_build_dir(), 'Modules', 'Setup')) def build_arch(self, arch): + env = dict(environ) with current_directory(self.get_build_dir()): - if exists('hostpython'): info('hostpython already exists, skipping build') self.ctx.hostpython = join(self.get_build_dir(), @@ -35,11 +45,11 @@ def build_arch(self, arch): self.ctx.hostpgen = join(self.get_build_dir(), 'hostpgen') return - + configure = sh.Command('./configure') - shprint(configure) - shprint(sh.make, '-j5') + shprint(configure, _env=env) + shprint(sh.make, '-j5', _env=env) shprint(sh.mv, join('Parser', 'pgen'), 'hostpgen') diff --git a/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py b/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py index af7ec6b11b..bd30e975eb 100644 --- a/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py +++ b/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py @@ -1,5 +1,6 @@ -from pythonforandroid.toolchain import BootstrapNDKRecipe, current_directory, shprint, info -from os.path import exists, join +from pythonforandroid.toolchain import BootstrapNDKRecipe, current_directory +from pythonforandroid.logger import shprint, info +from os.path import exists, join, basename import sh import glob @@ -19,9 +20,10 @@ def prebuild_arch(self, arch): return for dirn in glob.glob(join(self.get_build_dir(arch), 'pygame_bootstrap_jni', '*')): - shprint(sh.mv, dirn, './') + if basename(dirn) not in ['sqlite3']: + shprint(sh.mv, dirn, './') info('Unpacking was successful, deleting original container dir') shprint(sh.rm, '-rf', self.get_build_dir(arch)) - + recipe = PygameJNIComponentsRecipe() diff --git a/pythonforandroid/recipes/python2/__init__.py b/pythonforandroid/recipes/python2/__init__.py index 84bee9ef01..2e0058e207 100644 --- a/pythonforandroid/recipes/python2/__init__.py +++ b/pythonforandroid/recipes/python2/__init__.py @@ -8,38 +8,49 @@ class Python2Recipe(TargetPythonRecipe): - version = "2.7.2" - url = 'http://python.org/ftp/python/{version}/Python-{version}.tar.bz2' + version = "2.7.11" + url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz' name = 'python2' depends = ['hostpython2'] conflicts = ['python3crystax', 'python3'] - opt_depends = ['openssl','sqlite3'] - - patches = ['patches/Python-{version}-xcompile.patch', - 'patches/Python-{version}-ctypes-disable-wchar.patch', - 'patches/disable-modules.patch', - 'patches/fix-locale.patch', + opt_depends = ['openssl', 'libffi', 'sqlite3'] + + patches = [ # APPLY NEW 2.7.11 PATCHES + 'patches/Python-{version}-xcompile.patch', + 'patches/Python_{version}-ctypes-libffi-fix-configure.patch', + 'patches/ffi-config.sub-{version}.patch', + 'patches/fix-locale-{version}.patch', + 'patches/modules-locales-{version}.patch', + 'patches/fix-platform-{version}.patch', + + # APPLY OLD WORKING 2.7.2 PATCHES 'patches/fix-gethostbyaddr.patch', - 'patches/fix-setup-flags.patch', 'patches/fix-filesystemdefaultencoding.patch', 'patches/fix-termios.patch', 'patches/custom-loader.patch', - 'patches/verbose-compilation.patch', 'patches/fix-remove-corefoundation.patch', 'patches/fix-dynamic-lookup.patch', 'patches/fix-dlfcn.patch', - 'patches/parsetuple.patch', - 'patches/ctypes-find-library-updated.patch', + 'patches/ctypes-find-library.patch', + 'patches/Python-{version}-ctypes-disable-wchar.patch', + 'patches/disable-modules.patch', + 'patches/verbose-compilation.patch', + + # SPECIAL PATCHES ('patches/fix-configure-darwin.patch', is_darwin), ('patches/fix-distutils-darwin.patch', is_darwin), ('patches/fix-ftime-removal.patch', is_api_gt(19)), - ('patches/disable-openpty.patch', check_all(is_api_lt(21), is_ndk('crystax')))] + ('patches/disable-openpty.patch', check_all(is_api_lt(21), is_ndk('crystax'))) + + ] from_crystax = False - def build_arch(self, arch): + def prebuild_arch(self, arch): + super(Python2Recipe, self).prebuild_arch(arch) + def build_arch(self, arch): if not exists(join(self.get_build_dir(arch.arch), 'libpython2.7.so')): self.do_python_build(arch) @@ -47,7 +58,6 @@ def build_arch(self, arch): shprint(sh.cp, '-a', join(self.get_build_dir(arch.arch), 'python-install'), self.ctx.get_python_install_dir()) - # This should be safe to run every time info('Copying hostpython binary to targetpython folder') shprint(sh.cp, self.ctx.hostpython, join(self.ctx.get_python_install_dir(), 'bin', 'python.host')) @@ -56,97 +66,114 @@ def build_arch(self, arch): if not exists(join(self.ctx.get_libs_dir(arch.arch), 'libpython2.7.so')): shprint(sh.cp, join(self.get_build_dir(arch.arch), 'libpython2.7.so'), self.ctx.get_libs_dir(arch.arch)) - - # # if exists(join(self.get_build_dir(arch.arch), 'libpython2.7.so')): - # if exists(join(self.ctx.libs_dir, 'libpython2.7.so')): - # info('libpython2.7.so already exists, skipping python build.') - # if not exists(join(self.ctx.get_python_install_dir(), 'libpython2.7.so')): - # info('Copying python-install to dist-dependent location') - # shprint(sh.cp, '-a', 'python-install', self.ctx.get_python_install_dir()) - # self.ctx.hostpython = join(self.ctx.get_python_install_dir(), 'bin', 'python.host') - - # return - def do_python_build(self, arch): - - hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx) shprint(sh.cp, self.ctx.hostpython, self.get_build_dir(arch.arch)) - shprint(sh.cp, self.ctx.hostpgen, self.get_build_dir(arch.arch)) + shprint(sh.cp, self.ctx.hostpgen, join(self.get_build_dir(arch.arch), 'Parser')) hostpython = join(self.get_build_dir(arch.arch), 'hostpython') - hostpgen = join(self.get_build_dir(arch.arch), 'hostpython') with current_directory(self.get_build_dir(arch.arch)): - - hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx) shprint(sh.cp, join(hostpython_recipe.get_recipe_dir(), 'Setup'), 'Modules') + with open('config.site', 'w') as config_site: + config_site.write(''' + ac_cv_file__dev_ptmx=no + ac_cv_file__dev_ptc=no + ac_cv_have_long_long_format=yes + ''') env = arch.get_env() - # AND: Should probably move these to get_recipe_env for - # neatness, but the whole recipe needs tidying along these - # lines - env['HOSTARCH'] = 'arm-eabi' - env['BUILDARCH'] = shprint(sh.gcc, '-dumpmachine').stdout.decode('utf-8').split('\n')[0] - env['CFLAGS'] = ' '.join([env['CFLAGS'], '-DNO_MALLINFO']) + env['RFS'] = "{0}/platforms/android-{1}/arch-arm".format(self.ctx.ndk_dir, self.ctx.android_api) + env['CONFIG_SITE'] = join(self.get_build_dir(arch.arch), 'config.site') + env['HOSTARCH'] = 'arm-linux-androideabi' + env['BUILDARCH'] = shprint(sh.gcc, '-dumpmachine').stdout.split('\n')[0] + + env['CFLAGS'] = ' '.join([env['CFLAGS'], + '-g0', '-Os', '-s', '-I{0}/usr/include'.format(env['RFS']), + '-fdata-sections', '-ffunction-sections', + # '-DNO_MALLINFO' + ]) + env['LDFLAGS'] = ' '.join([env['LDFLAGS'], + '-L{0}/usr/lib'.format(env['RFS']), '-L{0}lib'.format(env['RFS'])]) # TODO need to add a should_build that checks if optional # dependencies have changed (possibly in a generic way) if 'openssl' in self.ctx.recipe_build_order: - openssl_build_dir = Recipe.get_recipe('openssl', self.ctx).get_build_dir(arch.arch) - setuplocal = join('Modules', 'Setup.local') - shprint(sh.cp, join(self.get_recipe_dir(), 'Setup.local-ssl'), setuplocal) - shprint(sh.sed, '-i', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), setuplocal) + openssl_recipe = Recipe.get_recipe('openssl', self.ctx) + openssl_build_dir = openssl_recipe.get_build_dir(arch.arch) + openssl_libs_dir = openssl_build_dir + openssl_inc_dir = join(openssl_libs_dir, 'include') + + info("Activate flags for ssl") + if openssl_recipe.build_static: + env['CFLAGS'] = ' '.join([env['CFLAGS'], '-Bstatic', '-lcrypto', '-lssl']) + env['CFLAGS'] = ' '.join([env['CFLAGS'], '-I{}'.format(openssl_inc_dir), + '-I{}/openssl'.format(openssl_inc_dir)]) + env['LDFLAGS'] = ' '.join([env['LDFLAGS'], '-L{}'.format(openssl_libs_dir), '-lcrypto', '-lssl']) + + info("\t->Updating files to support ssl".format(self.version)) + shprint(sh.sed, '-i', 's#/path-to-ssl-build-dir#{}#'.format(openssl_build_dir), + join(self.get_build_dir(arch.arch), 'Modules', 'Setup.dist')) + shprint(sh.sed, '-i', 's#/path-to-ssl-build-dir#{}#'.format(openssl_build_dir), + join(self.get_build_dir(arch.arch), 'setup.py')) if 'sqlite3' in self.ctx.recipe_build_order: - # Include sqlite3 in python2 build - r = Recipe.get_recipe('sqlite3', self.ctx) - i = ' -I' + r.get_build_dir(arch.arch) - l = ' -L' + r.get_lib_dir(arch) + ' -lsqlite3' - # Insert or append to env - f = 'CPPFLAGS' - env[f] = env[f] + i if f in env else i - f = 'LDFLAGS' - env[f] = env[f] + l if f in env else l + info("Activate flags for sqlite3") + sqlite3 = Recipe.get_recipe('sqlite3', self.ctx) + sqlite_inc_dir = sqlite3.get_build_dir(arch.arch) + sqlite_libs_dir = join(sqlite3.get_lib_dir(arch)) + env['CFLAGS'] = ' '.join([env['CFLAGS'], '-I{}'.format(sqlite_inc_dir)]) + env['LDFLAGS'] = ' '.join([env['LDFLAGS'], '-L{}'.format(sqlite_libs_dir), '-lsqlite3']) + + info("\t->Updating files to support libsqlite3...") + shprint(sh.sed, '-i', 's#/path-to-sqlite3-include-dir#{}#'.format(sqlite_inc_dir), + join(self.get_build_dir(arch.arch), 'setup.py')) + shprint(sh.sed, '-i', 's#/path-to-sqlite3-lib-dir#{}#'.format(sqlite_libs_dir), + join(self.get_build_dir(arch.arch), 'setup.py')) + + if 'libffi' in self.ctx.recipe_build_order: + info("Activate flags for ffi") + ffi_inc_dir = join(Recipe.get_recipe('libffi', self.ctx).get_build_dir(arch.arch), 'include') + ffi_libs_dir = Recipe.get_recipe('libffi', self.ctx).get_lib_dir(arch) + + env['LIBFFI_CFLAGS'] = ' '.join([env['CFLAGS'], '-I{}'.format(ffi_inc_dir)]) + env['LIBFFI_LIBS'] = ' '.join(['-L{}'.format(ffi_libs_dir), '-lffi']) + + env['CFLAGS'] = ' '.join([env['CFLAGS'], '-I{}'.format(ffi_inc_dir)]) + env['LDFLAGS'] = ' '.join([env['LDFLAGS'], '-L{}'.format(ffi_libs_dir), '-lffi']) + + env['CFLAGS'] = ' '.join([env['CFLAGS'], '-Wformat']) configure = sh.Command('./configure') # AND: OFLAG isn't actually set, should it be? shprint(configure, + 'CROSS_COMPILE_TARGET=yes', '--host={}'.format(env['HOSTARCH']), '--build={}'.format(env['BUILDARCH']), # 'OPT={}'.format(env['OFLAG']), '--prefix={}'.format(realpath('./python-install')), '--enable-shared', - '--disable-toolbox-glue', - '--disable-framework', - _env=env) - - # AND: tito left this comment in the original source. It's still true! - # FIXME, the first time, we got a error at: - # python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h - # /home/tito/code/python-for-android/build/python/Python-2.7.2/python: 1: Syntax error: word unexpected (expecting ")") - # because at this time, python is arm, not x86. even that, why /usr/include/netinet/in.h is used ? - # check if we can avoid this part. - - make = sh.Command(env['MAKE'].split(' ')[0]) - print('First install (expected to fail...') - try: - shprint(make, '-j5', 'install', 'HOSTPYTHON={}'.format(hostpython), - 'HOSTPGEN={}'.format(hostpgen), - 'CROSS_COMPILE_TARGET=yes', - 'INSTSONAME=libpython2.7.so', - _env=env) - except sh.ErrorReturnCode_2: - print('First python2 make failed. This is expected, trying again.') - - - print('Second install (expected to work)') - shprint(sh.touch, 'python.exe', 'python') - shprint(make, '-j5', 'install', 'HOSTPYTHON={}'.format(hostpython), - 'HOSTPGEN={}'.format(hostpgen), + '--with-system-ffi', + '--disable-ipv6', + # '--disable-toolbox-glue', + # '--disable-framework', + 'PYTHON_FOR_BUILD={}'.format(hostpython), + _env=env + ) + + print('Make compile ...') + shprint(sh.make, '-j5', 'CROSS_COMPILE_TARGET=yes', 'INSTSONAME=libpython2.7.so', - _env=env) + _env=env + ) + + print('Make install ...') + shprint(sh.make, '-j5', 'install', + 'CROSS_COMPILE_TARGET=yes', + 'INSTSONAME=libpython2.7.so', + _env=env + ) if is_darwin(): shprint(sh.cp, join(self.get_recipe_dir(), 'patches', '_scproxy.py'), @@ -154,28 +181,14 @@ def do_python_build(self, arch): shprint(sh.cp, join(self.get_recipe_dir(), 'patches', '_scproxy.py'), join('python-install', 'lib', 'python2.7')) - # reduce python + # REDUCE PYTHON for dir_name in ('test', join('json', 'tests'), 'lib-tk', join('sqlite3', 'test'), join('unittest, test'), join('lib2to3', 'tests'), join('bsddb', 'tests'), join('distutils', 'tests'), join('email', 'test'), 'curses'): - shprint(sh.rm, '-rf', join('python-install', + shprint(sh.rm, '-rf', join(self.ctx.build_dir, 'python-install', 'lib', 'python2.7', dir_name)) - # info('Copying python-install to dist-dependent location') - # shprint(sh.cp, '-a', 'python-install', self.ctx.get_python_install_dir()) - - # print('Copying hostpython binary to targetpython folder') - # shprint(sh.cp, self.ctx.hostpython, - # join(self.ctx.get_python_install_dir(), 'bin', 'python.host')) - # self.ctx.hostpython = join(self.ctx.get_python_install_dir(), 'bin', 'python.host') - - - - # print('python2 build done, exiting for debug') - # exit(1) - - recipe = Python2Recipe() diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.11-ctypes-disable-wchar.patch b/pythonforandroid/recipes/python2/patches/Python-2.7.11-ctypes-disable-wchar.patch new file mode 100644 index 0000000000..9f8c4405e8 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/Python-2.7.11-ctypes-disable-wchar.patch @@ -0,0 +1,76 @@ +--- Python-2.7.9/Lib/ctypes/__init__.py.orig 2014-12-10 16:59:33.000000000 +0100 ++++ Python-2.7.9/Lib/ctypes/__init__.py 2016-03-17 14:00:15.636079979 +0100 +@@ -268,7 +268,7 @@ + if _os.name in ("nt", "ce"): + _win_functype_cache.clear() + # _SimpleCData.c_wchar_p_from_param +- POINTER(c_wchar).from_param = c_wchar_p.from_param ++ # POINTER(c_wchar).from_param = c_wchar_p.from_param + # _SimpleCData.c_char_p_from_param + POINTER(c_char).from_param = c_char_p.from_param + _pointer_type_cache[None] = c_void_p +@@ -288,29 +288,34 @@ + else: + set_conversion_mode("ascii", "strict") + +- class c_wchar_p(_SimpleCData): +- _type_ = "Z" +- +- class c_wchar(_SimpleCData): +- _type_ = "u" +- +- def create_unicode_buffer(init, size=None): +- """create_unicode_buffer(aString) -> character array +- create_unicode_buffer(anInteger) -> character array +- create_unicode_buffer(aString, anInteger) -> character array +- """ +- if isinstance(init, (str, unicode)): +- if size is None: +- size = len(init)+1 +- buftype = c_wchar * size +- buf = buftype() +- buf.value = init +- return buf +- elif isinstance(init, (int, long)): +- buftype = c_wchar * init +- buf = buftype() +- return buf +- raise TypeError(init) ++# The wchar stuff causes a crash on Android (the bionic C library doesn't ++# implement wchar_t anyway) ++# ++# class c_wchar_p(_SimpleCData): ++# _type_ = "Z" ++# ++# class c_wchar(_SimpleCData): ++# _type_ = "u" ++# ++# POINTER(c_wchar).from_param = c_wchar_p.from_param #_SimpleCData.c_wchar_p_from_param ++# ++# def create_unicode_buffer(init, size=None): ++# """create_unicode_buffer(aString) -> character array ++# create_unicode_buffer(anInteger) -> character array ++# create_unicode_buffer(aString, anInteger) -> character array ++# """ ++# if isinstance(init, (str, unicode)): ++# if size is None: ++# size = len(init)+1 ++# buftype = c_wchar * size ++# buf = buftype() ++# buf.value = init ++# return buf ++# elif isinstance(init, (int, long)): ++# buftype = c_wchar * init ++# buf = buftype() ++# return buf ++# raise TypeError(init) + + # XXX Deprecated + def SetPointerType(pointer, cls): +@@ -552,4 +557,4 @@ + elif sizeof(kind) == 8: c_uint64 = kind + del(kind) + +-_reset_cache() ++_reset_cache() +\ No hay ningún carácter de nueva línea al final del fichero diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.11-xcompile.patch b/pythonforandroid/recipes/python2/patches/Python-2.7.11-xcompile.patch new file mode 100644 index 0000000000..09b4907e7a --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/Python-2.7.11-xcompile.patch @@ -0,0 +1,318 @@ +diff -Naurp Python-2.7.11.orig/configure Python-2.7.11/configure +--- Python-2.7.11.orig/configure 2015-12-05 20:47:20.000000000 +0100 ++++ Python-2.7.11/configure 2016-03-19 14:47:16.507945494 +0100 +@@ -2886,24 +2886,11 @@ case $host_os in *\ *) host_os=`echo "$h + # pybuilddir.txt will be created by --generate-posix-vars in the Makefile + rm -f pybuilddir.txt + ++# Use latest cross-compiling patches + if test "$cross_compiling" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 + $as_echo_n "checking for python interpreter for cross build... " >&6; } +- if test -z "$PYTHON_FOR_BUILD"; then +- for interp in python$PACKAGE_VERSION python2 python; do +- which $interp >/dev/null 2>&1 || continue +- if $interp -c 'import sys;sys.exit(not (sys.version_info[:2] >= (2,7) and sys.version_info[0] < 3))'; then +- break +- fi +- interp= +- done +- if test x$interp = x; then +- as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5 +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 +-$as_echo "$interp" >&6; } +- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp +- fi ++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) $(srcdir)/host$(BUILDPYTHON)' + elif test "$cross_compiling" = maybe; then + as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5 + else +diff -Naurp Python-2.7.11.orig/Makefile.pre.in Python-2.7.11/Makefile.pre.in +--- Python-2.7.11.orig/Makefile.pre.in 2015-12-05 20:47:10.000000000 +0100 ++++ Python-2.7.11/Makefile.pre.in 2016-03-19 14:41:49.118418312 +0100 +@@ -238,6 +238,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++PGEN_FOR_BUILD=Parser/hostpgen + + PSRCS= \ + Parser/acceler.c \ +@@ -636,7 +637,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p + $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) + @$(MKDIR_P) Include + $(MAKE) $(PGEN) +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) + $(MAKE) $(GRAMMAR_H) + touch $(GRAMMAR_C) +@@ -1072,12 +1073,12 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +@@ -1205,11 +1206,13 @@ libainstall: all python-config + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods ++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ ++ --skip-build \ + --prefix=$(prefix) \ +- --install-scripts=$(BINDIR) \ +- --install-platlib=$(DESTSHARED) \ +- --root=$(DESTDIR)/ ++ --install-scripts=$(DESTDIR)$(BINDIR) \ ++ --install-platlib=$(DESTDIR)$(DESTSHARED) \ ++ --root=/ + -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py* + + # Here are a couple of targets for MacOSX again, to install a full +diff -Naurp Python-2.7.11.orig/Modules/Setup.dist Python-2.7.11/Modules/Setup.dist +--- Python-2.7.11.orig/Modules/Setup.dist 2015-12-05 20:47:11.000000000 +0100 ++++ Python-2.7.11/Modules/Setup.dist 2016-03-19 14:44:01.231217400 +0100 +@@ -163,7 +163,7 @@ GLHACK=-Dclear=__GLclear + # it, depending on your system -- see the GNU readline instructions. + # It's okay for this to be a shared library, too. + +-#readline readline.c -lreadline -ltermcap ++readline readline.c -lreadline -ltermcap + + + # Modules that should always be present (non UNIX dependent): +@@ -215,10 +215,10 @@ GLHACK=-Dclear=__GLclear + + # Socket module helper for SSL support; you must comment out the other + # socket line above, and possibly edit the SSL variable: +-#SSL=/usr/local/ssl +-#_ssl _ssl.c \ +-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ +-# -L$(SSL)/lib -lssl -lcrypto ++SSL=/path-to-ssl-build-dir ++_ssl _ssl.c \ ++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ ++ -L$(SSL) -lssl -lcrypto + + # The crypt module is now disabled by default because it breaks builds + # on many systems (where -lcrypt is needed), e.g. Linux (I believe). +@@ -464,7 +464,7 @@ GLHACK=-Dclear=__GLclear + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). + # See http://www.gzip.org/zlib/ +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz ++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz + + # Interface to the Expat XML parser + # +diff -Naurp Python-2.7.11.orig/setup.py Python-2.7.11/setup.py +--- Python-2.7.11.orig/setup.py 2015-12-05 20:47:20.000000000 +0100 ++++ Python-2.7.11/setup.py 2016-03-19 14:16:57.558920459 +0100 +@@ -17,7 +17,7 @@ from distutils.command.install import in + from distutils.command.install_lib import install_lib + from distutils.spawn import find_executable + +-cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ ++cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('PYTHONXCPREFIX' in os.environ) + + def get_platform(): + # cross build +@@ -294,6 +294,14 @@ class PyBuildExt(build_ext): + (ext.name, sys.exc_info()[1])) + self.failed.append(ext.name) + return ++ ++ # Import check will not work when cross-compiling. ++ if os.environ.has_key('PYTHONXCPREFIX'): ++ self.announce( ++ 'WARNING: skipping import 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: +@@ -326,6 +334,9 @@ class PyBuildExt(build_ext): + + # Don't try to load extensions for cross builds + if cross_compiling: ++ self.announce( ++ 'WARNING: skipping import check for cross-compiled: "%s"' % ++ ext.name) + return + + try: +@@ -480,7 +491,7 @@ class PyBuildExt(build_ext): + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.prefix) != '/usr' \ ++ if os.path.normpath(sys.prefix) != '/usr' and not cross_compiling \ + and not sysconfig.get_config_var('PYTHONFRAMEWORK'): + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when +@@ -511,6 +522,14 @@ class PyBuildExt(build_ext): + '/lib', '/usr/lib', + ): + add_dir_to_list(lib_dirs, d) ++ else: ++ # The common install prefix of 3rd party libraries used during cross compilation ++ cflags = os.environ.get('CFLAGS') ++ if cflags: ++ inc_dirs += [x[2:] for x in cflags.split() if x.startswith('-I')] ++ ldflags = os.environ.get('LDFLAGS') ++ if ldflags: ++ lib_dirs += [x[2:] for x in ldflags.split() if x.startswith('-L')] + exts = [] + missing = [] + +@@ -556,6 +575,11 @@ class PyBuildExt(build_ext): + if host_platform in ['darwin', 'beos']: + math_libs = [] + ++ # Insert libraries and headers from embedded root file system (RFS) ++ if 'RFS' in os.environ: ++ lib_dirs += [os.environ['RFS'] + '/usr/lib'] ++ inc_dirs += [os.environ['RFS'] + '/usr/include'] ++ + # XXX Omitted modules: gl, pure, dl, SGI-specific modules + + # +@@ -708,7 +732,8 @@ class PyBuildExt(build_ext): + curses_library = "" + # Determine if readline is already linked against curses or tinfo. + if do_readline and find_executable('ldd'): +- fp = os.popen("ldd %s" % do_readline) ++ # fp = os.popen("ldd %s" % do_readline) ++ fp = os.popen("arm-linux-androideabi-objdump -x %s | grep NEEDED" % do_readline) + ldd_output = fp.readlines() + ret = fp.close() + if ret is None or ret >> 8 == 0: +@@ -731,6 +756,10 @@ class PyBuildExt(build_ext): + curses_library = 'ncurses' + elif self.compiler.find_library_file(lib_dirs, 'curses'): + curses_library = 'curses' ++ print 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ++ print curses_library ++ print readline_termcap_library ++ print do_readline + + if host_platform == 'darwin': + os_release = int(os.uname()[2].split('.')[0]) +@@ -754,7 +783,7 @@ class PyBuildExt(build_ext): + # before the (possibly broken) dynamic library in /usr/lib. + readline_extra_link_args = ('-Wl,-search_paths_first',) + else: +- readline_extra_link_args = () ++ readline_extra_link_args = ('-lncurses',) + + readline_libs = ['readline'] + if readline_termcap_library: +@@ -804,7 +833,8 @@ class PyBuildExt(build_ext): + ['/usr/local/ssl/lib', + '/usr/contrib/ssl/lib/' + ] ) +- ++ ssl_incs = ['/path-to-ssl-build-dir/include', '/path-to-ssl-build-dir/include/openssl'] ++ ssl_libs = ['/path-to-ssl-build-dir'] + if (ssl_incs is not None and + ssl_libs is not None): + exts.append( Extension('_ssl', ['_ssl.c'], +@@ -839,8 +869,8 @@ class PyBuildExt(build_ext): + + min_openssl_ver = 0x00907000 + have_any_openssl = ssl_incs is not None and ssl_libs is not None +- have_usable_openssl = (have_any_openssl and +- openssl_ver >= min_openssl_ver) ++ have_usable_openssl = (have_any_openssl and True) ++ # openssl_ver >= min_openssl_ver) + + if have_any_openssl: + if have_usable_openssl: +@@ -1097,15 +1127,22 @@ class PyBuildExt(build_ext): + # We hunt for #define SQLITE_VERSION "n.n.n" + # We need to find >= sqlite version 3.0.8 + sqlite_incdir = sqlite_libdir = None +- sqlite_inc_paths = [ '/usr/include', +- '/usr/include/sqlite', +- '/usr/include/sqlite3', +- '/usr/local/include', +- '/usr/local/include/sqlite', +- '/usr/local/include/sqlite3', +- ] +- if cross_compiling: +- sqlite_inc_paths = [] ++ if not cross_compiling: ++ sqlite_inc_paths = [ '/usr/include', ++ '/usr/include/sqlite', ++ '/usr/include/sqlite3', ++ '/usr/local/include', ++ '/usr/local/include/sqlite', ++ '/usr/local/include/sqlite3', ++ ] ++ else: ++ # The common install prefix of 3rd party headers used during ++ # cross compilation ++ mydir = os.environ.get('PYTHON_XCOMPILE_DEPENDENCIES_PREFIX') ++ if mydir: ++ sqlite_inc_paths = [mydir + '/include' ] ++ else: ++ sqlite_inc_paths = [] + MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) + MIN_SQLITE_VERSION = ".".join([str(x) + for x in MIN_SQLITE_VERSION_NUMBER]) +@@ -1151,11 +1188,28 @@ class PyBuildExt(build_ext): + os.path.join(sqlite_incdir, '..', '..', 'lib64'), + os.path.join(sqlite_incdir, '..', '..', 'lib'), + ] ++ if not cross_compiling: ++ sqlite_dirs_to_check = [ ++ os.path.join(sqlite_incdir, '..', 'lib64'), ++ os.path.join(sqlite_incdir, '..', 'lib'), ++ os.path.join(sqlite_incdir, '..', '..', 'lib64'), ++ os.path.join(sqlite_incdir, '..', '..', 'lib'), ++ ] ++ else: ++ # The common install prefix of 3rd party headers used during ++ # cross compilation ++ mydir = os.environ.get('PYTHON_XCOMPILE_DEPENDENCIES_PREFIX') ++ if mydir: ++ sqlite_dirs_to_check = [mydir + '/lib' ] ++ else: ++ sqlite_dirs_to_check = [] ++ + sqlite_libfile = self.compiler.find_library_file( + sqlite_dirs_to_check + lib_dirs, 'sqlite3') + if sqlite_libfile: + sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))] +- ++ sqlite_incdir = '/path-to-sqlite3-include-dir' ++ sqlite_libdir = ['/path-to-sqlite3-lib-dir'] + if sqlite_incdir and sqlite_libdir: + sqlite_srcs = ['_sqlite/cache.c', + '_sqlite/connection.c', +@@ -2030,6 +2084,13 @@ class PyBuildExt(build_ext): + # CFLAGS to Python's; -g or -O2 is to be avoided. + cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ + % (ffi_builddir, ffi_srcdir, " ".join(config_args)) ++ if cross_compiling: ++ cmd = "cd %s && env CFLAGS='' '%s/configure' --host=%s --build=%s %s" \ ++ % (ffi_builddir, ffi_srcdir, os.environ.get('HOSTARCH'), ++ os.environ.get('BUILDARCH'), " ".join(config_args)) ++ else: ++ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ ++ % (ffi_builddir, ffi_srcdir, " ".join(config_args)) + + res = os.system(cmd) + if res or not os.path.exists(ffi_configfile): diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.2-ctypes-disable-wchar.patch b/pythonforandroid/recipes/python2/patches/Python-2.7.2-ctypes-disable-wchar.patch deleted file mode 100644 index 19d8915eaa..0000000000 --- a/pythonforandroid/recipes/python2/patches/Python-2.7.2-ctypes-disable-wchar.patch +++ /dev/null @@ -1,116 +0,0 @@ -diff -ur '--exclude=*~' Python-2.7.2.orig/Lib/ctypes/__init__.py Python-2.7.2/Lib/ctypes/__init__.py ---- Python-2.7.2.orig/Lib/ctypes/__init__.py 2011-06-11 16:46:24.000000000 +0100 -+++ Python-2.7.2/Lib/ctypes/__init__.py 2015-03-19 12:32:45.747723687 +0000 -@@ -272,31 +272,34 @@ - else: - set_conversion_mode("ascii", "strict") - -- class c_wchar_p(_SimpleCData): -- _type_ = "Z" -- -- class c_wchar(_SimpleCData): -- _type_ = "u" -- -- POINTER(c_wchar).from_param = c_wchar_p.from_param #_SimpleCData.c_wchar_p_from_param -- -- def create_unicode_buffer(init, size=None): -- """create_unicode_buffer(aString) -> character array -- create_unicode_buffer(anInteger) -> character array -- create_unicode_buffer(aString, anInteger) -> character array -- """ -- if isinstance(init, (str, unicode)): -- if size is None: -- size = len(init)+1 -- buftype = c_wchar * size -- buf = buftype() -- buf.value = init -- return buf -- elif isinstance(init, (int, long)): -- buftype = c_wchar * init -- buf = buftype() -- return buf -- raise TypeError(init) -+# The wchar stuff causes a crash on Android (the bionic C library doesn't -+# implement wchar_t anyway) -+# -+# class c_wchar_p(_SimpleCData): -+# _type_ = "Z" -+# -+# class c_wchar(_SimpleCData): -+# _type_ = "u" -+# -+# POINTER(c_wchar).from_param = c_wchar_p.from_param #_SimpleCData.c_wchar_p_from_param -+# -+# def create_unicode_buffer(init, size=None): -+# """create_unicode_buffer(aString) -> character array -+# create_unicode_buffer(anInteger) -> character array -+# create_unicode_buffer(aString, anInteger) -> character array -+# """ -+# if isinstance(init, (str, unicode)): -+# if size is None: -+# size = len(init)+1 -+# buftype = c_wchar * size -+# buf = buftype() -+# buf.value = init -+# return buf -+# elif isinstance(init, (int, long)): -+# buftype = c_wchar * init -+# buf = buftype() -+# return buf -+# raise TypeError(init) - - POINTER(c_char).from_param = c_char_p.from_param #_SimpleCData.c_char_p_from_param - -diff -ur '--exclude=*~' Python-2.7.2.orig/Modules/_ctypes/callproc.c Python-2.7.2/Modules/_ctypes/callproc.c ---- Python-2.7.2.orig/Modules/_ctypes/callproc.c 2015-03-19 11:56:40.668159317 +0000 -+++ Python-2.7.2/Modules/_ctypes/callproc.c 2015-03-19 11:45:45.898288000 +0000 -@@ -1423,7 +1423,7 @@ - mode |= RTLD_NOW; - handle = ctypes_dlopen(name, mode); - if (!handle) { -- char *errmsg = ctypes_dlerror(); -+ const char *errmsg = ctypes_dlerror(); - if (!errmsg) - errmsg = "dlopen() error"; - PyErr_SetString(PyExc_OSError, -diff -ur '--exclude=*~' Python-2.7.2.orig/Modules/_ctypes/libffi/src/dlmalloc.c Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c ---- Python-2.7.2.orig/Modules/_ctypes/libffi/src/dlmalloc.c 2015-03-19 13:26:58.928438829 +0000 -+++ Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c 2015-03-19 15:32:19.042396376 +0000 -@@ -614,18 +614,6 @@ - #include "/usr/include/malloc.h" - #else /* HAVE_USR_INCLUDE_MALLOC_H */ - --struct mallinfo { -- MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ -- MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ -- MALLINFO_FIELD_TYPE smblks; /* always 0 */ -- MALLINFO_FIELD_TYPE hblks; /* always 0 */ -- MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ -- MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ -- MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ -- MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ -- MALLINFO_FIELD_TYPE fordblks; /* total free space */ -- MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ --}; - - #endif /* HAVE_USR_INCLUDE_MALLOC_H */ - #endif /* NO_MALLINFO */ -@@ -966,7 +954,7 @@ - p = malloc(n); - assert(malloc_usable_size(p) >= 256); - */ --size_t dlmalloc_usable_size(void*); -+size_t dlmalloc_usable_size(const void*); - - /* - malloc_stats(); -@@ -4384,7 +4372,7 @@ - internal_malloc_stats(gm); - } - --size_t dlmalloc_usable_size(void* mem) { -+size_t dlmalloc_usable_size(const void* mem) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - if (cinuse(p)) - diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch b/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch deleted file mode 100644 index 9883cb5442..0000000000 --- a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch +++ /dev/null @@ -1,205 +0,0 @@ -diff -urN Python-2.7.2/configure ltib/rpm/BUILD/Python-2.7.2/configure ---- Python-2.7.2/configure 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/configure 2011-11-14 12:10:41.011373524 -0500 -@@ -13673,7 +13673,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. */ -@@ -13725,7 +13725,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 -diff -urN Python-2.7.2/Makefile.pre.in ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in ---- Python-2.7.2/Makefile.pre.in 2011-06-11 11:46:26.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in 2011-11-14 12:10:41.013373444 -0500 -@@ -182,6 +182,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 -@@ -215,6 +216,8 @@ - # Parser - PGEN= Parser/pgen$(EXE) - -+HOSTPGEN= $(PGEN) -+ - POBJS= \ - Parser/acceler.o \ - Parser/grammar1.o \ -@@ -407,8 +410,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 -@@ -542,7 +545,7 @@ - $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp - Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include -- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - -touch Parser/pgen.stamp - - $(PGEN): $(PGENOBJS) -@@ -925,26 +928,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): -@@ -1049,7 +1052,9 @@ - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ -+ --skip-build \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -diff -urN Python-2.7.2/setup.py ltib/rpm/BUILD/Python-2.7.2/setup.py ---- Python-2.7.2/setup.py 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/setup.py 2011-11-14 12:13:02.175758583 -0500 -@@ -145,6 +145,7 @@ - def __init__(self, dist): - build_ext.__init__(self, dist) - self.failed = [] -+ self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes' - - def build_extensions(self): - -@@ -278,6 +279,14 @@ - (ext.name, sys.exc_info()[1])) - self.failed.append(ext.name) - return -+ -+ # Import check will not work when cross-compiling. -+ if os.environ.has_key('PYTHONXCPREFIX'): -+ self.announce( -+ 'WARNING: skipping import 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: -@@ -369,9 +378,10 @@ - - def detect_modules(self): - # Ensure that /usr/local is always used -- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -- self.add_multiarch_paths() -+ if not self.cross_compile: -+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -+ self.add_multiarch_paths() - - # Add paths specified in the environment variables LDFLAGS and - # CPPFLAGS for header and library files. -@@ -408,7 +418,8 @@ - add_dir_to_list(dir_list, directory) - - if os.path.normpath(sys.prefix) != '/usr' \ -- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): -+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ -+ and not self.cross_compile: - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework - # (PYTHONFRAMEWORK is set) to avoid # linking problems when - # building a framework with different architectures than -@@ -426,11 +437,14 @@ - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can - # be assumed that no additional -I,-L directives are needed. -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] -+ lib_dirs = self.compiler.library_dirs -+ inc_dirs = self.compiler.include_dirs -+ if not self.cross_compile: -+ lib_dirs += [ -+ '/lib64', '/usr/lib64', -+ '/lib', '/usr/lib', -+ ] -+ inc_dirs += ['/usr/include'] - exts = [] - missing = [] - -@@ -1864,8 +1878,15 @@ - - # Pass empty CFLAGS because we'll just append the resulting - # CFLAGS to Python's; -g or -O2 is to be avoided. -- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) -+ if self.cross_compile: -+ cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \ -+ % (ffi_builddir, ffi_srcdir, -+ os.environ.get('HOSTARCH'), -+ os.environ.get('BUILDARCH'), -+ " ".join(config_args)) -+ else: -+ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -+ % (ffi_builddir, ffi_srcdir, " ".join(config_args)) - - res = os.system(cmd) - if res or not os.path.exists(ffi_configfile): ---- Python-2.6.6.orig//Lib/plat-linux3/regen 1970-01-01 01:00:00.000000000 +0100 -+++ Python-2.6.6/Lib/plat-linux3/regen 2001-08-09 14:48:17.000000000 +0200 -@@ -0,0 +1,8 @@ -+#! /bin/sh -+case `uname` in -+Linux*) ;; -+*) echo Probably not on a Linux system 1>&2 -+ exit 1;; -+esac -+set -v -+h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-backup b/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-backup deleted file mode 100644 index 3fdb85d2da..0000000000 --- a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-backup +++ /dev/null @@ -1,194 +0,0 @@ -diff -urN Python-2.7.2/configure ltib/rpm/BUILD/Python-2.7.2/configure ---- Python-2.7.2/configure 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/configure 2011-11-14 12:10:41.011373524 -0500 -@@ -13673,7 +13673,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. */ -@@ -13725,7 +13725,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 -diff -urN Python-2.7.2/Makefile.pre.in ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in ---- Python-2.7.2/Makefile.pre.in 2011-06-11 11:46:26.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in 2011-11-14 12:10:41.013373444 -0500 -@@ -182,6 +182,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 -@@ -215,6 +216,8 @@ - # Parser - PGEN= Parser/pgen$(EXE) - -+HOSTPGEN= $(PGEN) -+ - POBJS= \ - Parser/acceler.o \ - Parser/grammar1.o \ -@@ -407,8 +410,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 -@@ -542,7 +545,7 @@ - $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp - Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include -- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - -touch Parser/pgen.stamp - - $(PGEN): $(PGENOBJS) -@@ -925,26 +928,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): -@@ -1049,7 +1052,9 @@ - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ -+ --skip-build \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -diff -urN Python-2.7.2/setup.py ltib/rpm/BUILD/Python-2.7.2/setup.py ---- Python-2.7.2/setup.py 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/setup.py 2011-11-14 12:13:02.175758583 -0500 -@@ -145,6 +145,7 @@ - def __init__(self, dist): - build_ext.__init__(self, dist) - self.failed = [] -+ self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes' - - def build_extensions(self): - -@@ -278,6 +279,14 @@ - (ext.name, sys.exc_info()[1])) - self.failed.append(ext.name) - return -+ -+ # Import check will not work when cross-compiling. -+ if os.environ.has_key('PYTHONXCPREFIX'): -+ self.announce( -+ 'WARNING: skipping import 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: -@@ -369,9 +378,10 @@ - - def detect_modules(self): - # Ensure that /usr/local is always used -- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -- self.add_multiarch_paths() -+ if not self.cross_compile: -+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -+ self.add_multiarch_paths() - - # Add paths specified in the environment variables LDFLAGS and - # CPPFLAGS for header and library files. -@@ -408,7 +418,8 @@ - add_dir_to_list(dir_list, directory) - - if os.path.normpath(sys.prefix) != '/usr' \ -- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): -+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ -+ and not self.cross_compile: - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework - # (PYTHONFRAMEWORK is set) to avoid # linking problems when - # building a framework with different architectures than -@@ -426,11 +437,14 @@ - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can - # be assumed that no additional -I,-L directives are needed. -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] -+ lib_dirs = self.compiler.library_dirs -+ inc_dirs = self.compiler.include_dirs -+ if not self.cross_compile: -+ lib_dirs += [ -+ '/lib64', '/usr/lib64', -+ '/lib', '/usr/lib', -+ ] -+ inc_dirs += ['/usr/include'] - exts = [] - missing = [] - -@@ -1864,8 +1878,15 @@ - - # Pass empty CFLAGS because we'll just append the resulting - # CFLAGS to Python's; -g or -O2 is to be avoided. -- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) -+ if self.cross_compile: -+ cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \ -+ % (ffi_builddir, ffi_srcdir, -+ os.environ.get('HOSTARCH'), -+ os.environ.get('BUILDARCH'), -+ " ".join(config_args)) -+ else: -+ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -+ % (ffi_builddir, ffi_srcdir, " ".join(config_args)) - - res = os.system(cmd) - if res or not os.path.exists(ffi_configfile): diff --git a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-new b/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-new deleted file mode 100644 index 9883cb5442..0000000000 --- a/pythonforandroid/recipes/python2/patches/Python-2.7.2-xcompile.patch-new +++ /dev/null @@ -1,205 +0,0 @@ -diff -urN Python-2.7.2/configure ltib/rpm/BUILD/Python-2.7.2/configure ---- Python-2.7.2/configure 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/configure 2011-11-14 12:10:41.011373524 -0500 -@@ -13673,7 +13673,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. */ -@@ -13725,7 +13725,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 -diff -urN Python-2.7.2/Makefile.pre.in ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in ---- Python-2.7.2/Makefile.pre.in 2011-06-11 11:46:26.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/Makefile.pre.in 2011-11-14 12:10:41.013373444 -0500 -@@ -182,6 +182,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 -@@ -215,6 +216,8 @@ - # Parser - PGEN= Parser/pgen$(EXE) - -+HOSTPGEN= $(PGEN) -+ - POBJS= \ - Parser/acceler.o \ - Parser/grammar1.o \ -@@ -407,8 +410,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 -@@ -542,7 +545,7 @@ - $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp - Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include -- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - -touch Parser/pgen.stamp - - $(PGEN): $(PGENOBJS) -@@ -925,26 +928,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): -@@ -1049,7 +1052,9 @@ - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ -+ --skip-build \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -diff -urN Python-2.7.2/setup.py ltib/rpm/BUILD/Python-2.7.2/setup.py ---- Python-2.7.2/setup.py 2011-06-11 11:46:28.000000000 -0400 -+++ ltib/rpm/BUILD/Python-2.7.2/setup.py 2011-11-14 12:13:02.175758583 -0500 -@@ -145,6 +145,7 @@ - def __init__(self, dist): - build_ext.__init__(self, dist) - self.failed = [] -+ self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes' - - def build_extensions(self): - -@@ -278,6 +279,14 @@ - (ext.name, sys.exc_info()[1])) - self.failed.append(ext.name) - return -+ -+ # Import check will not work when cross-compiling. -+ if os.environ.has_key('PYTHONXCPREFIX'): -+ self.announce( -+ 'WARNING: skipping import 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: -@@ -369,9 +378,10 @@ - - def detect_modules(self): - # Ensure that /usr/local is always used -- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -- self.add_multiarch_paths() -+ if not self.cross_compile: -+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -+ self.add_multiarch_paths() - - # Add paths specified in the environment variables LDFLAGS and - # CPPFLAGS for header and library files. -@@ -408,7 +418,8 @@ - add_dir_to_list(dir_list, directory) - - if os.path.normpath(sys.prefix) != '/usr' \ -- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): -+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ -+ and not self.cross_compile: - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework - # (PYTHONFRAMEWORK is set) to avoid # linking problems when - # building a framework with different architectures than -@@ -426,11 +437,14 @@ - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can - # be assumed that no additional -I,-L directives are needed. -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] -+ lib_dirs = self.compiler.library_dirs -+ inc_dirs = self.compiler.include_dirs -+ if not self.cross_compile: -+ lib_dirs += [ -+ '/lib64', '/usr/lib64', -+ '/lib', '/usr/lib', -+ ] -+ inc_dirs += ['/usr/include'] - exts = [] - missing = [] - -@@ -1864,8 +1878,15 @@ - - # Pass empty CFLAGS because we'll just append the resulting - # CFLAGS to Python's; -g or -O2 is to be avoided. -- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) -+ if self.cross_compile: -+ cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \ -+ % (ffi_builddir, ffi_srcdir, -+ os.environ.get('HOSTARCH'), -+ os.environ.get('BUILDARCH'), -+ " ".join(config_args)) -+ else: -+ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ -+ % (ffi_builddir, ffi_srcdir, " ".join(config_args)) - - res = os.system(cmd) - if res or not os.path.exists(ffi_configfile): ---- Python-2.6.6.orig//Lib/plat-linux3/regen 1970-01-01 01:00:00.000000000 +0100 -+++ Python-2.6.6/Lib/plat-linux3/regen 2001-08-09 14:48:17.000000000 +0200 -@@ -0,0 +1,8 @@ -+#! /bin/sh -+case `uname` in -+Linux*) ;; -+*) echo Probably not on a Linux system 1>&2 -+ exit 1;; -+esac -+set -v -+h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h diff --git a/pythonforandroid/recipes/python2/patches/Python_2.7.11-ctypes-libffi-fix-configure.patch b/pythonforandroid/recipes/python2/patches/Python_2.7.11-ctypes-libffi-fix-configure.patch new file mode 100644 index 0000000000..dff0a97b04 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/Python_2.7.11-ctypes-libffi-fix-configure.patch @@ -0,0 +1,33 @@ +diff -pruN Python-2.7.9.orig//Modules/_ctypes/libffi/configure.ac Python-2.7.9/Modules/_ctypes/libffi/configure.ac +--- Python-2.7.9.orig//Modules/_ctypes/libffi/configure.ac 2009-04-28 22:01:18.000000000 +0200 ++++ Python-2.7.9/Modules/_ctypes/libffi/configure.ac 2010-04-20 22:46:02.000000000 +0200 +@@ -409,7 +409,7 @@ + + AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) + +-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) ++AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile ) + + AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h) + +diff -pruN Python-2.7.9.orig//Modules/_ctypes/libffi/Makefile.am Python-2.7.9/Modules/_ctypes/libffi/Makefile.am +--- Python-2.7.9.orig//Modules/_ctypes/libffi/Makefile.am 2008-03-04 21:09:11.000000000 +0100 ++++ Python-2.7.9/Modules/_ctypes/libffi/Makefile.am 2010-04-20 22:54:03.000000000 +0200 +@@ -2,7 +2,7 @@ + + AUTOMAKE_OPTIONS = foreign subdir-objects + +-SUBDIRS = include testsuite man ++SUBDIRS = include + + EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ + src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ +@@ -34,8 +34,6 @@ + libtool-version ChangeLog.libffi m4/libtool.m4 \ + m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 + +-info_TEXINFOS = doc/libffi.texi +- + ## ################################################################ + + ## diff --git a/pythonforandroid/recipes/python2/patches/ctypes-find-library.patch b/pythonforandroid/recipes/python2/patches/ctypes-find-library.patch index 68fa93f526..33d9e6f5e3 100644 --- a/pythonforandroid/recipes/python2/patches/ctypes-find-library.patch +++ b/pythonforandroid/recipes/python2/patches/ctypes-find-library.patch @@ -1,28 +1,29 @@ -diff -ur Python-2.7.2.orig/Lib/ctypes/util.py Python-2.7.2/Lib/ctypes/util.py ---- Python-2.7.2.orig/Lib/ctypes/util.py 2011-06-11 16:46:24.000000000 +0100 -+++ Python-2.7.2/Lib/ctypes/util.py 2015-05-10 15:50:18.906203529 +0100 -@@ -71,7 +71,21 @@ +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 52b3520..01b13a9 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -71,7 +71,23 @@ if os.name == "ce": def find_library(name): return name - + -if os.name == "posix" and sys.platform == "darwin": -+# this test is for android specifically shoudl match here and ignore any -+# of the other platform tests below -+if os.name == "posix": ++# This patch overrides the find_library to look in the right places on ++# Android ++if True: + def find_library(name): -+ """ hack to find librarys for kivy and android -+ split the path and get the first parts which will give us -+ the app path something like /data/data/org.app.foo/""" ++ # Check the user app lib dir + app_root = os.path.abspath('./').split(os.path.sep)[0:4] + lib_search = os.path.sep.join(app_root) + os.path.sep + 'lib' + for filename in os.listdir(lib_search): + if filename.endswith('.so') and name in filename: + return lib_search + os.path.sep + filename ++ # Check the normal Android system libraries ++ for filename in os.listdir('/system/lib'): ++ if filename.endswith('.so') and name in filename: ++ return lib_search + os.path.sep + filename + return None + +elif os.name == "posix" and sys.platform == "darwin": from ctypes.macholib.dyld import dyld_find as _dyld_find def find_library(name): possible = ['lib%s.dylib' % name, -Only in Python-2.7.2/Lib/ctypes: util.py.save -Only in Python-2.7.2/Lib/ctypes: util.py.save.1 diff --git a/pythonforandroid/recipes/python2/patches/custom-loader.patch b/pythonforandroid/recipes/python2/patches/custom-loader.patch index fafede7adc..79f31364ec 100644 --- a/pythonforandroid/recipes/python2/patches/custom-loader.patch +++ b/pythonforandroid/recipes/python2/patches/custom-loader.patch @@ -1,5 +1,5 @@ ---- Python-2.7.2.orig/Python/dynload_shlib.c 2010-05-09 16:46:46.000000000 +0200 -+++ Python-2.7.2/Python/dynload_shlib.c 2011-04-20 17:52:12.000000000 +0200 +--- Python-2.7.9.orig/Python/dynload_shlib.c 2010-05-09 16:46:46.000000000 +0200 ++++ Python-2.7.9/Python/dynload_shlib.c 2011-04-20 17:52:12.000000000 +0200 @@ -6,6 +6,7 @@ #include @@ -12,11 +12,11 @@ char pathbuf[260]; int dlopenflags=0; -+ static void *libpymodules = -1; ++ static void *libpymodules = NULL; + void *rv = NULL; + + /* Ensure we have access to libpymodules. */ -+ if (libpymodules == -1) { ++ if (libpymodules == NULL) { + printf("ANDROID_PRIVATE = %s\n", getenv("ANDROID_PRIVATE")); + PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_PRIVATE")); + libpymodules = dlopen(pathbuf, RTLD_NOW); diff --git a/pythonforandroid/recipes/python2/patches/disable-modules.patch b/pythonforandroid/recipes/python2/patches/disable-modules.patch index 3841488c40..ff2a1e9140 100644 --- a/pythonforandroid/recipes/python2/patches/disable-modules.patch +++ b/pythonforandroid/recipes/python2/patches/disable-modules.patch @@ -1,7 +1,7 @@ ---- Python-2.7.2.orig/setup.py 2010-10-31 17:40:21.000000000 +0100 -+++ Python-2.7.2/setup.py 2011-11-27 16:49:36.840204364 +0100 -@@ -21,7 +21,7 @@ - COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') +--- Python-2.7.9/setup.py.orig 2016-03-17 11:14:51.826097000 +0100 ++++ Python-2.7.9/setup.py 2016-03-17 12:31:18.192036284 +0100 +@@ -33,7 +33,7 @@ + COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) # This global variable is used to hold the list of modules to be disabled. -disabled_module_list = [] diff --git a/pythonforandroid/recipes/python2/patches/disable-openpty.patch b/pythonforandroid/recipes/python2/patches/disable-openpty.patch index e6f9717309..54c09e305d 100644 --- a/pythonforandroid/recipes/python2/patches/disable-openpty.patch +++ b/pythonforandroid/recipes/python2/patches/disable-openpty.patch @@ -1,6 +1,6 @@ ---- python2/Modules/posixmodule.c 2016-01-05 15:54:39.504651722 -0600 -+++ b/Modules/posixmodule.c 2016-01-05 16:01:48.072559330 -0600 -@@ -3743,54 +3743,8 @@ +--- Python-2.7.9/Modules/posixmodule.c.orig 2016-03-17 11:14:51.668097000 +0100 ++++ Python-2.7.9/Modules/posixmodule.c 2016-03-17 12:04:09.598668939 +0100 +@@ -3883,54 +3883,8 @@ static PyObject * posix_openpty(PyObject *self, PyObject *noargs) { diff --git a/pythonforandroid/recipes/python2/patches/ffi-config.sub-2.7.11.patch b/pythonforandroid/recipes/python2/patches/ffi-config.sub-2.7.11.patch new file mode 100644 index 0000000000..db0ebbb1eb --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/ffi-config.sub-2.7.11.patch @@ -0,0 +1,1792 @@ +--- Python-2.7.9/Modules/_ctypes/libffi/config.sub.orig 2014-12-10 16:59:51.000000000 +0100 ++++ Python-2.7.9/Modules/_ctypes/libffi/config.sub 2015-05-03 18:58:32.633287511 +0200 +@@ -1,1788 +1,2 @@ + #! /bin/sh +-# Configuration validation subroutine script. +-# Copyright 1992-2013 Free Software Foundation, Inc. +- +-timestamp='2013-04-24' +- +-# This file is free software; you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, see . +-# +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that +-# program. This Exception is an additional permission under section 7 +-# of the GNU General Public License, version 3 ("GPLv3"). +- +- +-# Please send patches with a ChangeLog entry to config-patches@gnu.org. +-# +-# Configuration subroutine to validate and canonicalize a configuration type. +-# Supply the specified configuration type as an argument. +-# If it is invalid, we print an error message on stderr and exit with code 1. +-# Otherwise, we print the canonical config type on stdout and succeed. +- +-# You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +- +-# This file is supposed to be the same for all GNU packages +-# and recognize all the CPU types, system types and aliases +-# that are meaningful with *any* GNU software. +-# Each package is responsible for reporting which valid configurations +-# it does not support. The user should be able to distinguish +-# a failure to support a valid configuration from a meaningless +-# configuration. +- +-# The goal of this file is to map all the various variations of a given +-# machine specification into a single specification in the form: +-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +-# or in some cases, the newer four-part form: +-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +-# It is wrong to echo any other type of specification. +- +-me=`echo "$0" | sed -e 's,.*/,,'` +- +-usage="\ +-Usage: $0 [OPTION] CPU-MFR-OPSYS +- $0 [OPTION] ALIAS +- +-Canonicalize a configuration name. +- +-Operation modes: +- -h, --help print this help, then exit +- -t, --time-stamp print date of last modification, then exit +- -v, --version print version number, then exit +- +-Report bugs and patches to ." +- +-version="\ +-GNU config.sub ($timestamp) +- +-Copyright 1992-2013 Free Software Foundation, Inc. +- +-This is free software; see the source for copying conditions. There is NO +-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +- +-help=" +-Try \`$me --help' for more information." +- +-# Parse command line +-while test $# -gt 0 ; do +- case $1 in +- --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit ;; +- --version | -v ) +- echo "$version" ; exit ;; +- --help | --h* | -h ) +- echo "$usage"; exit ;; +- -- ) # Stop option processing +- shift; break ;; +- - ) # Use stdin as input. +- break ;; +- -* ) +- echo "$me: invalid option $1$help" +- exit 1 ;; +- +- *local*) +- # First pass through any local machine types. +- echo $1 +- exit ;; +- +- * ) +- break ;; +- esac +-done +- +-case $# in +- 0) echo "$me: missing argument$help" >&2 +- exit 1;; +- 1) ;; +- *) echo "$me: too many arguments$help" >&2 +- exit 1;; +-esac +- +-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +-# Here we must recognize all the valid KERNEL-OS combinations. +-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +-case $maybe_os in +- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ +- knetbsd*-gnu* | netbsd*-gnu* | \ +- kopensolaris*-gnu* | \ +- storm-chaos* | os2-emx* | rtmk-nova*) +- os=-$maybe_os +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` +- ;; +- android-linux) +- os=-linux-android +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown +- ;; +- *) +- basic_machine=`echo $1 | sed 's/-[^-]*$//'` +- if [ $basic_machine != $1 ] +- then os=`echo $1 | sed 's/.*-/-/'` +- else os=; fi +- ;; +-esac +- +-### Let's recognize common machines as not being operating systems so +-### that things like config.sub decstation-3100 work. We also +-### recognize some manufacturers as not being operating systems, so we +-### can provide default operating systems below. +-case $os in +- -sun*os*) +- # Prevent following clause from handling this invalid input. +- ;; +- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ +- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ +- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ +- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ +- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ +- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze*) +- os= +- basic_machine=$1 +- ;; +- -bluegene*) +- os=-cnk +- ;; +- -sim | -cisco | -oki | -wec | -winbond) +- os= +- basic_machine=$1 +- ;; +- -scout) +- ;; +- -wrs) +- os=-vxworks +- basic_machine=$1 +- ;; +- -chorusos*) +- os=-chorusos +- basic_machine=$1 +- ;; +- -chorusrdb) +- os=-chorusrdb +- basic_machine=$1 +- ;; +- -hiux*) +- os=-hiuxwe2 +- ;; +- -sco6) +- os=-sco5v6 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5) +- os=-sco3.2v5 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco4) +- os=-sco3.2v4 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2.[4-9]*) +- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2v[4-9]*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5v6*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco*) +- os=-sco3.2v2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -udk*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -isc) +- os=-isc2.2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -clix*) +- basic_machine=clipper-intergraph +- ;; +- -isc*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -lynx*178) +- os=-lynxos178 +- ;; +- -lynx*5) +- os=-lynxos5 +- ;; +- -lynx*) +- os=-lynxos +- ;; +- -ptx*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` +- ;; +- -windowsnt*) +- os=`echo $os | sed -e 's/windowsnt/winnt/'` +- ;; +- -psos*) +- os=-psos +- ;; +- -mint | -mint[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +-esac +- +-# Decode aliases for certain CPU-COMPANY combinations. +-case $basic_machine in +- # Recognize the basic CPU types without company name. +- # Some are omitted here because they have special meanings below. +- 1750a | 580 \ +- | a29k \ +- | aarch64 | aarch64_be \ +- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ +- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | am33_2.0 \ +- | arc | arceb \ +- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ +- | avr | avr32 \ +- | be32 | be64 \ +- | bfin \ +- | c4x | clipper \ +- | d10v | d30v | dlx | dsp16xx \ +- | epiphany \ +- | fido | fr30 | frv \ +- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ +- | i370 | i860 | i960 | ia64 \ +- | ip2k | iq2000 \ +- | le32 | le64 \ +- | lm32 \ +- | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ +- | mips | mipsbe | mipseb | mipsel | mipsle \ +- | mips16 \ +- | mips64 | mips64el \ +- | mips64octeon | mips64octeonel \ +- | mips64orion | mips64orionel \ +- | mips64r5900 | mips64r5900el \ +- | mips64vr | mips64vrel \ +- | mips64vr4100 | mips64vr4100el \ +- | mips64vr4300 | mips64vr4300el \ +- | mips64vr5000 | mips64vr5000el \ +- | mips64vr5900 | mips64vr5900el \ +- | mipsisa32 | mipsisa32el \ +- | mipsisa32r2 | mipsisa32r2el \ +- | mipsisa64 | mipsisa64el \ +- | mipsisa64r2 | mipsisa64r2el \ +- | mipsisa64sb1 | mipsisa64sb1el \ +- | mipsisa64sr71k | mipsisa64sr71kel \ +- | mipsr5900 | mipsr5900el \ +- | mipstx39 | mipstx39el \ +- | mn10200 | mn10300 \ +- | moxie \ +- | mt \ +- | msp430 \ +- | nds32 | nds32le | nds32be \ +- | nios | nios2 | nios2eb | nios2el \ +- | ns16k | ns32k \ +- | open8 \ +- | or1k | or32 \ +- | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle \ +- | pyramid \ +- | rl78 | rx \ +- | score \ +- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ +- | sh64 | sh64le \ +- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ +- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu \ +- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ +- | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ +- | we32k \ +- | x86 | xc16x | xstormy16 | xtensa \ +- | z8k | z80) +- basic_machine=$basic_machine-unknown +- ;; +- c54x) +- basic_machine=tic54x-unknown +- ;; +- c55x) +- basic_machine=tic55x-unknown +- ;; +- c6x) +- basic_machine=tic6x-unknown +- ;; +- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) +- ;; +- ms1) +- basic_machine=mt-unknown +- ;; +- +- strongarm | thumb | xscale) +- basic_machine=arm-unknown +- ;; +- xgate) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- xscaleeb) +- basic_machine=armeb-unknown +- ;; +- +- xscaleel) +- basic_machine=armel-unknown +- ;; +- +- # We use `pc' rather than `unknown' +- # because (1) that's what they normally are, and +- # (2) the word "unknown" tends to confuse beginning users. +- i*86 | x86_64) +- basic_machine=$basic_machine-pc +- ;; +- # Object if more than one company name word. +- *-*-*) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 +- ;; +- # Recognize the basic CPU types with company name. +- 580-* \ +- | a29k-* \ +- | aarch64-* | aarch64_be-* \ +- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ +- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* | avr32-* \ +- | be32-* | be64-* \ +- | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* \ +- | clipper-* | craynv-* | cydra-* \ +- | d10v-* | d30v-* | dlx-* \ +- | elxsi-* \ +- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ +- | h8300-* | h8500-* \ +- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ +- | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* | iq2000-* \ +- | le32-* | le64-* \ +- | lm32-* \ +- | m32c-* | m32r-* | m32rle-* \ +- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ +- | microblaze-* | microblazeel-* \ +- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ +- | mips16-* \ +- | mips64-* | mips64el-* \ +- | mips64octeon-* | mips64octeonel-* \ +- | mips64orion-* | mips64orionel-* \ +- | mips64r5900-* | mips64r5900el-* \ +- | mips64vr-* | mips64vrel-* \ +- | mips64vr4100-* | mips64vr4100el-* \ +- | mips64vr4300-* | mips64vr4300el-* \ +- | mips64vr5000-* | mips64vr5000el-* \ +- | mips64vr5900-* | mips64vr5900el-* \ +- | mipsisa32-* | mipsisa32el-* \ +- | mipsisa32r2-* | mipsisa32r2el-* \ +- | mipsisa64-* | mipsisa64el-* \ +- | mipsisa64r2-* | mipsisa64r2el-* \ +- | mipsisa64sb1-* | mipsisa64sb1el-* \ +- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipsr5900-* | mipsr5900el-* \ +- | mipstx39-* | mipstx39el-* \ +- | mmix-* \ +- | mt-* \ +- | msp430-* \ +- | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* | nios2eb-* | nios2el-* \ +- | none-* | np1-* | ns16k-* | ns32k-* \ +- | open8-* \ +- | orion-* \ +- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ +- | pyramid-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ +- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ +- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +- | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ +- | tahoe-* \ +- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ +- | tron-* \ +- | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ +- | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* \ +- | xstormy16-* | xtensa*-* \ +- | ymp-* \ +- | z8k-* | z80-*) +- ;; +- # Recognize the basic CPU types without company name, with glob match. +- xtensa*) +- basic_machine=$basic_machine-unknown +- ;; +- # Recognize the various machine names and aliases which stand +- # for a CPU type and a company and sometimes even an OS. +- 386bsd) +- basic_machine=i386-unknown +- os=-bsd +- ;; +- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) +- basic_machine=m68000-att +- ;; +- 3b*) +- basic_machine=we32k-att +- ;; +- a29khif) +- basic_machine=a29k-amd +- os=-udi +- ;; +- abacus) +- basic_machine=abacus-unknown +- ;; +- adobe68k) +- basic_machine=m68010-adobe +- os=-scout +- ;; +- alliant | fx80) +- basic_machine=fx80-alliant +- ;; +- altos | altos3068) +- basic_machine=m68k-altos +- ;; +- am29k) +- basic_machine=a29k-none +- os=-bsd +- ;; +- amd64) +- basic_machine=x86_64-pc +- ;; +- amd64-*) +- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- amdahl) +- basic_machine=580-amdahl +- os=-sysv +- ;; +- amiga | amiga-*) +- basic_machine=m68k-unknown +- ;; +- amigaos | amigados) +- basic_machine=m68k-unknown +- os=-amigaos +- ;; +- amigaunix | amix) +- basic_machine=m68k-unknown +- os=-sysv4 +- ;; +- apollo68) +- basic_machine=m68k-apollo +- os=-sysv +- ;; +- apollo68bsd) +- basic_machine=m68k-apollo +- os=-bsd +- ;; +- aros) +- basic_machine=i386-pc +- os=-aros +- ;; +- aux) +- basic_machine=m68k-apple +- os=-aux +- ;; +- balance) +- basic_machine=ns32k-sequent +- os=-dynix +- ;; +- blackfin) +- basic_machine=bfin-unknown +- os=-linux +- ;; +- blackfin-*) +- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- bluegene*) +- basic_machine=powerpc-ibm +- os=-cnk +- ;; +- c54x-*) +- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c55x-*) +- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c6x-*) +- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c90) +- basic_machine=c90-cray +- os=-unicos +- ;; +- cegcc) +- basic_machine=arm-unknown +- os=-cegcc +- ;; +- convex-c1) +- basic_machine=c1-convex +- os=-bsd +- ;; +- convex-c2) +- basic_machine=c2-convex +- os=-bsd +- ;; +- convex-c32) +- basic_machine=c32-convex +- os=-bsd +- ;; +- convex-c34) +- basic_machine=c34-convex +- os=-bsd +- ;; +- convex-c38) +- basic_machine=c38-convex +- os=-bsd +- ;; +- cray | j90) +- basic_machine=j90-cray +- os=-unicos +- ;; +- craynv) +- basic_machine=craynv-cray +- os=-unicosmp +- ;; +- cr16 | cr16-*) +- basic_machine=cr16-unknown +- os=-elf +- ;; +- crds | unos) +- basic_machine=m68k-crds +- ;; +- crisv32 | crisv32-* | etraxfs*) +- basic_machine=crisv32-axis +- ;; +- cris | cris-* | etrax*) +- basic_machine=cris-axis +- ;; +- crx) +- basic_machine=crx-unknown +- os=-elf +- ;; +- da30 | da30-*) +- basic_machine=m68k-da30 +- ;; +- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) +- basic_machine=mips-dec +- ;; +- decsystem10* | dec10*) +- basic_machine=pdp10-dec +- os=-tops10 +- ;; +- decsystem20* | dec20*) +- basic_machine=pdp10-dec +- os=-tops20 +- ;; +- delta | 3300 | motorola-3300 | motorola-delta \ +- | 3300-motorola | delta-motorola) +- basic_machine=m68k-motorola +- ;; +- delta88) +- basic_machine=m88k-motorola +- os=-sysv3 +- ;; +- dicos) +- basic_machine=i686-pc +- os=-dicos +- ;; +- djgpp) +- basic_machine=i586-pc +- os=-msdosdjgpp +- ;; +- dpx20 | dpx20-*) +- basic_machine=rs6000-bull +- os=-bosx +- ;; +- dpx2* | dpx2*-bull) +- basic_machine=m68k-bull +- os=-sysv3 +- ;; +- ebmon29k) +- basic_machine=a29k-amd +- os=-ebmon +- ;; +- elxsi) +- basic_machine=elxsi-elxsi +- os=-bsd +- ;; +- encore | umax | mmax) +- basic_machine=ns32k-encore +- ;; +- es1800 | OSE68k | ose68k | ose | OSE) +- basic_machine=m68k-ericsson +- os=-ose +- ;; +- fx2800) +- basic_machine=i860-alliant +- ;; +- genix) +- basic_machine=ns32k-ns +- ;; +- gmicro) +- basic_machine=tron-gmicro +- os=-sysv +- ;; +- go32) +- basic_machine=i386-pc +- os=-go32 +- ;; +- h3050r* | hiux*) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- h8300hms) +- basic_machine=h8300-hitachi +- os=-hms +- ;; +- h8300xray) +- basic_machine=h8300-hitachi +- os=-xray +- ;; +- h8500hms) +- basic_machine=h8500-hitachi +- os=-hms +- ;; +- harris) +- basic_machine=m88k-harris +- os=-sysv3 +- ;; +- hp300-*) +- basic_machine=m68k-hp +- ;; +- hp300bsd) +- basic_machine=m68k-hp +- os=-bsd +- ;; +- hp300hpux) +- basic_machine=m68k-hp +- os=-hpux +- ;; +- hp3k9[0-9][0-9] | hp9[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k2[0-9][0-9] | hp9k31[0-9]) +- basic_machine=m68000-hp +- ;; +- hp9k3[2-9][0-9]) +- basic_machine=m68k-hp +- ;; +- hp9k6[0-9][0-9] | hp6[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k7[0-79][0-9] | hp7[0-79][0-9]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k78[0-9] | hp78[0-9]) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][13679] | hp8[0-9][13679]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][0-9] | hp8[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hppa-next) +- os=-nextstep3 +- ;; +- hppaosf) +- basic_machine=hppa1.1-hp +- os=-osf +- ;; +- hppro) +- basic_machine=hppa1.1-hp +- os=-proelf +- ;; +- i370-ibm* | ibm*) +- basic_machine=i370-ibm +- ;; +- i*86v32) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv32 +- ;; +- i*86v4*) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv4 +- ;; +- i*86v) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv +- ;; +- i*86sol2) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-solaris2 +- ;; +- i386mach) +- basic_machine=i386-mach +- os=-mach +- ;; +- i386-vsta | vsta) +- basic_machine=i386-unknown +- os=-vsta +- ;; +- iris | iris4d) +- basic_machine=mips-sgi +- case $os in +- -irix*) +- ;; +- *) +- os=-irix4 +- ;; +- esac +- ;; +- isi68 | isi) +- basic_machine=m68k-isi +- os=-sysv +- ;; +- m68knommu) +- basic_machine=m68k-unknown +- os=-linux +- ;; +- m68knommu-*) +- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- m88k-omron*) +- basic_machine=m88k-omron +- ;; +- magnum | m3230) +- basic_machine=mips-mips +- os=-sysv +- ;; +- merlin) +- basic_machine=ns32k-utek +- os=-sysv +- ;; +- microblaze*) +- basic_machine=microblaze-xilinx +- ;; +- mingw64) +- basic_machine=x86_64-pc +- os=-mingw64 +- ;; +- mingw32) +- basic_machine=i386-pc +- os=-mingw32 +- ;; +- mingw32ce) +- basic_machine=arm-unknown +- os=-mingw32ce +- ;; +- miniframe) +- basic_machine=m68000-convergent +- ;; +- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +- mips3*-*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +- ;; +- mips3*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown +- ;; +- monitor) +- basic_machine=m68k-rom68k +- os=-coff +- ;; +- morphos) +- basic_machine=powerpc-unknown +- os=-morphos +- ;; +- msdos) +- basic_machine=i386-pc +- os=-msdos +- ;; +- ms1-*) +- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` +- ;; +- msys) +- basic_machine=i386-pc +- os=-msys +- ;; +- mvs) +- basic_machine=i370-ibm +- os=-mvs +- ;; +- nacl) +- basic_machine=le32-unknown +- os=-nacl +- ;; +- ncr3000) +- basic_machine=i486-ncr +- os=-sysv4 +- ;; +- netbsd386) +- basic_machine=i386-unknown +- os=-netbsd +- ;; +- netwinder) +- basic_machine=armv4l-rebel +- os=-linux +- ;; +- news | news700 | news800 | news900) +- basic_machine=m68k-sony +- os=-newsos +- ;; +- news1000) +- basic_machine=m68030-sony +- os=-newsos +- ;; +- news-3600 | risc-news) +- basic_machine=mips-sony +- os=-newsos +- ;; +- necv70) +- basic_machine=v70-nec +- os=-sysv +- ;; +- next | m*-next ) +- basic_machine=m68k-next +- case $os in +- -nextstep* ) +- ;; +- -ns2*) +- os=-nextstep2 +- ;; +- *) +- os=-nextstep3 +- ;; +- esac +- ;; +- nh3000) +- basic_machine=m68k-harris +- os=-cxux +- ;; +- nh[45]000) +- basic_machine=m88k-harris +- os=-cxux +- ;; +- nindy960) +- basic_machine=i960-intel +- os=-nindy +- ;; +- mon960) +- basic_machine=i960-intel +- os=-mon960 +- ;; +- nonstopux) +- basic_machine=mips-compaq +- os=-nonstopux +- ;; +- np1) +- basic_machine=np1-gould +- ;; +- neo-tandem) +- basic_machine=neo-tandem +- ;; +- nse-tandem) +- basic_machine=nse-tandem +- ;; +- nsr-tandem) +- basic_machine=nsr-tandem +- ;; +- op50n-* | op60c-*) +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- openrisc | openrisc-*) +- basic_machine=or32-unknown +- ;; +- os400) +- basic_machine=powerpc-ibm +- os=-os400 +- ;; +- OSE68000 | ose68000) +- basic_machine=m68000-ericsson +- os=-ose +- ;; +- os68k) +- basic_machine=m68k-none +- os=-os68k +- ;; +- pa-hitachi) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- paragon) +- basic_machine=i860-intel +- os=-osf +- ;; +- parisc) +- basic_machine=hppa-unknown +- os=-linux +- ;; +- parisc-*) +- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- pbd) +- basic_machine=sparc-tti +- ;; +- pbb) +- basic_machine=m68k-tti +- ;; +- pc532 | pc532-*) +- basic_machine=ns32k-pc532 +- ;; +- pc98) +- basic_machine=i386-pc +- ;; +- pc98-*) +- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium | p5 | k5 | k6 | nexgen | viac3) +- basic_machine=i586-pc +- ;; +- pentiumpro | p6 | 6x86 | athlon | athlon_*) +- basic_machine=i686-pc +- ;; +- pentiumii | pentium2 | pentiumiii | pentium3) +- basic_machine=i686-pc +- ;; +- pentium4) +- basic_machine=i786-pc +- ;; +- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) +- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumpro-* | p6-* | 6x86-* | athlon-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium4-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pn) +- basic_machine=pn-gould +- ;; +- power) basic_machine=power-ibm +- ;; +- ppc | ppcbe) basic_machine=powerpc-unknown +- ;; +- ppc-* | ppcbe-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppcle | powerpclittle | ppc-le | powerpc-little) +- basic_machine=powerpcle-unknown +- ;; +- ppcle-* | powerpclittle-*) +- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64) basic_machine=powerpc64-unknown +- ;; +- ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64le | powerpc64little | ppc64-le | powerpc64-little) +- basic_machine=powerpc64le-unknown +- ;; +- ppc64le-* | powerpc64little-*) +- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ps2) +- basic_machine=i386-ibm +- ;; +- pw32) +- basic_machine=i586-unknown +- os=-pw32 +- ;; +- rdos | rdos64) +- basic_machine=x86_64-pc +- os=-rdos +- ;; +- rdos32) +- basic_machine=i386-pc +- os=-rdos +- ;; +- rom68k) +- basic_machine=m68k-rom68k +- os=-coff +- ;; +- rm[46]00) +- basic_machine=mips-siemens +- ;; +- rtpc | rtpc-*) +- basic_machine=romp-ibm +- ;; +- s390 | s390-*) +- basic_machine=s390-ibm +- ;; +- s390x | s390x-*) +- basic_machine=s390x-ibm +- ;; +- sa29200) +- basic_machine=a29k-amd +- os=-udi +- ;; +- sb1) +- basic_machine=mipsisa64sb1-unknown +- ;; +- sb1el) +- basic_machine=mipsisa64sb1el-unknown +- ;; +- sde) +- basic_machine=mipsisa32-sde +- os=-elf +- ;; +- sei) +- basic_machine=mips-sei +- os=-seiux +- ;; +- sequent) +- basic_machine=i386-sequent +- ;; +- sh) +- basic_machine=sh-hitachi +- os=-hms +- ;; +- sh5el) +- basic_machine=sh5le-unknown +- ;; +- sh64) +- basic_machine=sh64-unknown +- ;; +- sparclite-wrs | simso-wrs) +- basic_machine=sparclite-wrs +- os=-vxworks +- ;; +- sps7) +- basic_machine=m68k-bull +- os=-sysv2 +- ;; +- spur) +- basic_machine=spur-unknown +- ;; +- st2000) +- basic_machine=m68k-tandem +- ;; +- stratus) +- basic_machine=i860-stratus +- os=-sysv4 +- ;; +- strongarm-* | thumb-*) +- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- sun2) +- basic_machine=m68000-sun +- ;; +- sun2os3) +- basic_machine=m68000-sun +- os=-sunos3 +- ;; +- sun2os4) +- basic_machine=m68000-sun +- os=-sunos4 +- ;; +- sun3os3) +- basic_machine=m68k-sun +- os=-sunos3 +- ;; +- sun3os4) +- basic_machine=m68k-sun +- os=-sunos4 +- ;; +- sun4os3) +- basic_machine=sparc-sun +- os=-sunos3 +- ;; +- sun4os4) +- basic_machine=sparc-sun +- os=-sunos4 +- ;; +- sun4sol2) +- basic_machine=sparc-sun +- os=-solaris2 +- ;; +- sun3 | sun3-*) +- basic_machine=m68k-sun +- ;; +- sun4) +- basic_machine=sparc-sun +- ;; +- sun386 | sun386i | roadrunner) +- basic_machine=i386-sun +- ;; +- sv1) +- basic_machine=sv1-cray +- os=-unicos +- ;; +- symmetry) +- basic_machine=i386-sequent +- os=-dynix +- ;; +- t3e) +- basic_machine=alphaev5-cray +- os=-unicos +- ;; +- t90) +- basic_machine=t90-cray +- os=-unicos +- ;; +- tile*) +- basic_machine=$basic_machine-unknown +- os=-linux-gnu +- ;; +- tx39) +- basic_machine=mipstx39-unknown +- ;; +- tx39el) +- basic_machine=mipstx39el-unknown +- ;; +- toad1) +- basic_machine=pdp10-xkl +- os=-tops20 +- ;; +- tower | tower-32) +- basic_machine=m68k-ncr +- ;; +- tpf) +- basic_machine=s390x-ibm +- os=-tpf +- ;; +- udi29k) +- basic_machine=a29k-amd +- os=-udi +- ;; +- ultra3) +- basic_machine=a29k-nyu +- os=-sym1 +- ;; +- v810 | necv810) +- basic_machine=v810-nec +- os=-none +- ;; +- vaxv) +- basic_machine=vax-dec +- os=-sysv +- ;; +- vms) +- basic_machine=vax-dec +- os=-vms +- ;; +- vpp*|vx|vx-*) +- basic_machine=f301-fujitsu +- ;; +- vxworks960) +- basic_machine=i960-wrs +- os=-vxworks +- ;; +- vxworks68) +- basic_machine=m68k-wrs +- os=-vxworks +- ;; +- vxworks29k) +- basic_machine=a29k-wrs +- os=-vxworks +- ;; +- w65*) +- basic_machine=w65-wdc +- os=-none +- ;; +- w89k-*) +- basic_machine=hppa1.1-winbond +- os=-proelf +- ;; +- xbox) +- basic_machine=i686-pc +- os=-mingw32 +- ;; +- xps | xps100) +- basic_machine=xps100-honeywell +- ;; +- xscale-* | xscalee[bl]-*) +- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` +- ;; +- ymp) +- basic_machine=ymp-cray +- os=-unicos +- ;; +- z8k-*-coff) +- basic_machine=z8k-unknown +- os=-sim +- ;; +- z80-*-coff) +- basic_machine=z80-unknown +- os=-sim +- ;; +- none) +- basic_machine=none-none +- os=-none +- ;; +- +-# Here we handle the default manufacturer of certain CPU types. It is in +-# some cases the only manufacturer, in others, it is the most popular. +- w89k) +- basic_machine=hppa1.1-winbond +- ;; +- op50n) +- basic_machine=hppa1.1-oki +- ;; +- op60c) +- basic_machine=hppa1.1-oki +- ;; +- romp) +- basic_machine=romp-ibm +- ;; +- mmix) +- basic_machine=mmix-knuth +- ;; +- rs6000) +- basic_machine=rs6000-ibm +- ;; +- vax) +- basic_machine=vax-dec +- ;; +- pdp10) +- # there are many clones, so DEC is not a safe bet +- basic_machine=pdp10-unknown +- ;; +- pdp11) +- basic_machine=pdp11-dec +- ;; +- we32k) +- basic_machine=we32k-att +- ;; +- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) +- basic_machine=sh-unknown +- ;; +- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) +- basic_machine=sparc-sun +- ;; +- cydra) +- basic_machine=cydra-cydrome +- ;; +- orion) +- basic_machine=orion-highlevel +- ;; +- orion105) +- basic_machine=clipper-highlevel +- ;; +- mac | mpw | mac-mpw) +- basic_machine=m68k-apple +- ;; +- pmac | pmac-mpw) +- basic_machine=powerpc-apple +- ;; +- *-unknown) +- # Make sure to match an already-canonicalized machine name. +- ;; +- *) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 +- ;; +-esac +- +-# Here we canonicalize certain aliases for manufacturers. +-case $basic_machine in +- *-digital*) +- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +- ;; +- *-commodore*) +- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` +- ;; +- *) +- ;; +-esac +- +-# Decode manufacturer-specific aliases for certain operating systems. +- +-if [ x"$os" != x"" ] +-then +-case $os in +- # First match some system type aliases +- # that might get confused with valid system types. +- # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux +- ;; +- -solaris1 | -solaris1.*) +- os=`echo $os | sed -e 's|solaris1|sunos4|'` +- ;; +- -solaris) +- os=-solaris2 +- ;; +- -svr4*) +- os=-sysv4 +- ;; +- -unixware*) +- os=-sysv4.2uw +- ;; +- -gnu/linux*) +- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` +- ;; +- # First accept the basic system types. +- # The portable systems comes first. +- # Each alternative MUST END IN A *, to match a version number. +- # -sysv* is not here because it comes later, after sysvr4. +- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ +- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ +- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ +- | -sym* | -kopensolaris* | -plan9* \ +- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ +- | -aos* | -aros* \ +- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ +- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ +- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ +- | -bitrig* | -openbsd* | -solidbsd* \ +- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ +- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ +- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ +- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ +- | -chorusos* | -chorusrdb* | -cegcc* \ +- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ +- | -linux-newlib* | -linux-musl* | -linux-uclibc* \ +- | -uxpv* | -beos* | -mpeix* | -udk* \ +- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ +- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ +- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ +- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ +- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) +- # Remember, each alternative MUST END IN *, to match a version number. +- ;; +- -qnx*) +- case $basic_machine in +- x86-* | i*86-*) +- ;; +- *) +- os=-nto$os +- ;; +- esac +- ;; +- -nto-qnx*) +- ;; +- -nto*) +- os=`echo $os | sed -e 's|nto|nto-qnx|'` +- ;; +- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ +- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) +- ;; +- -mac*) +- os=`echo $os | sed -e 's|mac|macos|'` +- ;; +- -linux-dietlibc) +- os=-linux-dietlibc +- ;; +- -linux*) +- os=`echo $os | sed -e 's|linux|linux-gnu|'` +- ;; +- -sunos5*) +- os=`echo $os | sed -e 's|sunos5|solaris2|'` +- ;; +- -sunos6*) +- os=`echo $os | sed -e 's|sunos6|solaris3|'` +- ;; +- -opened*) +- os=-openedition +- ;; +- -os400*) +- os=-os400 +- ;; +- -wince*) +- os=-wince +- ;; +- -osfrose*) +- os=-osfrose +- ;; +- -osf*) +- os=-osf +- ;; +- -utek*) +- os=-bsd +- ;; +- -dynix*) +- os=-bsd +- ;; +- -acis*) +- os=-aos +- ;; +- -atheos*) +- os=-atheos +- ;; +- -syllable*) +- os=-syllable +- ;; +- -386bsd) +- os=-bsd +- ;; +- -ctix* | -uts*) +- os=-sysv +- ;; +- -nova*) +- os=-rtmk-nova +- ;; +- -ns2 ) +- os=-nextstep2 +- ;; +- -nsk*) +- os=-nsk +- ;; +- # Preserve the version number of sinix5. +- -sinix5.*) +- os=`echo $os | sed -e 's|sinix|sysv|'` +- ;; +- -sinix*) +- os=-sysv4 +- ;; +- -tpf*) +- os=-tpf +- ;; +- -triton*) +- os=-sysv3 +- ;; +- -oss*) +- os=-sysv3 +- ;; +- -svr4) +- os=-sysv4 +- ;; +- -svr3) +- os=-sysv3 +- ;; +- -sysvr4) +- os=-sysv4 +- ;; +- # This must come after -sysvr4. +- -sysv*) +- ;; +- -ose*) +- os=-ose +- ;; +- -es1800*) +- os=-ose +- ;; +- -xenix) +- os=-xenix +- ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) +- os=-mint +- ;; +- -aros*) +- os=-aros +- ;; +- -zvmoe) +- os=-zvmoe +- ;; +- -dicos*) +- os=-dicos +- ;; +- -nacl*) +- ;; +- -none) +- ;; +- *) +- # Get rid of the `-' at the beginning of $os. +- os=`echo $os | sed 's/[^-]*-//'` +- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 +- exit 1 +- ;; +-esac +-else +- +-# Here we handle the default operating systems that come with various machines. +-# The value should be what the vendor currently ships out the door with their +-# machine or put another way, the most popular os provided with the machine. +- +-# Note that if you're going to try to match "-MANUFACTURER" here (say, +-# "-sun"), then you have to tell the case statement up towards the top +-# that MANUFACTURER isn't an operating system. Otherwise, code above +-# will signal an error saying that MANUFACTURER isn't an operating +-# system, and we'll never get to this point. +- +-case $basic_machine in +- score-*) +- os=-elf +- ;; +- spu-*) +- os=-elf +- ;; +- *-acorn) +- os=-riscix1.2 +- ;; +- arm*-rebel) +- os=-linux +- ;; +- arm*-semi) +- os=-aout +- ;; +- c4x-* | tic4x-*) +- os=-coff +- ;; +- hexagon-*) +- os=-elf +- ;; +- tic54x-*) +- os=-coff +- ;; +- tic55x-*) +- os=-coff +- ;; +- tic6x-*) +- os=-coff +- ;; +- # This must come before the *-dec entry. +- pdp10-*) +- os=-tops20 +- ;; +- pdp11-*) +- os=-none +- ;; +- *-dec | vax-*) +- os=-ultrix4.2 +- ;; +- m68*-apollo) +- os=-domain +- ;; +- i386-sun) +- os=-sunos4.0.2 +- ;; +- m68000-sun) +- os=-sunos3 +- ;; +- m68*-cisco) +- os=-aout +- ;; +- mep-*) +- os=-elf +- ;; +- mips*-cisco) +- os=-elf +- ;; +- mips*-*) +- os=-elf +- ;; +- or1k-*) +- os=-elf +- ;; +- or32-*) +- os=-coff +- ;; +- *-tti) # must be before sparc entry or we get the wrong os. +- os=-sysv3 +- ;; +- sparc-* | *-sun) +- os=-sunos4.1.1 +- ;; +- *-be) +- os=-beos +- ;; +- *-haiku) +- os=-haiku +- ;; +- *-ibm) +- os=-aix +- ;; +- *-knuth) +- os=-mmixware +- ;; +- *-wec) +- os=-proelf +- ;; +- *-winbond) +- os=-proelf +- ;; +- *-oki) +- os=-proelf +- ;; +- *-hp) +- os=-hpux +- ;; +- *-hitachi) +- os=-hiux +- ;; +- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) +- os=-sysv +- ;; +- *-cbm) +- os=-amigaos +- ;; +- *-dg) +- os=-dgux +- ;; +- *-dolphin) +- os=-sysv3 +- ;; +- m68k-ccur) +- os=-rtu +- ;; +- m88k-omron*) +- os=-luna +- ;; +- *-next ) +- os=-nextstep +- ;; +- *-sequent) +- os=-ptx +- ;; +- *-crds) +- os=-unos +- ;; +- *-ns) +- os=-genix +- ;; +- i370-*) +- os=-mvs +- ;; +- *-next) +- os=-nextstep3 +- ;; +- *-gould) +- os=-sysv +- ;; +- *-highlevel) +- os=-bsd +- ;; +- *-encore) +- os=-bsd +- ;; +- *-sgi) +- os=-irix +- ;; +- *-siemens) +- os=-sysv4 +- ;; +- *-masscomp) +- os=-rtu +- ;; +- f30[01]-fujitsu | f700-fujitsu) +- os=-uxpv +- ;; +- *-rom68k) +- os=-coff +- ;; +- *-*bug) +- os=-coff +- ;; +- *-apple) +- os=-macos +- ;; +- *-atari*) +- os=-mint +- ;; +- *) +- os=-none +- ;; +-esac +-fi +- +-# Here we handle the case where we know the os, and the CPU type, but not the +-# manufacturer. We pick the logical manufacturer. +-vendor=unknown +-case $basic_machine in +- *-unknown) +- case $os in +- -riscix*) +- vendor=acorn +- ;; +- -sunos*) +- vendor=sun +- ;; +- -cnk*|-aix*) +- vendor=ibm +- ;; +- -beos*) +- vendor=be +- ;; +- -hpux*) +- vendor=hp +- ;; +- -mpeix*) +- vendor=hp +- ;; +- -hiux*) +- vendor=hitachi +- ;; +- -unos*) +- vendor=crds +- ;; +- -dgux*) +- vendor=dg +- ;; +- -luna*) +- vendor=omron +- ;; +- -genix*) +- vendor=ns +- ;; +- -mvs* | -opened*) +- vendor=ibm +- ;; +- -os400*) +- vendor=ibm +- ;; +- -ptx*) +- vendor=sequent +- ;; +- -tpf*) +- vendor=ibm +- ;; +- -vxsim* | -vxworks* | -windiss*) +- vendor=wrs +- ;; +- -aux*) +- vendor=apple +- ;; +- -hms*) +- vendor=hitachi +- ;; +- -mpw* | -macos*) +- vendor=apple +- ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) +- vendor=atari +- ;; +- -vos*) +- vendor=stratus +- ;; +- esac +- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` +- ;; +-esac +- +-echo $basic_machine$os +-exit +- +-# Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) +-# time-stamp-start: "timestamp='" +-# time-stamp-format: "%:y-%02m-%02d" +-# time-stamp-end: "'" +-# End: ++echo arm-linux-androideabi diff --git a/pythonforandroid/recipes/python2/patches/fix-configure-darwin.patch b/pythonforandroid/recipes/python2/patches/fix-configure-darwin.patch index 93a1fe3db3..23ade7d273 100644 --- a/pythonforandroid/recipes/python2/patches/fix-configure-darwin.patch +++ b/pythonforandroid/recipes/python2/patches/fix-configure-darwin.patch @@ -1,15 +1,15 @@ ---- Python-2.7.2.orig/configure 2012-07-09 23:48:02.000000000 +0200 -+++ Python-2.7.2/configure 2012-07-09 23:47:34.000000000 +0200 -@@ -4927,7 +4927,7 @@ - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} +--- Python-2.7.9/configure.orig 2016-03-17 11:14:51.963097000 +0100 ++++ Python-2.7.9/configure 2016-03-17 11:24:32.108578473 +0100 +@@ -5346,7 +5346,7 @@ + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} INSTSONAME="$LDLIBRARY".$SOVERSION ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Darwin*) +- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) ++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Darwin*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -@@ -4960,7 +4960,7 @@ + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +@@ -5379,7 +5379,7 @@ BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} ;; @@ -17,8 +17,8 @@ + DDarwin*) LDLIBRARY='libpython$(VERSION).dylib' BLDLIBRARY='-L. -lpython$(VERSION)' - RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' -@@ -7625,6 +7625,9 @@ + RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} +@@ -8181,6 +8181,9 @@ LDSHARED='ld -b' fi ;; OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; @@ -28,8 +28,8 @@ Darwin/1.3*) LDSHARED='$(CC) -bundle' LDCXXSHARED='$(CXX) -bundle' -@@ -7680,9 +7683,6 @@ - fi +@@ -8243,9 +8246,6 @@ + BLDSHARED="$LDSHARED" fi ;; - Linux*|GNU*|QNX*) diff --git a/pythonforandroid/recipes/python2/patches/fix-distutils-darwin.patch b/pythonforandroid/recipes/python2/patches/fix-distutils-darwin.patch index 4083634874..11e66f12e3 100644 --- a/pythonforandroid/recipes/python2/patches/fix-distutils-darwin.patch +++ b/pythonforandroid/recipes/python2/patches/fix-distutils-darwin.patch @@ -1,24 +1,15 @@ ---- Python-2.7.2.orig/Lib/distutils/command/build_ext.py 2011-06-11 17:46:24.000000000 +0200 -+++ Python-2.7.2/Lib/distutils/command/build_ext.py 2012-08-01 18:32:13.000000000 +0200 -@@ -236,7 +236,7 @@ - # Python's library directory must be appended to library_dirs - sysconfig.get_config_var('Py_ENABLE_SHARED') - if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') -- or sys.platform.startswith('sunos')) -+ or sys.platform.startswith('sunos') or sys.platform.startswith('darwin')) - and sysconfig.get_config_var('Py_ENABLE_SHARED')): - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): - # building third party extensions -@@ -750,9 +750,9 @@ +--- Python-2.7.9/Lib/distutils/command/build_ext.py.orig 2014-12-10 16:59:34.000000000 +0100 ++++ Python-2.7.9/Lib/distutils/command/build_ext.py 2016-03-17 11:45:06.953243146 +0100 +@@ -747,9 +747,9 @@ # extensions, it is a reference to the original list return ext.libraries + [pythonlib, "m"] + extra - elif sys.platform == 'darwin': - # Don't use the default code below - return ext.libraries -+ #elif sys.platform == 'darwin': -+ # # Don't use the default code below -+ # return ext.libraries ++ # elif sys.platform == 'darwin': ++ # # Don't use the default code below ++ # return ext.libraries elif sys.platform[:3] == 'aix': # Don't use the default code below return ext.libraries diff --git a/pythonforandroid/recipes/python2/patches/fix-dynamic-lookup.patch b/pythonforandroid/recipes/python2/patches/fix-dynamic-lookup.patch index 982cb30b42..a6be41c610 100644 --- a/pythonforandroid/recipes/python2/patches/fix-dynamic-lookup.patch +++ b/pythonforandroid/recipes/python2/patches/fix-dynamic-lookup.patch @@ -1,11 +1,11 @@ ---- Python-2.7.2/Makefile.pre.in.orig 2012-07-05 17:09:45.000000000 +0200 -+++ Python-2.7.2/Makefile.pre.in 2012-07-05 17:10:00.000000000 +0200 -@@ -435,7 +435,7 @@ +--- Python-2.7.9/Makefile.pre.in.orig 2016-02-05 13:37:39.934049414 +0100 ++++ Python-2.7.9/Makefile.pre.in 2016-02-05 13:41:38.101745579 +0100 +@@ -498,7 +498,7 @@ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) - $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - + libpython$(VERSION).sl: $(LIBRARY_OBJS) diff --git a/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch b/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch index 5d79a1dc12..7202947078 100644 --- a/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch +++ b/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch @@ -1,6 +1,5 @@ -diff -u -r Python-2.7.2.orig/Modules/timemodule.c Python-2.7.2/Modules/timemodule.c ---- Python-2.7.2.orig/Modules/timemodule.c 2011-06-11 15:46:27.000000000 +0000 -+++ Python-2.7.2/Modules/timemodule.c 2015-09-11 10:37:36.708661691 +0000 +--- Python-2.7.9/Modules/timemodule.c.orig 2016-03-17 11:52:46.674588000 +0100 ++++ Python-2.7.9/Modules/timemodule.c 2016-03-17 11:53:34.028526305 +0100 @@ -27,6 +27,7 @@ #include #endif diff --git a/pythonforandroid/recipes/python2/patches/fix-locale-2.7.11.patch b/pythonforandroid/recipes/python2/patches/fix-locale-2.7.11.patch new file mode 100644 index 0000000000..b6610562d4 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/fix-locale-2.7.11.patch @@ -0,0 +1,91 @@ +--- Python-2.7.9.orig/Modules/pwdmodule.c 2010-08-16 22:30:26.000000000 +0200 ++++ Python-2.7.9/Modules/pwdmodule.c 2011-04-20 17:52:12.000000000 +0200 +@@ -75,11 +75,7 @@ + #endif + PyStructSequence_SET_ITEM(v, setIndex++, _PyInt_FromUid(p->pw_uid)); + PyStructSequence_SET_ITEM(v, setIndex++, _PyInt_FromGid(p->pw_gid)); +-#ifdef __VMS + SETS(setIndex++, ""); +-#else +- SETS(setIndex++, p->pw_gecos); +-#endif + SETS(setIndex++, p->pw_dir); + SETS(setIndex++, p->pw_shell); + + --- Python-2.7.9.orig/Modules/posixmodule.c 2010-11-26 18:35:50.000000000 +0100 ++++ Python-2.7.9/Modules/posixmodule.c 2011-04-20 17:52:12.000000000 +0200 +@@ -3775,13 +3775,6 @@ + slave_fd = open(slave_name, O_RDWR | O_NOCTTY); /* open slave */ + if (slave_fd < 0) + return posix_error(); +-#if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC) +- ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ +- ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ +-#ifndef __hpux +- ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */ +-#endif /* __hpux */ +-#endif /* HAVE_CYGWIN */ + #endif /* HAVE_OPENPTY */ + + return Py_BuildValue("(ii)", master_fd, slave_fd); +--- Python-2.7.9.orig/Objects/stringlib/formatter.h 2010-08-01 12:45:15.000000000 +0200 ++++ Python-2.7.9/Objects/stringlib/formatter.h 2011-04-20 17:52:12.000000000 +0200 +@@ -639,13 +639,7 @@ + get_locale_info(int type, LocaleInfo *locale_info) + { + switch (type) { +- case LT_CURRENT_LOCALE: { +- struct lconv *locale_data = localeconv(); +- locale_info->decimal_point = locale_data->decimal_point; +- locale_info->thousands_sep = locale_data->thousands_sep; +- locale_info->grouping = locale_data->grouping; +- break; +- } ++ case LT_CURRENT_LOCALE: + case LT_DEFAULT_LOCALE: + locale_info->decimal_point = "."; + locale_info->thousands_sep = ","; +--- Python-2.7.9.orig/Objects/stringlib/localeutil.h 2009-04-22 15:29:05.000000000 +0200 ++++ Python-2.7.9/Objects/stringlib/localeutil.h 2011-04-20 17:52:12.000000000 +0200 +@@ -202,9 +202,8 @@ + Py_ssize_t n_digits, + Py_ssize_t min_width) + { +- struct lconv *locale_data = localeconv(); +- const char *grouping = locale_data->grouping; +- const char *thousands_sep = locale_data->thousands_sep; ++ const char *grouping = "\3\0"; ++ const char *thousands_sep = ","; + + return _Py_InsertThousandsGrouping(buffer, n_buffer, digits, n_digits, + min_width, grouping, thousands_sep); +--- Python-2.7.9.orig/Python/pystrtod.c 2010-05-09 16:46:46.000000000 +0200 ++++ Python-2.7.9/Python/pystrtod.c 2011-04-20 17:52:12.000000000 +0200 +@@ -126,7 +126,6 @@ + { + char *fail_pos; + double val = -1.0; +- struct lconv *locale_data; + const char *decimal_point; + size_t decimal_point_len; + const char *p, *decimal_point_pos; +@@ -138,8 +137,7 @@ + + fail_pos = NULL; + +- locale_data = localeconv(); +- decimal_point = locale_data->decimal_point; ++ decimal_point = "."; + decimal_point_len = strlen(decimal_point); + + assert(decimal_point_len != 0); +@@ -375,8 +373,7 @@ + Py_LOCAL_INLINE(void) + change_decimal_from_locale_to_dot(char* buffer) + { +- struct lconv *locale_data = localeconv(); +- const char *decimal_point = locale_data->decimal_point; ++ const char *decimal_point = "."; + + if (decimal_point[0] != '.' || decimal_point[1] != 0) { + size_t decimal_point_len = strlen(decimal_point); diff --git a/pythonforandroid/recipes/python2/patches/fix-platform-2.7.11.patch b/pythonforandroid/recipes/python2/patches/fix-platform-2.7.11.patch new file mode 100644 index 0000000000..d0093c6ef3 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/fix-platform-2.7.11.patch @@ -0,0 +1,32 @@ +--- Python-2.7.9/Python/getplatform.c.orig 2014-12-10 16:59:59.000000000 +0100 ++++ Python-2.7.9/Python/getplatform.c 2015-05-03 19:17:58.071596232 +0200 +@@ -1,12 +1,25 @@ + + #include "Python.h" + +-#ifndef PLATFORM +-#define PLATFORM "unknown" +-#endif ++#include ++#include + + const char * + Py_GetPlatform(void) + { +- return PLATFORM; ++ struct utsname u; ++ int i; ++ if ( uname(&u) < 0 ) ++ return "unknown"; ++ ++ char xx[37]; ++ memset(xx, 0, 37); ++ strcat (xx, u.sysname); ++ strcat (xx, "-"); ++ strcat (xx, u.machine); ++ ++ for (i=0; xx[i]; i++) ++ xx[i]=tolower(xx[i]); ++ ++ return xx; + } diff --git a/pythonforandroid/recipes/python2/patches/modules-locales-2.7.11.patch b/pythonforandroid/recipes/python2/patches/modules-locales-2.7.11.patch new file mode 100644 index 0000000000..b3f1d00713 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/modules-locales-2.7.11.patch @@ -0,0 +1,27 @@ +--- Python-2.7.9/Modules/_localemodule.c.orig 2013-05-12 05:32:50.000000000 +0200 ++++ Python-2.7.9/Modules/_localemodule.c 2015-05-02 21:33:42.241092717 +0200 +@@ -20,6 +20,8 @@ This software comes with no warranty. Us + #include + #endif + ++#define ANDROID ++ + #ifdef HAVE_LANGINFO_H + #include + #endif +@@ -205,6 +207,7 @@ PyDoc_STRVAR(localeconv__doc__, + static PyObject* + PyLocale_localeconv(PyObject* self) + { ++ #ifndef ANDROID + PyObject* result; + struct lconv *l; + PyObject *x; +@@ -265,6 +268,7 @@ PyLocale_localeconv(PyObject* self) + failed: + Py_XDECREF(result); + Py_XDECREF(x); ++ #endif // ANDROID + return NULL; + } + diff --git a/pythonforandroid/recipes/python2/patches/verbose-compilation.patch b/pythonforandroid/recipes/python2/patches/verbose-compilation.patch index 00c89f9065..d48faab16b 100644 --- a/pythonforandroid/recipes/python2/patches/verbose-compilation.patch +++ b/pythonforandroid/recipes/python2/patches/verbose-compilation.patch @@ -1,13 +1,17 @@ ---- Python-2.7.2/Makefile.pre.in.orig 2012-01-07 18:25:42.097075564 +0100 -+++ Python-2.7.2/Makefile.pre.in 2012-01-07 18:26:03.289074810 +0100 -@@ -410,8 +410,8 @@ - # Build the shared modules - sharedmods: $(BUILDPYTHON) - @case $$MAKEFLAGS in \ -- *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;; \ -+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build -v;; \ -+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build -v;; \ - esac +--- Python-2.7.9/Makefile.pre.in.orig 2016-03-17 11:14:52.005098000 +0100 ++++ Python-2.7.9/Makefile.pre.in 2016-03-17 12:59:54.490618508 +0100 +@@ -470,12 +470,12 @@ + # Under BSD make, MAKEFLAGS might be " -s -v x=y". + sharedmods: $(BUILDPYTHON) pybuilddir.txt + @case "$$MAKEFLAGS" in \ +- *\ -s*|s*) quiet="-q";; \ ++ *\ -s*|s*) quiet="";; \ + *) quiet="";; \ + esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ +- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build ++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build -v # Build static library + # avoid long command lines, same as LIBRARY_OBJS