File tree 1 file changed +13
-5
lines changed
pythonforandroid/recipes/netifaces
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change
1
+ import os
1
2
from pythonforandroid .recipe import CompiledComponentsPythonRecipe
2
3
3
-
4
4
class NetifacesRecipe (CompiledComponentsPythonRecipe ):
5
5
6
6
version = '0.10.4'
@@ -16,11 +16,19 @@ class NetifacesRecipe(CompiledComponentsPythonRecipe):
16
16
def get_recipe_env (self , arch ):
17
17
env = super (NetifacesRecipe , self ).get_recipe_env (arch )
18
18
env ['PYTHON_ROOT' ] = self .ctx .get_python_install_dir ()
19
- env ['CFLAGS' ] += ' -I' + env ['PYTHON_ROOT' ] + '/include/python2.7'
20
- # Set linker to use the correct gcc
19
+ env ['CFLAGS' ] += ' -I{}' .format (self .ctx .python_recipe .include_root (arch .arch ))
21
20
env ['LDSHARED' ] = env ['CC' ] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
22
- env ['LDFLAGS' ] += ' -L' + env ['PYTHON_ROOT' ] + '/lib' + \
23
- ' -lpython2.7'
21
+
22
+ # required for libc and libdl
23
+ ndk_dir = self .ctx .ndk_platform
24
+ ndk_lib_dir = os .path .join (ndk_dir , 'usr' , 'lib' )
25
+ env ['LDFLAGS' ] += ' -L{}' .format (ndk_lib_dir )
26
+ env ['LDFLAGS' ] += ' -L{}' .format (self .ctx .python_recipe .link_root (arch .arch ))
27
+ env ['LDFLAGS' ] += ' -lpython{}' .format (self .ctx .python_recipe .major_minor_version_string )
28
+ if 'python3' in self .ctx .python_recipe .name :
29
+ env ['LDFLAGS' ] += 'm'
30
+ # XX very very bad, but in their setup, conftest doesn't use LDFLAGS?
31
+ env ['CC' ] += env ['LDFLAGS' ]
24
32
return env
25
33
26
34
You can’t perform that action at this time.
0 commit comments