python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(python3_mk_path)python3-version.mk
+# Unset environment variables
+
+# https://docs.python.org/3/using/cmdline.html#environment-variables
+unexport \
+ PYTHONHOME \
+ PYTHONPATH \
+ PYTHONSAFEPATH \
+ PYTHONPLATLIBDIR \
+ PYTHONSTARTUP \
+ PYTHONOPTIMIZE \
+ PYTHONBREAKPOINT \
+ PYTHONDEBUG \
+ PYTHONINSPECT \
+ PYTHONUNBUFFERED \
+ PYTHONVERBOSE \
+ PYTHONCASEOK \
+ PYTHONDONTWRITEBYTECODE \
+ PYTHONPYCACHEPREFIX \
+ PYTHONHASHSEED \
+ PYTHONINTMAXSTRDIGITS \
+ PYTHONIOENCODING \
+ PYTHONNOUSERSITE \
+ PYTHONUSERBASE \
+ PYTHONEXECUTABLE \
+ PYTHONWARNINGS \
+ PYTHONFAULTHANDLER \
+ PYTHONTRACEMALLOC \
+ PYTHONPROFILEIMPORTTIME \
+ PYTHONASYNCIODEBUG \
+ PYTHONMALLOC \
+ PYTHONMALLOCSTATS \
+ PYTHONLEGACYWINDOWSFSENCODING \
+ PYTHONLEGACYWINDOWSSTDIO \
+ PYTHONCOERCECLOCALE \
+ PYTHONDEVMODE \
+ PYTHONUTF8 \
+ PYTHONWARNDEFAULTENCODING \
+ PYTHONNODEBUGRANGES
+
+# https://docs.python.org/3/using/cmdline.html#debug-mode-variables
+unexport \
+ PYTHONTHREADDEBUG \
+ PYTHONDUMPREFS \
+ PYTHONDUMPREFSFILE
+
HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
LDSHARED="$(HOSTCC) -shared" \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib" \
- PYTHONPATH="$(HOST_PYTHON3PATH)" \
- PYTHONDONTWRITEBYTECODE=0 \
- PYTHONOPTIMIZE=""
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib"
# $(1) => directory of python script
# $(2) => python script and its arguments
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
PYTHONPATH="$(PYTHON3PATH)" \
PYTHONDONTWRITEBYTECODE=1 \
- PYTHONOPTIMIZE="" \
_python_sysroot="$(STAGING_DIR)" \
_python_prefix="/usr" \
_python_exec_prefix="/usr"