diff options
| author | Jeffery To <jeffery.to@gmail.com> | 2019-05-29 22:03:18 +0800 |
|---|---|---|
| committer | Jeffery To <jeffery.to@gmail.com> | 2019-05-29 22:03:18 +0800 |
| commit | 87a31e49f77ea252e454eeb780fee8342119bab0 (patch) | |
| tree | e655524634f84fe5966ff6d27ee5cf13c6798307 /lang/python | |
| parent | ae80ddc7ab1486a2e4788a8bd4b9c1643ce29c29 (diff) | |
python,python3: Disable user site-packages for host Python
Normally, Python will include the user's site-packages directory
(~/.local/lib/python$(PYTHON_VERSION)/site-packages) in it's internal
search path for modules.
This disables this default inclusion for host Python.
This change is applied during Host/Configure instead of as a patch to
keep this setting unchanged for target Python.
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python')
| -rw-r--r-- | lang/python/python/Makefile | 5 | ||||
| -rw-r--r-- | lang/python/python3/Makefile | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 979ccc771..c59e6a940 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -298,6 +298,11 @@ HOST_CONFIGURE_ARGS+= \ --with-ensurepip=install \ CONFIG_SITE= +define Host/Configure + $(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py + $(call Host/Configure/Default) +endef + define Host/Compile $(call Host/Compile/Default,python Parser/pgen sharedmods) endef diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index d151459ed..d2aea17f6 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -292,6 +292,11 @@ HOST_CONFIGURE_ARGS+= \ --with-ensurepip=install \ CONFIG_SITE= +define Host/Configure + $(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py + $(call Host/Configure/Default) +endef + define Host/Compile +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods |
