File tree 2 files changed +19
-1
lines changed
pythonforandroid/recipes/gevent 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ import os
1
2
from pythonforandroid .toolchain import CompiledComponentsPythonRecipe
2
3
3
4
@@ -7,4 +8,21 @@ class GeventRecipe(CompiledComponentsPythonRecipe):
7
8
depends = [('python2' , 'python3crystax' ), 'greenlet' ]
8
9
patches = ["gevent.patch" ]
9
10
11
+ def get_recipe_env (self , arch = None , with_flags_in_cc = True ):
12
+ env = super (GeventRecipe , self ).get_recipe_env (arch , with_flags_in_cc )
13
+ # sets linker to use the correct gcc (cross compiler)
14
+ env ['LDSHARED' ] = env ['CC' ] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
15
+ # CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS
16
+ env ['CPPFLAGS' ] = env ['CFLAGS' ] + ' -I{}/sources/python/3.5/include/python/' .format (self .ctx .ndk_dir )
17
+ env ['CFLAGS' ] = ''
18
+ # LDFLAGS may only be used to specify linker flags, for libraries use LIBS
19
+ env ['LDFLAGS' ] = env ['LDFLAGS' ].replace ('-lm' , '' ).replace ('-lcrystax' , '' )
20
+ env ['LDFLAGS' ] += ' -L{}' .format (os .path .join (self .ctx .bootstrap .build_dir , 'libs' , arch .arch ))
21
+ env ['LIBS' ] = ' -lm'
22
+ if self .ctx .ndk == 'crystax' :
23
+ env ['LIBS' ] += ' -lcrystax -lpython{}m' .format (self .ctx .python_recipe .version [0 :3 ])
24
+ env ['LDSHARED' ] += env ['LIBS' ]
25
+ return env
26
+
27
+
10
28
recipe = GeventRecipe ()
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ diff -Naur gevent-1.1.1/setup.py gevent-1.1.1_diff/setup.py
15
15
ares_configure_command = ' '.join(["(cd ", _quoted_abspath('c-ares/'),
16
16
" && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
17
17
- " && /bin/sh ./configure " + _m32 + "CONFIG_COMMANDS= CONFIG_FILES= ",
18
- + " && /bin/sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']) + "CFLAGS= LDFLAGS= CONFIG_COMMANDS= CONFIG_FILES= ",
18
+ + " && /bin/sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']) + "CONFIG_COMMANDS= CONFIG_FILES= ",
19
19
" && cp ares_config.h ares_build.h \"$OLDPWD\" ",
20
20
" && mv ares_build.h.orig ares_build.h)",
21
21
"> configure-output.txt"])
You can’t perform that action at this time.
0 commit comments