@@ -762,11 +762,6 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
762
762
env ['PYTHONPATH' ] = ':' .join (hppath + [env ['PYTHONPATH' ]])
763
763
else :
764
764
env ['PYTHONPATH' ] = ':' .join (hppath )
765
- if 'python2' in self .ctx .recipe_build_order :
766
- env ['PYTHON_ROOT' ] = self .ctx .get_python_install_dir ()
767
- env ['CFLAGS' ] += ' -I' + env ['PYTHON_ROOT' ] + '/include/python2.7'
768
- env ['LDFLAGS' ] += ' -L' + env ['PYTHON_ROOT' ] + '/lib' + \
769
- ' -lpython2.7'
770
765
return env
771
766
772
767
def should_build (self , arch ):
@@ -864,6 +859,17 @@ class CompiledComponentsPythonRecipe(PythonRecipe):
864
859
865
860
build_cmd = 'build_ext'
866
861
862
+ def get_recipe_env (self , arch = None , with_flags_in_cc = True ):
863
+ env = super (CompiledComponentsPythonRecipe ,
864
+ self ).get_recipe_env (arch , with_flags_in_cc )
865
+ if not self .call_hostpython_via_targetpython :
866
+ if 'python2' in self .ctx .recipe_build_order :
867
+ env ['PYTHON_ROOT' ] = self .ctx .get_python_install_dir ()
868
+ env ['CFLAGS' ] += ' -I' + env ['PYTHON_ROOT' ] + '/include/python2.7'
869
+ env ['LDFLAGS' ] += ' -L' + env ['PYTHON_ROOT' ] + '/lib' + \
870
+ ' -lpython2.7'
871
+ return env
872
+
867
873
def build_arch (self , arch ):
868
874
'''Build any cython components, then install the Python module by
869
875
calling setup.py install with the target Python dir.
0 commit comments