2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-03 07:21:12 +01:00
waf/waflib/Tools/irixcc.py

66 lines
1.3 KiB
Python
Raw Normal View History

2011-09-10 11:13:51 +02:00
#! /usr/bin/env python
2016-06-25 23:54:12 +02:00
# encoding: utf-8
2011-09-10 11:13:51 +02:00
# imported from samba
"""
2016-06-25 23:54:12 +02:00
Compiler definition for irix/MIPSpro cc compiler
2011-09-10 11:13:51 +02:00
"""
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_irixcc(conf):
v = conf.env
cc = None
2016-06-25 23:54:12 +02:00
if v.CC:
cc = v.CC
elif 'CC' in conf.environ:
cc = conf.environ['CC']
if not cc:
cc = conf.find_program('cc', var='CC')
if not cc:
conf.fatal('irixcc was not found')
2011-09-10 11:13:51 +02:00
try:
conf.cmd_and_log(cc + ['-version'])
2012-02-11 14:49:27 +01:00
except Exception:
2011-09-10 11:13:51 +02:00
conf.fatal('%r -version could not be executed' % cc)
2016-06-25 23:54:12 +02:00
v.CC = cc
v.CC_NAME = 'irix'
2011-09-10 11:13:51 +02:00
@conf
def irixcc_common_flags(conf):
v = conf.env
2016-06-25 23:54:12 +02:00
v.CC_SRC_F = ''
v.CC_TGT_F = ['-c', '-o']
v.CPPPATH_ST = '-I%s'
v.DEFINES_ST = '-D%s'
2011-09-10 11:13:51 +02:00
2016-06-25 23:54:12 +02:00
if not v.LINK_CC:
v.LINK_CC = v.CC
2011-09-10 11:13:51 +02:00
2016-06-25 23:54:12 +02:00
v.CCLNK_SRC_F = ''
v.CCLNK_TGT_F = ['-o']
2011-09-10 11:13:51 +02:00
2016-06-25 23:54:12 +02:00
v.LIB_ST = '-l%s' # template for adding libs
v.LIBPATH_ST = '-L%s' # template for adding libpaths
v.STLIB_ST = '-l%s'
v.STLIBPATH_ST = '-L%s'
v.cprogram_PATTERN = '%s'
v.cshlib_PATTERN = 'lib%s.so'
v.cstlib_PATTERN = 'lib%s.a'
2011-09-10 11:13:51 +02:00
def configure(conf):
conf.find_irixcc()
conf.find_cpp()
conf.find_ar()
conf.irixcc_common_flags()
conf.cc_load_tools()
conf.cc_add_flags()
conf.link_add_flags()