s4:lib/messaging: terminate the irpc_servers_byname() result with server_id_set_disco...
[Samba/gebeck_regimport.git] / buildtools / wafadmin / Tools / suncxx.py
blob8754b6cc2bf8d7c8cacfa6d415385e1aea7c1036
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2006 (ita)
4 # Ralf Habacker, 2006 (rh)
6 import os, optparse
7 import Utils, Options, Configure
8 import ccroot, ar
9 from Configure import conftest
11 @conftest
12 def find_sxx(conf):
13 v = conf.env
14 cc = None
15 if v['CXX']: cc = v['CXX']
16 elif 'CXX' in conf.environ: cc = conf.environ['CXX']
17 if not cc: cc = conf.find_program('c++', var='CXX')
18 if not cc: conf.fatal('sunc++ was not found')
19 cc = conf.cmd_to_list(cc)
21 try:
22 if not Utils.cmd_output(cc + ['-flags']):
23 conf.fatal('sunc++ %r was not found' % cc)
24 except ValueError:
25 conf.fatal('sunc++ -flags could not be executed')
27 v['CXX'] = cc
28 v['CXX_NAME'] = 'sun'
30 @conftest
31 def sxx_common_flags(conf):
32 v = conf.env
34 # CPPFLAGS CXXDEFINES _CXXINCFLAGS _CXXDEFFLAGS
36 v['CXX_SRC_F'] = ''
37 v['CXX_TGT_F'] = ['-c', '-o', '']
38 v['CPPPATH_ST'] = '-I%s' # template for adding include paths
40 # linker
41 if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX']
42 v['CXXLNK_SRC_F'] = ''
43 v['CXXLNK_TGT_F'] = ['-o', ''] # solaris hack, separate the -o from the target
45 v['LIB_ST'] = '-l%s' # template for adding libs
46 v['LIBPATH_ST'] = '-L%s' # template for adding libpaths
47 v['STATICLIB_ST'] = '-l%s'
48 v['STATICLIBPATH_ST'] = '-L%s'
49 v['CXXDEFINES_ST'] = '-D%s'
51 v['SONAME_ST'] = '-Wl,-h -Wl,%s'
52 v['SHLIB_MARKER'] = '-Bdynamic'
53 v['STATICLIB_MARKER'] = '-Bstatic'
55 # program
56 v['program_PATTERN'] = '%s'
58 # shared library
59 v['shlib_CXXFLAGS'] = ['-Kpic', '-DPIC']
60 v['shlib_LINKFLAGS'] = ['-G']
61 v['shlib_PATTERN'] = 'lib%s.so'
63 # static lib
64 v['staticlib_LINKFLAGS'] = ['-Bstatic']
65 v['staticlib_PATTERN'] = 'lib%s.a'
67 detect = '''
68 find_sxx
69 find_cpp
70 find_ar
71 sxx_common_flags
72 cxx_load_tools
73 cxx_add_flags
74 link_add_flags
75 '''