@ -22,23 +22,7 @@ HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
HOST_PYTHON3PATH := $( HOST_PYTHON3_LIB_DIR) :$( HOST_PYTHON3_PKG_DIR)
HOST_PYTHON3PATH := $( HOST_PYTHON3_LIB_DIR) :$( HOST_PYTHON3_PKG_DIR)
d e f i n e H o s t P y t h o n 3
if [ " $( strip $( 3) ) " = = "HOST" ] ; then \
export PYTHONPATH = " $( HOST_PYTHON3PATH) " ; \
export PYTHONDONTWRITEBYTECODE = 0; \
else \
export PYTHONPATH = " $( PYTHON3PATH) " ; \
export PYTHONDONTWRITEBYTECODE = 1; \
export _python_sysroot = " $( STAGING_DIR) " ; \
export _python_prefix = "/usr" ; \
export _python_exec_prefix = "/usr" ; \
fi ; \
export PYTHONOPTIMIZE = "" ; \
$( 1) \
$( HOST_PYTHON3_BIN) $( 2) ;
e n d e f
d e f i n e h o s t _ p y t h o n 3 _ s e t t i n g s
HOST_PYTHON3_VARS = \
ARCH = " $( HOST_ARCH) " \
ARCH = " $( HOST_ARCH) " \
CC = " $( HOSTCC) " \
CC = " $( HOSTCC) " \
CCSHARED = " $( HOSTCC) $( HOST_FPIC) " \
CCSHARED = " $( HOSTCC) $( HOST_FPIC) " \
@ -48,22 +32,19 @@ define host_python3_settings
CFLAGS = " $( HOST_CFLAGS) " \
CFLAGS = " $( HOST_CFLAGS) " \
CPPFLAGS = " $( HOST_CPPFLAGS) -I $( HOST_PYTHON3_INC_DIR) " \
CPPFLAGS = " $( HOST_CPPFLAGS) -I $( HOST_PYTHON3_INC_DIR) " \
LDFLAGS = " $( HOST_LDFLAGS) -lpython $( PYTHON3_VERSION) -Wl $( comma) -rpath= $( STAGING_DIR_HOSTPKG) /lib " \
LDFLAGS = " $( HOST_LDFLAGS) -lpython $( PYTHON3_VERSION) -Wl $( comma) -rpath= $( STAGING_DIR_HOSTPKG) /lib " \
_PYTHON_HOST_PLATFORM = linux2
e n d e f
_PYTHON_HOST_PLATFORM = linux2 \
PYTHONPATH = " $( HOST_PYTHON3PATH) " \
PYTHONDONTWRITEBYTECODE = 0 \
PYTHONOPTIMIZE = ""
# $(1) => commands to execute before running pythons script
# $(1) => directory of python script
# $(2) => python script and its arguments
# $(2) => python script and its arguments
# $(3) => additional variables
# $(3) => additional variables
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 R u n H o s t
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 R u n H o s t
$( call HostPython3, \
$( if $( 1) ,$( 1) ; ) \
$( call host_python3_settings) \
$( 3) \
, \
$( 2) \
, \
HOST \
)
cd " $( if $( strip $( 1) ) ,$( strip $( 1) ) ,.) " && \
$( HOST_PYTHON3_VARS) \
$( 3) \
$( HOST_PYTHON3_BIN) $( 2)
e n d e f
e n d e f
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
@ -71,7 +52,7 @@ HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
# $(1) => packages to install
# $(1) => packages to install
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 P i p I n s t a l l
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 P i p I n s t a l l
$( call host_python3_settings ) \
$( HOST_PYTHON3_VARS ) \
$( HOST_PYTHON3_PIP) \
$( HOST_PYTHON3_PIP) \
--disable-pip-version-check \
--disable-pip-version-check \
--cache-dir " $( DL_DIR) /pip-cache " \
--cache-dir " $( DL_DIR) /pip-cache " \
@ -84,7 +65,7 @@ endef
# $(3) => additional variables
# $(3) => additional variables
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 M o d
d e f i n e B u i l d / C o m p i l e / H o s t P y 3 M o d
$( call Build/Compile/HostPy3RunHost, \
$( call Build/Compile/HostPy3RunHost, \
cd $( HOST_BUILD_DIR) /$( strip $( 1) ) , \
./ setup.py $( 2) , \
$( HOST_BUILD_DIR) /$( strip $( 1) ) , \
setup.py $( 2) , \
$( 3) )
$( 3) )
e n d e f
e n d e f