@@ -17,6 +17,9 @@ WHEEL_COOKIE = $(WORK_DIR)/.$(COOKIE_PREFIX)wheel_done
1717# # python wheel specific configurations
1818include  ../../mk/spksrc.wheel-env.mk
1919
20+ # # python wheel specific configurations
21+ include  ../../mk/spksrc.crossenv.mk
22+ 
2023# #
2124
2225ifeq  ($(strip  $(PRE_WHEEL_TARGET ) ) ,)
@@ -106,7 +109,7 @@ wheel_msg_target:
106109#  building a wheel for x64-6.2.4 may look successfull while
107110#  it actually used a cache built from x64-7.1
108111# 
109- pre_wheel_target : wheel_msg_target wheeldownload
112+ pre_wheel_target : build-crossenv  wheel_msg_target wheeldownload
110113ifneq  ($(strip  $(WHEELS ) ) ,)
111114	@if [ -n "$(PIP_CACHE_OPT)" ] ; then \
112115	   mkdir -p $(PIP_CACHE_DIR) ; \
@@ -140,25 +143,33 @@ endif
140143build_wheel_target : SHELL:=/bin/bash
141144build_wheel_target : $(PRE_WHEEL_TARGET ) 
142145ifneq  ($(strip  $(WHEELS ) ) ,)
143- 	$(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e)))
146+ # 	$(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e)))
144147	@if [ -s $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) -o -s $(WHEELHOUSE)/$(WHEELS_LIMITED_API) ]; then \
145- 	   $(MSG) "Cross-compiling wheels" ; \
146- 	   crossenvPIP=$(PIP) ; \
147- 	   if [ -s "$(CROSSENV)" ] ; then \
148- 	      crossenvPIP=$$(. $(CROSSENV) && which pip) ; \
149- 	      $(MSG) "Python crossenv found: [$(CROSSENV)]" ; \
150- 	      $(MSG) "pip crossenv found: [$${crossenvPIP}]" ; \
151- 	   elif [ "$(PYTHON_VERSION)" != "2.7" ] ; then \
152- 	      $(MSG) "WARNING: Python crossenv NOT found!" ; \
153- 	      $(MSG) "WARNING: pip crossenv NOT found!" ; \
154- 	   else \
155- 	      $(MSG) "Python $(PYTHON_VERSION) uses pip: $${crossenvPIP}" ; \
156- 	   fi ; \
157148	   while IFS= read -r requirement ; do \
158149	      wheel=$${requirement# *:} ; \ 
159150	      file=$$(basename $${requirement%%:*}) ; \  
160- 	      [ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \  
161151	      [ "$$(grep -s egg <<< $${wheel})" ] && name=$$(echo $${wheel#*egg=} | cut -f1 -d=) || name=$${wheel%%[<>=]=*} ; \  
152+ 	      echo "WHEEL=\"$${wheel}\" $(MAKE) crossenv-$(ARCH)-$(TCVERSION)" ; \  
153+ 	      WHEEL="$${wheel}" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) ; \  
154+ 	      for crossenv in $(WORK_DIR)/crossenv-$${wheel} $(WORK_DIR)/crossenv-$${name} $(WORK_DIR)/crossenv ; do \  
155+ 	         echo "DIR CHECK EN COURS: $${crossenv}" ; \  
156+ 	         echo "ACTIVATE EN COURS: $${crossenv}/build/python-cc.mk" ; \  
157+ 	         [ -d $${crossenv} ] && . $${crossenv}/build/python-cc.mk && break ; \  
158+ 	      done ; \  
159+ 	      crossenvPIP=$(PIP) ; \  
160+ 	      echo "CROSSENV: $${CROSSENV}" ; \  
161+ 	      if [ -s "$${CROSSENV}" ] ; then \  
162+ 	         crossenvPIP=$$(. $${CROSSENV} && which pip) ; \  
163+ 	         $(MSG) "Python crossenv found: [$${CROSSENV}]" ; \  
164+ 	         $(MSG) "pip crossenv found: [$${crossenvPIP}]" ; \  
165+ 	      elif [ "$${PYTHON_VERSION}" != "2.7" ] ; then \  
166+ 	         $(MSG) "WARNING: Python crossenv NOT found!" ; \  
167+ 	         $(MSG) "WARNING: pip crossenv NOT found!" ; \  
168+ 	      else \  
169+ 	         $(MSG) "Python $${PYTHON_VERSION} uses pip: $${crossenvPIP}" ; \  
170+ 	      fi ; \  
171+ 	      $(MSG) "Cross-compiling [$${wheel}] wheel using $${CROSSENV_PATH}" ; \  
172+ 	      [ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \  
162173	      global_options=$$(echo $(WHEELS_BUILD_ARGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs) ; \  
163174	      localCFLAGS=($$(echo $(WHEELS_CFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \  
164175	      localLDFLAGS=($$(echo $(WHEELS_LDFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \  
0 commit comments