lbry-android/p4a/pythonforandroid/recipes/python3/patches/python-3.4.2-cross-compile.patch

79 lines
3.4 KiB
Diff
Raw Normal View History

2017-08-13 03:24:00 +02:00
diff -ru Python-3.3.5/Makefile.pre.in Python-3.3.5-android/Makefile.pre.in
--- Python-3.3.5/Makefile.pre.in 2014-03-09 09:40:23.000000000 +0100
+++ Python-3.3.5-android/Makefile.pre.in 2014-08-04 22:13:00.000000000 +0200
@@ -674,7 +674,7 @@
$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
@$(MKDIR_P) Include
$(MAKE) $(PGEN)
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
$(MAKE) $(GRAMMAR_H)
touch $(GRAMMAR_C)
@@ -1243,6 +1243,7 @@
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
diff -ru Python-3.3.5/configure Python-3.3.5-android/configure
--- Python-3.3.5/configure 2014-03-09 09:40:34.000000000 +0100
+++ Python-3.3.5-android/configure 2014-08-04 22:13:00.000000000 +0200
@@ -2943,13 +2943,18 @@
{ $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 python3 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not sys.version_info[:2] >= (3,3))'; then
- break
- fi
- interp=
- done
+ if test ! -z "$HOSTPYTHON" && PYTHONPATH="$ac_abs_confdir/Lib" "$HOSTPYTHON" -S -c 'import sys;sys.exit(not sys.version_info[:2] >= (3,3))'; then
+ interp="$HOSTPYTHON"
+ else
+ for interp in python$PACKAGE_VERSION python3 python; do
+ which $interp >/dev/null 2>&1 || continue
+ if $interp -c 'import sys;sys.exit(not sys.version_info[:2] >= (3,3))'; then
+ break
+ fi
+ interp=
+ done
+ fi
+
if test x$interp = x; then
as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5
fi
diff -ru Python-3.3.5/configure.ac Python-3.3.5-android/configure.ac
--- Python-3.3.5/configure.ac 2014-03-09 09:40:34.000000000 +0100
+++ Python-3.3.5-android/configure.ac 2014-08-04 22:13:00.000000000 +0200
@@ -56,13 +56,18 @@
if test "$cross_compiling" = yes; then
AC_MSG_CHECKING([for python interpreter for cross build])
if test -z "$PYTHON_FOR_BUILD"; then
- for interp in python$PACKAGE_VERSION python3 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then
- break
- fi
- interp=
- done
+ if test ! -z "$HOSTPYTHON" && PYTHONPATH="$ac_abs_confdir/Lib" "$HOSTPYTHON" -S -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then
+ interp="$HOSTPYTHON"
+ else
+ for interp in python$PACKAGE_VERSION python3 python; do
+ which $interp >/dev/null 2>&1 || continue
+ if $interp -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then
+ break
+ fi
+ interp=
+ done
+ fi
+
if test x$interp = x; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi