Skip to content

Commit c3532d4

Browse files
author
Pol Canelles
committed
Sets the right include and link paths for python2
1 parent 52f2478 commit c3532d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pythonforandroid/recipe.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,11 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
762762
env['PYTHONPATH'] = ':'.join(hppath + [env['PYTHONPATH']])
763763
else:
764764
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'
765770
return env
766771

767772
def should_build(self, arch):
@@ -1049,4 +1054,4 @@ def prebuild_arch(self, arch):
10491054
# @ctx.setter
10501055
# def ctx(self, ctx):
10511056
# self._ctx = ctx
1052-
# ctx.python_recipe = self
1057+
# ctx.python_recipe = self

0 commit comments

Comments
 (0)