akmhoque | fa8ee9b | 2014-03-14 09:06:24 -0500 | [diff] [blame^] | 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 | import os,sys |
| 6 | from waflib import Configure,Options,Utils |
| 7 | from waflib.Tools import ccroot,ar |
| 8 | from waflib.Configure import conf |
| 9 | @conf |
| 10 | def find_gcc(conf): |
| 11 | cc=conf.find_program(['gcc','cc'],var='CC') |
| 12 | cc=conf.cmd_to_list(cc) |
| 13 | conf.get_cc_version(cc,gcc=True) |
| 14 | conf.env.CC_NAME='gcc' |
| 15 | conf.env.CC=cc |
| 16 | @conf |
| 17 | def gcc_common_flags(conf): |
| 18 | v=conf.env |
| 19 | v['CC_SRC_F']=[] |
| 20 | v['CC_TGT_F']=['-c','-o'] |
| 21 | if not v['LINK_CC']:v['LINK_CC']=v['CC'] |
| 22 | v['CCLNK_SRC_F']=[] |
| 23 | v['CCLNK_TGT_F']=['-o'] |
| 24 | v['CPPPATH_ST']='-I%s' |
| 25 | v['DEFINES_ST']='-D%s' |
| 26 | v['LIB_ST']='-l%s' |
| 27 | v['LIBPATH_ST']='-L%s' |
| 28 | v['STLIB_ST']='-l%s' |
| 29 | v['STLIBPATH_ST']='-L%s' |
| 30 | v['RPATH_ST']='-Wl,-rpath,%s' |
| 31 | v['SONAME_ST']='-Wl,-h,%s' |
| 32 | v['SHLIB_MARKER']='-Wl,-Bdynamic' |
| 33 | v['STLIB_MARKER']='-Wl,-Bstatic' |
| 34 | v['cprogram_PATTERN']='%s' |
| 35 | v['CFLAGS_cshlib']=['-fPIC'] |
| 36 | v['LINKFLAGS_cshlib']=['-shared'] |
| 37 | v['cshlib_PATTERN']='lib%s.so' |
| 38 | v['LINKFLAGS_cstlib']=['-Wl,-Bstatic'] |
| 39 | v['cstlib_PATTERN']='lib%s.a' |
| 40 | v['LINKFLAGS_MACBUNDLE']=['-bundle','-undefined','dynamic_lookup'] |
| 41 | v['CFLAGS_MACBUNDLE']=['-fPIC'] |
| 42 | v['macbundle_PATTERN']='%s.bundle' |
| 43 | @conf |
| 44 | def gcc_modifier_win32(conf): |
| 45 | v=conf.env |
| 46 | v['cprogram_PATTERN']='%s.exe' |
| 47 | v['cshlib_PATTERN']='%s.dll' |
| 48 | v['implib_PATTERN']='lib%s.dll.a' |
| 49 | v['IMPLIB_ST']='-Wl,--out-implib,%s' |
| 50 | v['CFLAGS_cshlib']=[] |
| 51 | v.append_value('LINKFLAGS',['-Wl,--enable-auto-import']) |
| 52 | @conf |
| 53 | def gcc_modifier_cygwin(conf): |
| 54 | gcc_modifier_win32(conf) |
| 55 | v=conf.env |
| 56 | v['cshlib_PATTERN']='cyg%s.dll' |
| 57 | v.append_value('LINKFLAGS_cshlib',['-Wl,--enable-auto-image-base']) |
| 58 | v['CFLAGS_cshlib']=[] |
| 59 | @conf |
| 60 | def gcc_modifier_darwin(conf): |
| 61 | v=conf.env |
| 62 | v['CFLAGS_cshlib']=['-fPIC'] |
| 63 | v['LINKFLAGS_cshlib']=['-dynamiclib','-Wl,-compatibility_version,1','-Wl,-current_version,1'] |
| 64 | v['cshlib_PATTERN']='lib%s.dylib' |
| 65 | v['FRAMEWORKPATH_ST']='-F%s' |
| 66 | v['FRAMEWORK_ST']=['-framework'] |
| 67 | v['ARCH_ST']=['-arch'] |
| 68 | v['LINKFLAGS_cstlib']=[] |
| 69 | v['SHLIB_MARKER']=[] |
| 70 | v['STLIB_MARKER']=[] |
| 71 | v['SONAME_ST']=[] |
| 72 | @conf |
| 73 | def gcc_modifier_aix(conf): |
| 74 | v=conf.env |
| 75 | v['LINKFLAGS_cprogram']=['-Wl,-brtl'] |
| 76 | v['LINKFLAGS_cshlib']=['-shared','-Wl,-brtl,-bexpfull'] |
| 77 | v['SHLIB_MARKER']=[] |
| 78 | @conf |
| 79 | def gcc_modifier_hpux(conf): |
| 80 | v=conf.env |
| 81 | v['SHLIB_MARKER']=[] |
| 82 | v['STLIB_MARKER']='-Bstatic' |
| 83 | v['CFLAGS_cshlib']=['-fPIC','-DPIC'] |
| 84 | v['cshlib_PATTERN']='lib%s.sl' |
| 85 | @conf |
| 86 | def gcc_modifier_platform(conf): |
| 87 | gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None) |
| 88 | if gcc_modifier_func: |
| 89 | gcc_modifier_func() |
| 90 | def configure(conf): |
| 91 | conf.find_gcc() |
| 92 | conf.find_ar() |
| 93 | conf.gcc_common_flags() |
| 94 | conf.gcc_modifier_platform() |
| 95 | conf.cc_load_tools() |
| 96 | conf.cc_add_flags() |
| 97 | conf.link_add_flags() |