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 |
| 6 | from waflib import Utils |
| 7 | from waflib.Tools import ccroot,ar |
| 8 | from waflib.Configure import conf |
| 9 | @conf |
| 10 | def find_scc(conf): |
| 11 | v=conf.env |
| 12 | cc=None |
| 13 | if v['CC']:cc=v['CC'] |
| 14 | elif'CC'in conf.environ:cc=conf.environ['CC'] |
| 15 | if not cc:cc=conf.find_program('cc',var='CC') |
| 16 | if not cc:conf.fatal('Could not find a Sun C compiler') |
| 17 | cc=conf.cmd_to_list(cc) |
| 18 | try: |
| 19 | conf.cmd_and_log(cc+['-flags']) |
| 20 | except Exception: |
| 21 | conf.fatal('%r is not a Sun compiler'%cc) |
| 22 | v['CC']=cc |
| 23 | v['CC_NAME']='sun' |
| 24 | @conf |
| 25 | def scc_common_flags(conf): |
| 26 | v=conf.env |
| 27 | v['CC_SRC_F']=[] |
| 28 | v['CC_TGT_F']=['-c','-o'] |
| 29 | if not v['LINK_CC']:v['LINK_CC']=v['CC'] |
| 30 | v['CCLNK_SRC_F']='' |
| 31 | v['CCLNK_TGT_F']=['-o'] |
| 32 | v['CPPPATH_ST']='-I%s' |
| 33 | v['DEFINES_ST']='-D%s' |
| 34 | v['LIB_ST']='-l%s' |
| 35 | v['LIBPATH_ST']='-L%s' |
| 36 | v['STLIB_ST']='-l%s' |
| 37 | v['STLIBPATH_ST']='-L%s' |
| 38 | v['SONAME_ST']='-Wl,-h,%s' |
| 39 | v['SHLIB_MARKER']='-Bdynamic' |
| 40 | v['STLIB_MARKER']='-Bstatic' |
| 41 | v['cprogram_PATTERN']='%s' |
| 42 | v['CFLAGS_cshlib']=['-Kpic','-DPIC'] |
| 43 | v['LINKFLAGS_cshlib']=['-G'] |
| 44 | v['cshlib_PATTERN']='lib%s.so' |
| 45 | v['LINKFLAGS_cstlib']=['-Bstatic'] |
| 46 | v['cstlib_PATTERN']='lib%s.a' |
| 47 | def configure(conf): |
| 48 | conf.find_scc() |
| 49 | conf.find_ar() |
| 50 | conf.scc_common_flags() |
| 51 | conf.cc_load_tools() |
| 52 | conf.cc_add_flags() |
| 53 | conf.link_add_flags() |