@@ -30,7 +30,7 @@ def include_dirs(self):
3030 d .format (arch = self ))
3131 for d in self .ctx .include_dirs ]
3232
33- def get_env (self ):
33+ def get_env (self , with_flags_in_cc = True ):
3434 env = {}
3535
3636 env ["CFLAGS" ] = " " .join ([
@@ -72,14 +72,22 @@ def get_env(self):
7272 'installed. Exiting.' )
7373 exit (1 )
7474
75- env ['CC' ] = '{ccache}{command_prefix}-gcc {cflags}' .format (
76- command_prefix = command_prefix ,
77- ccache = ccache ,
78- cflags = env ['CFLAGS' ])
79- env ['CXX' ] = '{ccache}{command_prefix}-g++ {cxxflags}' .format (
80- command_prefix = command_prefix ,
81- ccache = ccache ,
82- cxxflags = env ['CXXFLAGS' ])
75+ if with_flags_in_cc :
76+ env ['CC' ] = '{ccache}{command_prefix}-gcc {cflags}' .format (
77+ command_prefix = command_prefix ,
78+ ccache = ccache ,
79+ cflags = env ['CFLAGS' ])
80+ env ['CXX' ] = '{ccache}{command_prefix}-g++ {cxxflags}' .format (
81+ command_prefix = command_prefix ,
82+ ccache = ccache ,
83+ cxxflags = env ['CXXFLAGS' ])
84+ else :
85+ env ['CC' ] = '{ccache}{command_prefix}-gcc' .format (
86+ command_prefix = command_prefix ,
87+ ccache = ccache )
88+ env ['CXX' ] = '{ccache}{command_prefix}-g++' .format (
89+ command_prefix = command_prefix ,
90+ ccache = ccache )
8391
8492 env ['AR' ] = '{}-ar' .format (command_prefix )
8593 env ['RANLIB' ] = '{}-ranlib' .format (command_prefix )
@@ -118,8 +126,8 @@ class ArchARM(Arch):
118126class ArchARMv7_a (ArchARM ):
119127 arch = 'armeabi-v7a'
120128
121- def get_env (self ):
122- env = super (ArchARMv7_a , self ).get_env ()
129+ def get_env (self , with_flags_in_cc = True ):
130+ env = super (ArchARMv7_a , self ).get_env (with_flags_in_cc )
123131 env ['CFLAGS' ] = (env ['CFLAGS' ] +
124132 (' -march=armv7-a -mfloat-abi=softfp '
125133 '-mfpu=vfp -mthumb' ))
@@ -133,8 +141,8 @@ class Archx86(Arch):
133141 command_prefix = 'i686-linux-android'
134142 platform_dir = 'arch-x86'
135143
136- def get_env (self ):
137- env = super (Archx86 , self ).get_env ()
144+ def get_env (self , with_flags_in_cc = True ):
145+ env = super (Archx86 , self ).get_env (with_flags_in_cc )
138146 env ['CFLAGS' ] = (env ['CFLAGS' ] +
139147 ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32' )
140148 env ['CXXFLAGS' ] = env ['CFLAGS' ]
@@ -147,8 +155,8 @@ class Archx86_64(Arch):
147155 command_prefix = 'x86_64-linux-android'
148156 platform_dir = 'arch-x86'
149157
150- def get_env (self ):
151- env = super (Archx86_64 , self ).get_env ()
158+ def get_env (self , with_flags_in_cc = True ):
159+ env = super (Archx86_64 , self ).get_env (with_flags_in_cc )
152160 env ['CFLAGS' ] = (env ['CFLAGS' ] +
153161 ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel' )
154162 env ['CXXFLAGS' ] = env ['CFLAGS' ]
0 commit comments