@@ -931,8 +931,9 @@ PKG_CONFIG
931931CONFIG_ARGS
932932SOVERSION
933933VERSION
934- PYTHON_FOR_BUILD
935934PYTHON_FOR_REGEN
935+ PYTHON_FOR_BUILD
936+ FREEZE_MODULE
936937host_os
937938host_vendor
938939host_cpu
@@ -988,6 +989,8 @@ SHELL'
988989ac_subst_files=''
989990ac_user_opts='
990991enable_option_checking
992+ with_freeze_module
993+ with_build_python
991994with_pkg_config
992995enable_universalsdk
993996with_universal_archs
@@ -1721,6 +1724,11 @@ Optional Features:
17211724Optional Packages:
17221725 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
17231726 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1727+ --with-freeze-module=Programs/_freeze_module
1728+ path to _freeze_module binary for cross compiling
1729+ --with-build-python=python3.11
1730+ path to build python binary for cross compiling
1731+ (default: python3.11)
17241732 --with-pkg-config=[yes|no|check]
17251733 use pkg-config to detect build options (default is
17261734 check)
@@ -3177,9 +3185,88 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
31773185
31783186
31793187
3188+ if test "x$cross_compiling" = xmaybe; then :
3189+ as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
3190+
3191+ fi
3192+
31803193# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
31813194rm -f pybuilddir.txt
31823195
3196+
3197+ # Check whether --with-freeze-module was given.
3198+ if test "${with_freeze_module+set}" = set; then :
3199+ withval=$with_freeze_module;
3200+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-freeze-module" >&5
3201+ $as_echo_n "checking for --with-freeze-module... " >&6; }
3202+ if test "x$cross_compiling" = xno; then :
3203+ as_fn_error $? "--with-freeze-module only applies to cross compiling" "$LINENO" 5
3204+ fi
3205+ if test "$with_freeze_module" = yes -o "$with_freeze_module" = no; then
3206+ as_fn_error $? "invalid --with-freeze-module option: expected path, not \"$with_freeze_module\"" "$LINENO" 5
3207+ fi
3208+ if ! $(command -v "$with_freeze_module" >/dev/null 2>&1); then
3209+ as_fn_error $? "invalid or missing freeze module binary \"$with_freeze_module\"" "$LINENO" 5
3210+ fi
3211+ FREEZE_MODULE="$with_freeze_module"
3212+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREEZE_MODULE" >&5
3213+ $as_echo "$FREEZE_MODULE" >&6; }
3214+
3215+ else
3216+
3217+ if test "x$cross_compiling" = xyes; then :
3218+ as_fn_error $? "Cross compiling requires --with-freeze-module" "$LINENO" 5
3219+
3220+ fi
3221+ FREEZE_MODULE=Programs/_freeze_module
3222+
3223+
3224+ fi
3225+
3226+
3227+
3228+
3229+ # Check whether --with-build-python was given.
3230+ if test "${with_build_python+set}" = set; then :
3231+ withval=$with_build_python;
3232+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-build-python" >&5
3233+ $as_echo_n "checking for --with-build-python... " >&6; }
3234+
3235+ if test "x$cross_compiling" = xno; then :
3236+ as_fn_error $? "--with-build-python only applies to cross compiling" "$LINENO" 5
3237+ fi
3238+ if test "x$with_build_python" = xyes; then :
3239+ with_build_python=python$PACKAGE_VERSION
3240+ fi
3241+ if test "x$with_build_python" = xno; then :
3242+ as_fn_error $? "invalid --with-build-python option: expected path, not \"no\"" "$LINENO" 5
3243+ fi
3244+
3245+ if ! $(command -v "$with_build_python" >/dev/null 2>&1); then
3246+ as_fn_error $? "invalid or missing build python binary \"$with_build_python\"" "$LINENO" 5
3247+ fi
3248+ build_python_ver=$($with_build_python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
3249+ if test "$build_python_ver" != "$PACKAGE_VERSION"; then
3250+ as_fn_error $? "\"$with_build_python\" has incompatible version $build_python_ver (expected: $PACKAGE_VERSION)" "$LINENO" 5
3251+ fi
3252+ ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
3253+ 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 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
3254+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5
3255+ $as_echo "$with_build_python" >&6; }
3256+
3257+ else
3258+
3259+ if test "x$cross_compiling" = xyes; then :
3260+ as_fn_error $? "Cross compiling requires --with-build-python" "$LINENO" 5
3261+
3262+ fi
3263+ PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
3264+
3265+
3266+ fi
3267+
3268+
3269+
31833270for ac_prog in python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python
31843271do
31853272 # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3235,31 +3322,6 @@ else
32353322$as_echo "missing" >&6; }
32363323fi
32373324
3238- if test "$cross_compiling" = yes; then
3239- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
3240- $as_echo_n "checking for python interpreter for cross build... " >&6; }
3241- if test -z "$PYTHON_FOR_BUILD"; then
3242- for interp in python$PACKAGE_VERSION python3 python; do
3243- which $interp >/dev/null 2>&1 || continue
3244- if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info[:2]) == '$PACKAGE_VERSION')"; then
3245- break
3246- fi
3247- interp=
3248- done
3249- if test x$interp = x; then
3250- as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5
3251- fi
3252- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
3253- $as_echo "$interp" >&6; }
3254- 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 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp
3255- fi
3256- elif test "$cross_compiling" = maybe; then
3257- as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
3258- else
3259- PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
3260- fi
3261-
3262-
32633325
32643326if test "$prefix" != "/"; then
32653327 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
0 commit comments