Browse Source

python, python3: unify HOST_ vars and get rid of HOST_CFLAGS

--sysconfigdir and --sbindir are obtained from --prefix
and --exec-prefix, so no need to have them explicitly

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lilik-openwrt-22.03
Alexandru Ardelean 8 years ago
parent
commit
9eca45fdf1
4 changed files with 23 additions and 28 deletions
  1. +10
    -13
      lang/python/Makefile
  2. +2
    -2
      lang/python/files/python-host.mk
  3. +8
    -11
      lang/python3/Makefile
  4. +3
    -2
      lang/python3/files/python3-package.mk

+ 10
- 13
lang/python/Makefile View File

@ -151,13 +151,13 @@ define Build/InstallDev
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
$(CP) \
$(HOST_BUILD_PREFIX)/lib/python$(PYTHON_VERSION) \
$(HOST_PYTHON_LIB_DIR) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(1)/usr/lib/
$(CP) \
$(HOST_BUILD_PREFIX)/lib/pkgconfig/python.pc \
$(HOST_BUILD_PREFIX)/lib/pkgconfig/python2.pc \
$(HOST_BUILD_PREFIX)/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
$(HOST_PYTHON_DIR)/lib/pkgconfig/python.pc \
$(HOST_PYTHON_DIR)/lib/pkgconfig/python2.pc \
$(HOST_PYTHON_DIR)/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
$(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
@ -224,20 +224,17 @@ HOST_CONFIGURE_ARGS+= \
--without-cxx-main \
--without-pymalloc \
--with-threads \
--prefix=$(HOST_BUILD_PREFIX) \
--exec-prefix=$(HOST_BUILD_PREFIX) \
--sysconfdir=$(HOST_BUILD_PREFIX)/etc \
--localstatedir=$(HOST_BUILD_PREFIX)/var \
--sbindir=$(HOST_BUILD_PREFIX)/bin \
--with-system-expat=$(HOST_BUILD_PREFIX) \
--with-system-ffi=$(HOST_BUILD_PREFIX) \
--prefix=$(HOST_PYTHON_DIR) \
--exec-prefix=$(HOST_PYTHON_DIR) \
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi=$(STAGING_DIR_HOSTPKG) \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
$(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_BUILD_PREFIX)/bin/pgen2
$(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON_DIR)/bin/pgen2
endef
$(eval $(call HostBuild))


+ 2
- 2
lang/python/files/python-host.mk View File

@ -21,11 +21,11 @@ HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
HOST_PYTHON_PKG_DIR:=/lib/python$(PYTHON_VERSION)/site-packages
HOST_PYTHON_PKG_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)/site-packages
HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOSTPKG)/$(HOST_PYTHON_PKG_DIR)
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_PYTHON_PKG_DIR)
define HostPython
if [ "$(strip $(3))" == "HOST" ]; then \


+ 8
- 11
lang/python3/Makefile View File

@ -146,7 +146,7 @@ define Build/InstallDev
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
$(CP) \
$(HOST_BUILD_PREFIX)/lib/python$(PYTHON_VERSION) \
$(HOST_PYTHON3_LIB_DIR) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(1)/usr/lib/
$(CP) \
@ -212,13 +212,10 @@ HOST_CONFIGURE_ARGS+= \
--without-cxx-main \
--without-pymalloc \
--with-threads \
--prefix=$(HOST_BUILD_PREFIX) \
--exec-prefix=$(HOST_BUILD_PREFIX) \
--sysconfdir=$(HOST_BUILD_PREFIX)/etc \
--localstatedir=$(HOST_BUILD_PREFIX)/var \
--sbindir=$(HOST_BUILD_PREFIX)/bin \
--with-system-expat=$(HOST_BUILD_PREFIX) \
--with-system-ffi=$(HOST_BUILD_PREFIX) \
--prefix=$(HOST_PYTHON3_DIR) \
--exec-prefix=$(HOST_PYTHON3_DIR) \
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi=$(STAGING_DIR_HOSTPKG) \
--with-ensurepip=no \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"
@ -231,9 +228,9 @@ endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
$(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_BUILD_PREFIX)/bin/pgen3
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_BUILD_PREFIX)/bin/_freeze_importlib
$(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_PYTHON3_DIR)/bin/_freeze_importlib
endef
$(eval $(call HostBuild))


+ 3
- 2
lang/python3/files/python3-package.mk View File

@ -26,8 +26,9 @@ PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
PYTHON3:=python$(PYTHON3_VERSION)
HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOSTPKG)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(STAGING_DIR_HOSTPKG)/bin/python3
HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python3
PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
define HostPython3


Loading…
Cancel
Save