[0fa325b] | 1 | #! /usr/bin/env python |
---|
| 2 | # encoding: utf-8 |
---|
| 3 | # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file |
---|
| 4 | |
---|
| 5 | from waflib.Tools import ccroot,ar |
---|
| 6 | from waflib.Configure import conf |
---|
| 7 | @conf |
---|
| 8 | def find_gxx(conf): |
---|
| 9 | cxx=conf.find_program(['g++','c++'],var='CXX') |
---|
| 10 | cxx=conf.cmd_to_list(cxx) |
---|
| 11 | conf.get_cc_version(cxx,gcc=True) |
---|
| 12 | conf.env.CXX_NAME='gcc' |
---|
| 13 | conf.env.CXX=cxx |
---|
| 14 | @conf |
---|
| 15 | def gxx_common_flags(conf): |
---|
| 16 | v=conf.env |
---|
| 17 | v['CXX_SRC_F']=[] |
---|
| 18 | v['CXX_TGT_F']=['-c','-o'] |
---|
| 19 | if not v['LINK_CXX']:v['LINK_CXX']=v['CXX'] |
---|
| 20 | v['CXXLNK_SRC_F']=[] |
---|
| 21 | v['CXXLNK_TGT_F']=['-o'] |
---|
| 22 | v['CPPPATH_ST']='-I%s' |
---|
| 23 | v['DEFINES_ST']='-D%s' |
---|
| 24 | v['LIB_ST']='-l%s' |
---|
| 25 | v['LIBPATH_ST']='-L%s' |
---|
| 26 | v['STLIB_ST']='-l%s' |
---|
| 27 | v['STLIBPATH_ST']='-L%s' |
---|
| 28 | v['RPATH_ST']='-Wl,-rpath,%s' |
---|
| 29 | v['SONAME_ST']='-Wl,-h,%s' |
---|
| 30 | v['SHLIB_MARKER']='-Wl,-Bdynamic' |
---|
| 31 | v['STLIB_MARKER']='-Wl,-Bstatic' |
---|
| 32 | v['cxxprogram_PATTERN']='%s' |
---|
| 33 | v['CXXFLAGS_cxxshlib']=['-fPIC'] |
---|
| 34 | v['LINKFLAGS_cxxshlib']=['-shared'] |
---|
| 35 | v['cxxshlib_PATTERN']='lib%s.so' |
---|
| 36 | v['LINKFLAGS_cxxstlib']=['-Wl,-Bstatic'] |
---|
| 37 | v['cxxstlib_PATTERN']='lib%s.a' |
---|
| 38 | v['LINKFLAGS_MACBUNDLE']=['-bundle','-undefined','dynamic_lookup'] |
---|
| 39 | v['CXXFLAGS_MACBUNDLE']=['-fPIC'] |
---|
| 40 | v['macbundle_PATTERN']='%s.bundle' |
---|
| 41 | @conf |
---|
| 42 | def gxx_modifier_win32(conf): |
---|
| 43 | v=conf.env |
---|
| 44 | v['cxxprogram_PATTERN']='%s.exe' |
---|
| 45 | v['cxxshlib_PATTERN']='%s.dll' |
---|
| 46 | v['implib_PATTERN']='lib%s.dll.a' |
---|
| 47 | v['IMPLIB_ST']='-Wl,--out-implib,%s' |
---|
| 48 | v['CXXFLAGS_cxxshlib']=[] |
---|
| 49 | v.append_value('LINKFLAGS',['-Wl,--enable-auto-import']) |
---|
| 50 | @conf |
---|
| 51 | def gxx_modifier_cygwin(conf): |
---|
| 52 | gxx_modifier_win32(conf) |
---|
| 53 | v=conf.env |
---|
| 54 | v['cxxshlib_PATTERN']='cyg%s.dll' |
---|
| 55 | v.append_value('LINKFLAGS_cxxshlib',['-Wl,--enable-auto-image-base']) |
---|
| 56 | v['CXXFLAGS_cxxshlib']=[] |
---|
| 57 | @conf |
---|
| 58 | def gxx_modifier_darwin(conf): |
---|
| 59 | v=conf.env |
---|
[c101fe1] | 60 | v['CXXFLAGS_cxxshlib']=['-fPIC'] |
---|
| 61 | v['LINKFLAGS_cxxshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1'] |
---|
[0fa325b] | 62 | v['cxxshlib_PATTERN']='lib%s.dylib' |
---|
| 63 | v['FRAMEWORKPATH_ST']='-F%s' |
---|
| 64 | v['FRAMEWORK_ST']=['-framework'] |
---|
| 65 | v['ARCH_ST']=['-arch'] |
---|
| 66 | v['LINKFLAGS_cxxstlib']=[] |
---|
| 67 | v['SHLIB_MARKER']=[] |
---|
| 68 | v['STLIB_MARKER']=[] |
---|
| 69 | v['SONAME_ST']=[] |
---|
| 70 | @conf |
---|
| 71 | def gxx_modifier_aix(conf): |
---|
| 72 | v=conf.env |
---|
| 73 | v['LINKFLAGS_cxxprogram']=['-Wl,-brtl'] |
---|
| 74 | v['LINKFLAGS_cxxshlib']=['-shared','-Wl,-brtl,-bexpfull'] |
---|
| 75 | v['SHLIB_MARKER']=[] |
---|
| 76 | @conf |
---|
| 77 | def gxx_modifier_hpux(conf): |
---|
| 78 | v=conf.env |
---|
| 79 | v['SHLIB_MARKER']=[] |
---|
| 80 | v['STLIB_MARKER']='-Bstatic' |
---|
| 81 | v['CFLAGS_cxxshlib']=['-fPIC','-DPIC'] |
---|
| 82 | v['cxxshlib_PATTERN']='lib%s.sl' |
---|
| 83 | @conf |
---|
[c101fe1] | 84 | def gxx_modifier_openbsd(conf): |
---|
| 85 | conf.env.SONAME_ST=[] |
---|
| 86 | @conf |
---|
[0fa325b] | 87 | def gxx_modifier_platform(conf): |
---|
| 88 | gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None) |
---|
| 89 | if gxx_modifier_func: |
---|
| 90 | gxx_modifier_func() |
---|
| 91 | def configure(conf): |
---|
| 92 | conf.find_gxx() |
---|
| 93 | conf.find_ar() |
---|
| 94 | conf.gxx_common_flags() |
---|
| 95 | conf.gxx_modifier_platform() |
---|
| 96 | conf.cxx_load_tools() |
---|
| 97 | conf.cxx_add_flags() |
---|
| 98 | conf.link_add_flags() |
---|