@@ -89,7 +89,8 @@ def _init_posix():
89
89
g ['EXT_SUFFIX' ] = "." + so_abi + so_ext
90
90
g ['SHLIB_SUFFIX' ] = so_ext
91
91
g ['SO' ] = "." + so_abi + so_ext # deprecated in Python 3, for backward compatibility
92
- g ['AR' ] = "ar"
92
+ g ['AR' ] = sys .__graal_get_toolchain_path ('AR' )
93
+ g ['RANLIB' ] = sys .__graal_get_toolchain_path ('RANLIB' )
93
94
g ['ARFLAGS' ] = "rc"
94
95
g ['EXE' ] = ""
95
96
g ['LIBDIR' ] = os .path .join (sys .prefix , 'lib' )
@@ -171,9 +172,11 @@ def customize_compiler(compiler):
171
172
_osx_support .customize_compiler (_config_vars )
172
173
_config_vars ['CUSTOMIZED_OSX_COMPILER' ] = 'True'
173
174
174
- (cc , cxx , opt , cflags , ccshared , ldshared , shlib_suffix , ar , ar_flags ) = \
175
+ # TRUFFLE CHANGE BEGIN: added 'ranlib'
176
+ (cc , cxx , opt , cflags , ccshared , ldshared , shlib_suffix , ar , ar_flags , ranlib ) = \
175
177
get_config_vars ('CC' , 'CXX' , 'OPT' , 'CFLAGS' ,
176
- 'CCSHARED' , 'LDSHARED' , 'SHLIB_SUFFIX' , 'AR' , 'ARFLAGS' )
178
+ 'CCSHARED' , 'LDSHARED' , 'SHLIB_SUFFIX' , 'AR' , 'ARFLAGS' , 'RANLIB' )
179
+ # TRUFFLE CHANGE END
177
180
178
181
if 'CC' in os .environ :
179
182
newcc = os .environ ['CC' ]
@@ -207,6 +210,13 @@ def customize_compiler(compiler):
207
210
archiver = ar + ' ' + os .environ ['ARFLAGS' ]
208
211
else :
209
212
archiver = ar + ' ' + ar_flags
213
+ # TRUFFLE CHANGE BEGIN: added 'ranlib'
214
+ if compiler .executables ['ranlib' ]:
215
+ if 'RANLIB' in os .environ :
216
+ ranlib = os .environ ['RANLIB' ]
217
+ else :
218
+ ranlib = None
219
+ # TRUFFLE CHANGE END
210
220
211
221
cc_cmd = cc + ' ' + cflags
212
222
compiler .set_executables (
@@ -216,6 +226,11 @@ def customize_compiler(compiler):
216
226
compiler_cxx = cxx ,
217
227
linker_so = ldshared ,
218
228
linker_exe = cc ,
219
- archiver = archiver )
229
+ archiver = archiver ,
230
+ # TRUFFLE CHANGE BEGIN: added 'ranlib'
231
+ # Note: it will only be !=None if compiler already had a default indicating that it needs ranlib
232
+ ranlib = ranlib
233
+ # TRUFFLE CHANGE END
234
+ )
220
235
221
236
compiler .shared_lib_extension = shlib_suffix
0 commit comments