File tree Expand file tree Collapse file tree
pythonforandroid/recipes/gevent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
12from pythonforandroid .toolchain import CompiledComponentsPythonRecipe
23
34
@@ -7,4 +8,21 @@ class GeventRecipe(CompiledComponentsPythonRecipe):
78 depends = [('python2' , 'python3crystax' ), 'greenlet' ]
89 patches = ["gevent.patch" ]
910
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+
1028recipe = 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
1515 ares_configure_command = ' '.join(["(cd ", _quoted_abspath('c-ares/'),
1616 " && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
1717- " && /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= ",
1919 " && cp ares_config.h ares_build.h \"$OLDPWD\" ",
2020 " && mv ares_build.h.orig ares_build.h)",
2121 "> configure-output.txt"])
You can’t perform that action at this time.
0 commit comments