Skip to content

Commit e0a63f5

Browse files
committed
Inform python's build where is our libffi.pc file
To make sure that python links explicitly with our library Note: This should solve the ctypes error reported by some users caused because python gets built with a wrong libffi library
1 parent 1d4e128 commit e0a63f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pythonforandroid/python.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def add_flags(include_flags, link_dirs, link_libs):
178178
if 'libffi' in self.ctx.recipe_build_order:
179179
info('Activating flags for libffi')
180180
recipe = Recipe.get_recipe('libffi', self.ctx)
181+
# In order to force the correct linkage for our libffi library, we
182+
# set the following variable to point where is our libffi.pc file,
183+
# because the python build system uses pkg-config to configure it.
184+
env['PKG_CONFIG_PATH'] = recipe.get_build_dir(arch.arch)
181185
add_flags(' -I' + ' -I'.join(recipe.get_include_dirs(arch)),
182186
' -L' + join(recipe.get_build_dir(arch.arch), '.libs'),
183187
' -lffi')

0 commit comments

Comments
 (0)