summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2014-02-22 14:45:37 -0800
committerDwayne Litzenberger <dlitz@dlitz.net>2014-02-22 14:48:25 -0800
commitc007f6e77336a9c7cc3f6cf7340895782bb67235 (patch)
tree1a9ed0bcf5c60252dbf2ed4e2d6204cbafa1ba66
parentaa8bb89a2006d930082f5b88bfa8ee574e4d82b4 (diff)
downloadpycrypto-c007f6e77336a9c7cc3f6cf7340895782bb67235.tar.gz
Fix tools/create-pythons.sh building Python on Linux 3.x or later (sys.platform should be "linux2", not "linux3")
-rwxr-xr-xtools/create-pythons.sh39
1 files changed, 39 insertions, 0 deletions
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