@@ -45,32 +45,22 @@ def build_arch(self, arch):
4545 if not exists (path ):
4646 info ("creating {}" .format (path ))
4747 shprint (sh .mkdir , '-p' , path )
48- cli = env ['CC' ].split ()
49- cc = sh .Command (cli [0 ])
48+ cli = env ['CC' ].split ()[0 ]
49+ # makes sure first CC command is the compiler rather than ccache, refs:
50+ # https://github.com/kivy/python-for-android/issues/1399
51+ if 'ccache' in cli :
52+ cli = env ['CC' ].split ()[1 ]
53+ cc = sh .Command (cli )
5054
5155 with current_directory (self .get_build_dir (arch .arch )):
5256 cflags = env ['CFLAGS' ].split ()
53- cflags .extend (['-I.' , '-c' , '-l.' , 'glob.c' , '-I.' ]) # , '-o', 'glob.o'])
57+ cflags .extend (['-I.' , '-c' , '-l.' , 'glob.c' , '-I.' ])
5458 shprint (cc , * cflags , _env = env )
55-
5659 cflags = env ['CFLAGS' ].split ()
57- srindex = cflags .index ('--sysroot' )
58- if srindex :
59- cflags [srindex + 1 ] = self .ctx .ndk_platform
6060 cflags .extend (['-shared' , '-I.' , 'glob.o' , '-o' , 'libglob.so' ])
61+ cflags .extend (env ['LDFLAGS' ].split ())
6162 shprint (cc , * cflags , _env = env )
62-
6363 shprint (sh .cp , 'libglob.so' , join (self .ctx .libs_dir , arch .arch ))
64- shprint (sh .cp , "libglob.so" , join (self .ctx .get_python_install_dir (), 'lib' ))
65- # drop header in to the Python include directory
66- shprint (sh .cp , "glob.h" , join (self .ctx .get_python_install_dir (),
67- 'include/python{}' .format (
68- self .ctx .python_recipe .version [0 :3 ]
69- )
70- )
71- )
72- include_path = join (self .ctx .python_recipe .get_build_dir (arch .arch ), 'Include' )
73- shprint (sh .cp , "glob.h" , include_path )
7464
7565
7666recipe = LibGlobRecipe ()
0 commit comments