* 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
|
# Binutils Variables
|
||||||
|
|
||||||
def getBinutilsInfo(needed):
|
def exists_binary(bin):
|
||||||
return '%s-%s' % (HOST(), needed)
|
# 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():
|
def AR():
|
||||||
return getBinutilsInfo('ar')
|
return getBinutilsInfo('ar')
|
||||||
|
|||||||
Reference in New Issue
Block a user