thirdparty:waf: New files for waf 1.9.10
[bbaumbach/samba-autobuild/.git] / third_party / waf / waflib / Tools / suncxx.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 # Thomas Nagy, 2006-2016 (ita)
8 # Ralf Habacker, 2006 (rh)
9
10 from waflib.Tools import ccroot, ar
11 from waflib.Configure import conf
12
13 @conf
14 def find_sxx(conf):
15         """
16         Detects the sun C++ compiler
17         """
18         v = conf.env
19         cc = conf.find_program(['CC', 'c++'], var='CXX')
20         try:
21                 conf.cmd_and_log(cc + ['-flags'])
22         except Exception:
23                 conf.fatal('%r is not a Sun compiler' % cc)
24         v.CXX_NAME = 'sun'
25         conf.get_suncc_version(cc)
26
27 @conf
28 def sxx_common_flags(conf):
29         """
30         Flags required for executing the sun C++ compiler
31         """
32         v = conf.env
33
34         v.CXX_SRC_F           = []
35         v.CXX_TGT_F           = ['-c', '-o', '']
36
37         if not v.LINK_CXX:
38                 v.LINK_CXX = v.CXX
39
40         v.CXXLNK_SRC_F        = []
41         v.CXXLNK_TGT_F        = ['-o', '']
42         v.CPPPATH_ST          = '-I%s'
43         v.DEFINES_ST          = '-D%s'
44
45         v.LIB_ST              = '-l%s' # template for adding libs
46         v.LIBPATH_ST          = '-L%s' # template for adding libpaths
47         v.STLIB_ST            = '-l%s'
48         v.STLIBPATH_ST        = '-L%s'
49
50         v.SONAME_ST           = '-Wl,-h,%s'
51         v.SHLIB_MARKER        = '-Bdynamic'
52         v.STLIB_MARKER        = '-Bstatic'
53
54         v.cxxprogram_PATTERN  = '%s'
55
56         v.CXXFLAGS_cxxshlib   = ['-xcode=pic32', '-DPIC']
57         v.LINKFLAGS_cxxshlib  = ['-G']
58         v.cxxshlib_PATTERN    = 'lib%s.so'
59
60         v.LINKFLAGS_cxxstlib  = ['-Bstatic']
61         v.cxxstlib_PATTERN    = 'lib%s.a'
62
63 def configure(conf):
64         conf.find_sxx()
65         conf.find_ar()
66         conf.sxx_common_flags()
67         conf.cxx_load_tools()
68         conf.cxx_add_flags()
69         conf.link_add_flags()