summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-12-07 23:42:15 +0300
committerMatthieu Patou <mat@samba.org>2010-12-08 00:32:49 +0100
commit994bcf35d2c547edc7f567a0f1b6e4db73a3ee73 (patch)
tree7d70c56b6ba49d319c18fdb536a05e1bd3bef79c /buildtools/wafsamba
parenta52a587783e058f75815fa8add1f46b1c1d6f2d3 (diff)
downloadsamba-994bcf35d2c547edc7f567a0f1b6e4db73a3ee73.tar.gz
samba-994bcf35d2c547edc7f567a0f1b6e4db73a3ee73.tar.bz2
samba-994bcf35d2c547edc7f567a0f1b6e4db73a3ee73.zip
build: fix hpux build pb
Pair-Programmed-With: Thomas Nagy <tnagy2pow10@gmail.com> Fix the library extension from .so to .sl Add full path to library when linking this is needed due to a strange behavior of HP-UX: This command: gcc demo demo.c -L dir1/dir2/ -lsomelib will give a binary with a hard coded lib like dir1/dir2/libsomelib.sl. Somehow like a partial rpath, it has the first impact of fooling waf detection of wether the plateform support libraries or not (leading to being unable to compile samba on HPUX) and the impact of having non functionnal binaries. Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Wed Dec 8 00:32:50 CET 2010 on sn-devel-104
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/hpuxcc.py56
-rw-r--r--buildtools/wafsamba/wafsamba.py1
2 files changed, 57 insertions, 0 deletions
diff --git a/buildtools/wafsamba/hpuxcc.py b/buildtools/wafsamba/hpuxcc.py
new file mode 100644
index 0000000000..abdf2a807b
--- /dev/null
+++ b/buildtools/wafsamba/hpuxcc.py
@@ -0,0 +1,56 @@
+# compiler definition for HPUX
+# based on suncc.py from waf
+
+import os, optparse, sys
+import Utils, Options, Configure
+import ccroot, ar
+from Configure import conftest
+import gcc
+
+
+@conftest
+def gcc_modifier_hpux(conf):
+ v=conf.env
+ v['CCFLAGS_DEBUG']=['-g']
+ v['CCFLAGS_RELEASE']=['-O2']
+ v['CC_SRC_F']=''
+ v['CC_TGT_F']=['-c','-o','']
+ v['CPPPATH_ST']='-I%s'
+ if not v['LINK_CC']:v['LINK_CC']=v['CC']
+ v['CCLNK_SRC_F']=''
+ v['CCLNK_TGT_F']=['-o','']
+ v['LIB_ST']='-l%s'
+ v['LIBPATH_ST']='-L%s'
+ v['STATICLIB_ST']='-l%s'
+ v['STATICLIBPATH_ST']='-L%s'
+ v['RPATH_ST']='-Wl,-rpath,%s'
+ v['CCDEFINES_ST']='-D%s'
+ v['SONAME_ST']='-Wl,-h,%s'
+ v['SHLIB_MARKER']=['-Wl,-Bdynamic']
+# v['STATICLIB_MARKER']='-Wl,-Bstatic'
+ v['FULLSTATIC_MARKER']='-static'
+ v['program_PATTERN']='%s'
+ v['shlib_CCFLAGS']=['-fPIC','-DPIC']
+ v['shlib_LINKFLAGS']=['-shared']
+ v['shlib_PATTERN']='lib%s.sl'
+# v['staticlib_LINKFLAGS']=['-Wl,-Bstatic']
+ v['staticlib_PATTERN']='lib%s.a'
+
+gcc.gcc_modifier_hpux = gcc_modifier_hpux
+
+from TaskGen import feature, after
+@feature('cprogram', 'cshlib')
+@after('apply_link', 'apply_lib_vars', 'apply_obj_vars')
+def hpux_addfullpath(self):
+ if sys.platform == 'hp-ux11':
+ link = getattr(self, 'link_task', None)
+ if link:
+ lst = link.env.LINKFLAGS
+ buf = []
+ for x in lst:
+ if x.startswith('-L'):
+ p2 = x[2:]
+ if not os.path.isabs(p2):
+ x = x[:2] + self.bld.srcnode.abspath(link.env) + "/../" + x[2:].lstrip('.')
+ buf.append(x)
+ link.env.LINKFLAGS = buf
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 5d13fa1023..1d3ced13ce 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -23,6 +23,7 @@ import samba_conftests
import samba_abi
import tru64cc
import irixcc
+import hpuxcc
import generic_cc
import samba_dist
import samba_wildcard