support for irix compilers (sort of)
authorThomas Nagy <tnagy1024@gmail.com>
Tue, 18 Jan 2011 00:31:33 +0000 (00:31 +0000)
committerThomas Nagy <tnagy1024@gmail.com>
Tue, 18 Jan 2011 00:31:33 +0000 (00:31 +0000)
git-svn-id: https://waf.googlecode.com/svn/trunk@10880 f0382ac9-c320-0410-b3f0-b508d59f5a85

waflib/Tools/compiler_c.py
waflib/Tools/irixcc.py [new file with mode: 0644]
waflib/Tools/suncc.py
waflib/Tools/suncxx.py

index 9545c77c4ffb9d34536cc5a3e3b4baa03c2d0683..68622e7993cc2f723e190dbd05dcd1498e9482b6 100644 (file)
@@ -41,7 +41,7 @@ c_compiler = {
 'aix':    ['xlc', 'gcc'],
 'linux':  ['gcc', 'icc'],
 'sunos':  ['suncc', 'gcc'],
-'irix':   ['gcc'],
+'irix':   ['gcc', 'irixcc'],
 'hpux':   ['gcc'],
 'gnu':    ['gcc'],
 'java':   ['gcc', 'msvc', 'icc'],
diff --git a/waflib/Tools/irixcc.py b/waflib/Tools/irixcc.py
new file mode 100644 (file)
index 0000000..f609359
--- /dev/null
@@ -0,0 +1,63 @@
+#! /usr/bin/env python
+# imported from samba
+
+"""
+compiler definition for irix/MIPSpro cc compiler
+based on suncc.py from waf
+"""
+
+import os
+from waflib import Utils
+from waflib.Tools import ccroot, ar
+from waflib.Configure import conf
+
+@conf
+def find_irixcc(conf):
+       v = conf.env
+       cc = None
+       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')
+       cc = conf.cmd_to_list(cc)
+
+       try:
+               conf.cmd_and_log(cc + ['-version'])
+       except:
+               conf.fatal('%r -version could not be executed' % cc)
+
+       v['CC']  = cc
+       v['CC_NAME'] = 'irix'
+
+@conf
+def irixcc_common_flags(conf):
+       v = conf.env
+
+       v['CC_SRC_F']            = ''
+       v['CC_TGT_F']            = ['-c', '-o']
+       v['CPPPATH_ST']          = '-I%s'
+       v['DEFINES_ST']          = '-D%s'
+
+       # linker
+       if not v['LINK_CC']: v['LINK_CC'] = v['CC']
+       v['CCLNK_SRC_F']         = ''
+       v['CCLNK_TGT_F']         = ['-o']
+
+       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'
+
+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()
+
index 9893e6c7d48e23674b9cfdd82256af7464d0f295..7e332155d37429b8adc13a99c6e655a020c3cc88 100644 (file)
@@ -19,9 +19,10 @@ def find_scc(conf):
        elif 'CC' in conf.environ: cc = conf.environ['CC']
        if not cc: cc = conf.find_program('cc', var='CC')
        if not cc: conf.fatal('Could not find a Sun C compiler')
+       cc = conf.cmd_to_list(cc)
 
        try:
-               conf.cmd_and_log('%s -flags' % cc)
+               conf.cmd_and_log(cc + ['-flags'])
        except:
                conf.fatal('%r is not a Sun compiler' % cc)
 
@@ -36,12 +37,12 @@ def scc_common_flags(conf):
        v = conf.env
 
        v['CC_SRC_F']            = ''
-       v['CC_TGT_F']            = ['-c', '-o', '']
+       v['CC_TGT_F']            = ['-c', '-o']
 
        # linker
        if not v['LINK_CC']: v['LINK_CC'] = v['CC']
        v['CCLNK_SRC_F']         = ''
-       v['CCLNK_TGT_F']         = ['-o', ''] # solaris hack, separate the -o from the target
+       v['CCLNK_TGT_F']         = ['-o']
        v['CPPPATH_ST']          = '-I%s'
        v['DEFINES_ST']          = '-D%s'
 
index a359134cdaf1d83187e9b18d65380310bf4c32dd..ea396528b60ad08e7611f638260ce6b6a3fc6a20 100644 (file)
@@ -20,9 +20,10 @@ def find_sxx(conf):
        if not cc: cc = conf.find_program('c++', var='CXX')
        if not cc: cc = conf.find_program('CC', var='CXX') #studio
        if not cc: conf.fatal('Could not find a Sun C++ compiler')
+       cc = conf.cmd_to_list(cc)
 
        try:
-               conf.cmd_and_log('%s -flags' % cc)
+               conf.cmd_and_log(cc + ['-flags'])
        except:
                conf.fatal('%r is not a Sun compiler' % cc)
 
@@ -37,12 +38,12 @@ def sxx_common_flags(conf):
        v = conf.env
 
        v['CXX_SRC_F']           = ''
-       v['CXX_TGT_F']           = ['-c', '-o', '']
+       v['CXX_TGT_F']           = ['-c', '-o']
 
        # linker
        if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX']
        v['CXXLNK_SRC_F']        = ''
-       v['CXXLNK_TGT_F']        = ['-o', ''] # solaris hack, separate the -o from the target
+       v['CXXLNK_TGT_F']        = ['-o']
        v['CPPPATH_ST']          = '-I%s'
        v['DEFINES_ST']          = '-D%s'