413261e2a145f14ea7c6b04bece33c2f7de37225
[bbaumbach/samba-autobuild/.git] / third_party / waf / waflib / Tools / irixcc.py
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
4
5 #! /usr/bin/env python
6 # encoding: utf-8
7 # imported from samba
8
9 """
10 Compiler definition for irix/MIPSpro cc compiler
11 """
12
13 from waflib.Tools import ccroot, ar
14 from waflib.Configure import conf
15
16 @conf
17 def find_irixcc(conf):
18         v = conf.env
19         cc = None
20         if v.CC:
21                 cc = v.CC
22         elif 'CC' in conf.environ:
23                 cc = conf.environ['CC']
24         if not cc:
25                 cc = conf.find_program('cc', var='CC')
26         if not cc:
27                 conf.fatal('irixcc was not found')
28
29         try:
30                 conf.cmd_and_log(cc + ['-version'])
31         except Exception:
32                 conf.fatal('%r -version could not be executed' % cc)
33
34         v.CC = cc
35         v.CC_NAME = 'irix'
36
37 @conf
38 def irixcc_common_flags(conf):
39         v = conf.env
40
41         v.CC_SRC_F            = ''
42         v.CC_TGT_F            = ['-c', '-o']
43         v.CPPPATH_ST          = '-I%s'
44         v.DEFINES_ST          = '-D%s'
45
46         if not v.LINK_CC:
47                 v.LINK_CC = v.CC
48
49         v.CCLNK_SRC_F         = ''
50         v.CCLNK_TGT_F         = ['-o']
51
52         v.LIB_ST              = '-l%s' # template for adding libs
53         v.LIBPATH_ST          = '-L%s' # template for adding libpaths
54         v.STLIB_ST            = '-l%s'
55         v.STLIBPATH_ST        = '-L%s'
56
57         v.cprogram_PATTERN    = '%s'
58         v.cshlib_PATTERN      = 'lib%s.so'
59         v.cstlib_PATTERN      = 'lib%s.a'
60
61 def configure(conf):
62         conf.find_irixcc()
63         conf.find_cpp()
64         conf.find_ar()
65         conf.irixcc_common_flags()
66         conf.cc_load_tools()
67         conf.cc_add_flags()
68         conf.link_add_flags()