pysmbd: Set umask to 0 during smbd operations
[Samba/gebeck_regimport.git] / buildtools / wafadmin / Tools / xlcxx.py
blob6e84662a64c90f42f91d01c89b5f8f762596fbe9
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2006 (ita)
4 # Ralf Habacker, 2006 (rh)
5 # Yinon Ehrlich, 2009
6 # Michael Kuhn, 2009
8 import os, sys
9 import Configure, Options, Utils
10 import ccroot, ar
11 from Configure import conftest
13 @conftest
14 def find_xlcxx(conf):
15 cxx = conf.find_program(['xlc++_r', 'xlc++'], var='CXX', mandatory=True)
16 cxx = conf.cmd_to_list(cxx)
17 conf.env.CXX_NAME = 'xlc++'
18 conf.env.CXX = cxx
20 @conftest
21 def find_cpp(conf):
22 v = conf.env
23 cpp = None
24 if v['CPP']: cpp = v['CPP']
25 elif 'CPP' in conf.environ: cpp = conf.environ['CPP']
26 #if not cpp: cpp = v['CXX']
27 v['CPP'] = cpp
29 @conftest
30 def xlcxx_common_flags(conf):
31 v = conf.env
33 # CPPFLAGS CXXDEFINES _CXXINCFLAGS _CXXDEFFLAGS
34 v['CXXFLAGS_DEBUG'] = ['-g']
35 v['CXXFLAGS_RELEASE'] = ['-O2']
37 v['CXX_SRC_F'] = ''
38 v['CXX_TGT_F'] = ['-c', '-o', ''] # shell hack for -MD
39 v['CPPPATH_ST'] = '-I%s' # template for adding include paths
41 # linker
42 if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX']
43 v['CXXLNK_SRC_F'] = ''
44 v['CXXLNK_TGT_F'] = ['-o', ''] # shell hack for -MD
46 v['LIB_ST'] = '-l%s' # template for adding libs
47 v['LIBPATH_ST'] = '-L%s' # template for adding libpaths
48 v['STATICLIB_ST'] = '-l%s'
49 v['STATICLIBPATH_ST'] = '-L%s'
50 v['RPATH_ST'] = '-Wl,-rpath,%s'
51 v['CXXDEFINES_ST'] = '-D%s'
53 v['SONAME_ST'] = ''
54 v['SHLIB_MARKER'] = ''
55 v['STATICLIB_MARKER'] = ''
56 v['FULLSTATIC_MARKER'] = '-static'
58 # program
59 v['program_LINKFLAGS'] = ['-Wl,-brtl']
60 v['program_PATTERN'] = '%s'
62 # shared library
63 v['shlib_CXXFLAGS'] = ['-fPIC', '-DPIC'] # avoid using -DPIC, -fPIC aleady defines the __PIC__ macro
64 v['shlib_LINKFLAGS'] = ['-G', '-Wl,-brtl,-bexpfull']
65 v['shlib_PATTERN'] = 'lib%s.so'
67 # static lib
68 v['staticlib_LINKFLAGS'] = ''
69 v['staticlib_PATTERN'] = 'lib%s.a'
71 def detect(conf):
72 conf.find_xlcxx()
73 conf.find_cpp()
74 conf.find_ar()
75 conf.xlcxx_common_flags()
76 conf.cxx_load_tools()
77 conf.cxx_add_flags()
78 conf.link_add_flags()