@@ -162,10 +162,24 @@ class GuestPythonRecipe(TargetPythonRecipe):
162
162
'''The file extensions from site packages dir that we don't want to be
163
163
included in our python bundle.'''
164
164
165
+ opt_depends = ['sqlite3' ]
166
+ '''The optional libraries which we would like to get our python linked'''
167
+
165
168
def __init__ (self , * args , ** kwargs ):
166
169
self ._ctx = None
167
170
super (GuestPythonRecipe , self ).__init__ (* args , ** kwargs )
168
171
172
+ def set_libs_flags (self , env , arch ):
173
+ '''Takes care to properly link libraries with python depending on our
174
+ requirements and the attribute :attr:`opt_depends`.
175
+ '''
176
+ if 'sqlite3' in self .ctx .recipe_build_order :
177
+ info ('Activating flags for sqlite3' )
178
+ recipe = Recipe .get_recipe ('sqlite3' , self .ctx )
179
+ env ['CPPFLAGS' ] = env .get ('CPPFLAGS' , '' ) + recipe .get_build_dir (arch .arch )
180
+ env ['LDFLAGS' ] = env .get ('LDFLAGS' , '' ) + recipe .get_lib_dir (arch ) + ' -lsqlite3'
181
+ return env
182
+
169
183
def get_recipe_env (self , arch = None , with_flags_in_cc = True ):
170
184
if self .from_crystax :
171
185
return \
@@ -321,6 +335,7 @@ def build_arch(self, arch):
321
335
322
336
with current_directory (build_dir ):
323
337
env = self .get_recipe_env (arch )
338
+ env = self .set_libs_flags (env , arch )
324
339
325
340
android_build = sh .Command (
326
341
join (recipe_build_dir ,
0 commit comments