From c007f6e77336a9c7cc3f6cf7340895782bb67235 Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Sat, 22 Feb 2014 14:45:37 -0800 Subject: Fix tools/create-pythons.sh building Python on Linux 3.x or later (sys.platform should be "linux2", not "linux3") --- tools/create-pythons.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tools/create-pythons.sh b/tools/create-pythons.sh index 82475cc..52c7fe9 100755 --- a/tools/create-pythons.sh +++ b/tools/create-pythons.sh @@ -36,6 +36,35 @@ patch -p1 <<'EOF' EOF } +apply_plat_linux3_patch() { +patch -p1 <<'EOF' +diff -ru Python-2.2.3.orig/configure Python-2.2.3/configure +--- Python-2.2.3.orig/configure 2003-03-29 14:25:14.000000000 -0800 ++++ Python-2.2.3/configure 2014-02-22 14:37:36.540457776 -0800 +@@ -641,6 +641,8 @@ + MACHDEP="$ac_md_system$ac_md_release" + + case $MACHDEP in ++ linux1) MACHDEP="linux1";; ++ linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + '') MACHDEP="unknown";; +diff -ru Python-2.2.3.orig/configure.in Python-2.2.3/configure.in +--- Python-2.2.3.orig/configure.in 2003-03-29 14:25:17.000000000 -0800 ++++ Python-2.2.3/configure.in 2014-02-22 14:37:29.668562217 -0800 +@@ -68,6 +68,8 @@ + MACHDEP="$ac_md_system$ac_md_release" + + case $MACHDEP in ++ linux1) MACHDEP="linux1";; ++ linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + '') MACHDEP="unknown";; +EOF +} + PREFIX=${PREFIX:-$(dirname "$(readlink -f "$0")")/py} CONCURRENCY_LEVEL=${CONCURRENCY_LEVEL:-5} @@ -178,6 +207,16 @@ do touch .multiarch-hack.applied export EXTRA_LIBDIR=/usr/lib/`gcc -print-multiarch` fi + if ! [ -e .plat-linux3.applied ] ; then + # sys.platform should return "linux2" on Linux, even if the system + # was compiled on Linux 3.x or later. + case "$dir" in + Python-2.[23456]*) + apply_plat_linux3_patch + touch .plat-linux3.applied + ;; + esac + fi # Set some special configure parameters if [ `uname -m` = "x86_64" ] && [ "$name" = "python2.3" ] ; then -- cgit v1.2.1