1 # compiler definition for HPUX
2 # based on suncc.py from waf
4 import os
, optparse
, sys
5 import Utils
, Options
, Configure
7 from Configure
import conftest
12 def gcc_modifier_hpux(conf
):
14 v
['CCFLAGS_DEBUG']=['-g']
15 v
['CCFLAGS_RELEASE']=['-O2']
17 v
['CC_TGT_F']=['-c','-o','']
18 v
['CPPPATH_ST']='-I%s'
19 if not v
['LINK_CC']:v
['LINK_CC']=v
['CC']
21 v
['CCLNK_TGT_F']=['-o','']
23 v
['LIBPATH_ST']='-L%s'
24 v
['STATICLIB_ST']='-l%s'
25 v
['STATICLIBPATH_ST']='-L%s'
26 v
['RPATH_ST']='-Wl,-rpath,%s'
27 v
['CCDEFINES_ST']='-D%s'
28 v
['SONAME_ST']='-Wl,-h,%s'
30 # v['STATICLIB_MARKER']='-Wl,-Bstatic'
31 v
['FULLSTATIC_MARKER']='-static'
32 v
['program_PATTERN']='%s'
33 v
['shlib_CCFLAGS']=['-fPIC','-DPIC']
34 v
['shlib_LINKFLAGS']=['-shared']
35 v
['shlib_PATTERN']='lib%s.sl'
36 # v['staticlib_LINKFLAGS']=['-Wl,-Bstatic']
37 v
['staticlib_PATTERN']='lib%s.a'
39 gcc
.gcc_modifier_hpux
= gcc_modifier_hpux
41 from TaskGen
import feature
, after
42 @feature('cprogram', 'cshlib')
43 @after('apply_link', 'apply_lib_vars', 'apply_obj_vars')
44 def hpux_addfullpath(self
):
45 if sys
.platform
== 'hp-ux11':
46 link
= getattr(self
, 'link_task', None)
48 lst
= link
.env
.LINKFLAGS
51 if x
.startswith('-L'):
53 if not os
.path
.isabs(p2
):
54 x
= x
[:2] + self
.bld
.srcnode
.abspath(link
.env
) + "/../" + x
[2:].lstrip('.')
56 link
.env
.LINKFLAGS
= buf