Debian Codegraph @

waflib/Tools/xlcxx.py

raw
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2006-2018 (ita)
4 # Ralf Habacker, 2006 (rh)
5 # Yinon Ehrlich, 2009
6 # Michael Kuhn, 2009
7
8 from waflib.Tools import ccroot, ar
9 from waflib.Configure import conf
10
11 @conf
12 def find_xlcxx(conf):
13 """
14 Detects the Aix C++ compiler
15 """
16 cxx = conf.find_program(['xlc++_r', 'xlc++'], var='CXX')
17 conf.get_xlc_version(cxx)
18 conf.env.CXX_NAME = 'xlc++'
19
20 @conf
21 def xlcxx_common_flags(conf):
22 """
23 Flags required for executing the Aix C++ compiler
24 """
25 v = conf.env
26
27 v.CXX_SRC_F = []
28 v.CXX_TGT_F = ['-c', '-o']
29
30 if not v.LINK_CXX:
31 v.LINK_CXX = v.CXX
32
33 v.CXXLNK_SRC_F = []
34 v.CXXLNK_TGT_F = ['-o']
35 v.CPPPATH_ST = '-I%s'
36 v.DEFINES_ST = '-D%s'
37
38 v.LIB_ST = '-l%s' # template for adding libs
39 v.LIBPATH_ST = '-L%s' # template for adding libpaths
40 v.STLIB_ST = '-l%s'
41 v.STLIBPATH_ST = '-L%s'
42 v.RPATH_ST = '-Wl,-rpath,%s'
43
44 v.SONAME_ST = []
45 v.SHLIB_MARKER = []
46 v.STLIB_MARKER = []
47
48 v.LINKFLAGS_cxxprogram= ['-Wl,-brtl']
49 v.cxxprogram_PATTERN = '%s'
50
51 v.CXXFLAGS_cxxshlib = ['-fPIC']
52 v.LINKFLAGS_cxxshlib = ['-G', '-Wl,-brtl,-bexpfull']
53 v.cxxshlib_PATTERN = 'lib%s.so'
54
55 v.LINKFLAGS_cxxstlib = []
56 v.cxxstlib_PATTERN = 'lib%s.a'
57
58 def configure(conf):
59 conf.find_xlcxx()
60 conf.find_ar()
61 conf.xlcxx_common_flags()
62 conf.cxx_load_tools()
63 conf.cxx_add_flags()
64 conf.link_add_flags()
65