* revert: advanced getBInutilsInfo function
* TODO: incorporate the CC=mycc config. thing into this stuff * fix: get rid of mutual module import silliness (my bad) * make beta-light run on non-gentoo systems again.
This commit is contained in:
+23
-2
@@ -89,8 +89,29 @@ def defaultprefixDIR():
|
||||
|
||||
# Binutils Variables
|
||||
|
||||
def getBinutilsInfo(needed):
|
||||
return '%s-%s' % (HOST(), needed)
|
||||
def exists_binary(bin):
|
||||
# determine if path has binary
|
||||
path = os.environ['PATH'].split(':')
|
||||
for directory in path:
|
||||
if os.path.exists(os.path.join(directory, bin) ):
|
||||
return True
|
||||
return False
|
||||
|
||||
class BinutilsError:
|
||||
pass
|
||||
|
||||
def getBinutilsInfo(util):
|
||||
cross_build_name = '%s-%s' % (HOST(), util)
|
||||
if not exists_binary(cross_build_name):
|
||||
if not exists_binary(util):
|
||||
#ui.error('Error: util %s cannot be found' % util)
|
||||
raise BinutilsError('util %s cannot be found' % util)
|
||||
else:
|
||||
ui.debug('Warning: %s does not exist, using plain name %s'
|
||||
% (cross_build_name, util))
|
||||
return util
|
||||
else:
|
||||
return cross_build_name
|
||||
|
||||
def AR():
|
||||
return getBinutilsInfo('ar')
|
||||
|
||||
Reference in New Issue
Block a user