diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2012-06-30 18:42:45 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2012-06-30 18:42:45 (GMT) |
commit | 1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1 (patch) | |
tree | 8ea445f4288eaa7db6407625b0c74a22625d3b37 /configure | |
parent | b457b9be4deac2460cb8ac741af6a723d6cb4f88 (diff) | |
download | cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.zip cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.tar.gz cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.tar.bz2 |
- Issue #14330: For cross builds, don't use host python, use host search paths
for host compiler.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -682,6 +682,7 @@ CC EXPORT_MACOSX_DEPLOYMENT_TARGET CONFIGURE_MACOSX_DEPLOYMENT_TARGET SGI_ABI +_PYTHON_HOST_PLATFORM MACHDEP FRAMEWORKINSTALLAPPSPREFIX FRAMEWORKUNIXTOOLSPREFIX @@ -700,6 +701,7 @@ UNIVERSALSDK CONFIG_ARGS SOVERSION VERSION +PYTHON_FOR_BUILD host_os host_vendor host_cpu @@ -2880,6 +2882,29 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +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 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 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="_PROJECT_BASE=$srcdir"' _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp + fi +else + PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' +fi + + if test "$prefix" != "/"; then prefix=`echo "$prefix" | sed -e 's/\/$//g'` @@ -3218,6 +3243,29 @@ then esac fi + +if test "$cross_compiling" = yes; then + case "$host" in + *-*-linux*) + case "$host_cpu" in + arm*) + _host_cpu=arm + ;; + *) + _host_cpu=$host_cpu + esac + ;; + *-*-cygwin*) + _host_cpu= + ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" + as_fn_error $? "cross build not supported for $host" "$LINENO" 5 + esac + _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" +fi + # Some systems cannot stand _XOPEN_SOURCE being defined at all; they # disable features if it is defined, without any means to access these # features as extensions. For these systems, we skip the definition of @@ -5540,6 +5588,10 @@ else # shared is disabled esac fi +if test "$cross_compiling" = yes; then + RUNSHARED= +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 $as_echo "$LDLIBRARY" >&6; } |