backported the openbsd fixes from waf 1.7
authorThomas Nagy <tnagy2pow10@gmail.com>
Mon, 16 Sep 2013 22:00:40 +0000 (00:00 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 22 Dec 2014 10:37:06 +0000 (11:37 +0100)
buildtools/wafadmin/Tools/ccroot.py
buildtools/wafadmin/Tools/gcc.py
buildtools/wafadmin/Tools/gxx.py

index 264bdc7f0f6350db145fcdcba22aff27a94b306a..d59cf2663395a19f8b087f214834eef8705940c3 100644 (file)
@@ -177,10 +177,14 @@ def get_target_name(self):
 
        dir, name = os.path.split(self.target)
 
-       if self.env.DEST_BINFMT == 'pe' and getattr(self, 'vnum', None) and 'cshlib' in self.features:
-               # include the version in the dll file name,
-               # the import lib file name stays unversionned.
-               name = name + '-' + self.vnum.split('.')[0]
+       if 'cshlib' in self.features and getattr(self, 'vnum', None):
+               nums = self.vnum.split('.')
+               if self.env.DEST_BINFMT == 'pe':
+                       # include the version in the dll file name,
+                       # the import lib file name stays unversionned.
+                       name = name + '-' + nums[0]
+               elif self.env.DEST_OS == 'openbsd':
+                       pattern = '%s.%s.%s' % (pattern, nums[0], nums[1])
 
        return os.path.join(dir, pattern % name)
 
@@ -598,14 +602,16 @@ def apply_vnum(self):
        if not path: return
 
        if self.env.DEST_OS == 'openbsd':
-               bld.install_as(path + os.sep + name2, node, env=self.env, chmod=self.link_task.chmod)
+               libname = self.link_task.outputs[0].name
+               bld.install_as('%s%s%s' % (path, os.sep, libname), node, env=self.env)
        else:
                bld.install_as(path + os.sep + name3, node, env=self.env)
                bld.symlink_as(path + os.sep + name2, name3)
                bld.symlink_as(path + os.sep + libname, name3)
 
        # the following task is just to enable execution from the build dir :-/
-       self.create_task('vnum', node, [node.parent.find_or_declare(name2), node.parent.find_or_declare(name3)])
+       if self.env.DEST_OS != 'openbsd':
+               self.create_task('vnum', node, [node.parent.find_or_declare(name2), node.parent.find_or_declare(name3)])
 
 def exec_vnum_link(self):
        for x in self.outputs:
index 420b44fd8f20f8caa697c35410be514989927c6e..a6be0b28dbf133097d69798d5bc7eefc92af4c16 100644 (file)
@@ -113,6 +113,10 @@ def gcc_modifier_aix(conf):
 
        v['SHLIB_MARKER']        = ''
 
+@conftest
+def gcc_modifier_openbsd(conf):
+       conf.env['SONAME_ST'] = []
+
 @conftest
 def gcc_modifier_platform(conf):
        # * set configurations specific for a platform.
index 8f4a0bfef0668fb9d7050b167fd4a29dea151953..4984122e5e6239cb2e462fbca06dd710f134432c 100644 (file)
@@ -111,6 +111,10 @@ def gxx_modifier_aix(conf):
 
        v['SHLIB_MARKER']        = ''
 
+@conftest
+def gxx_modifier_openbsd(conf):
+       conf.env['SONAME_ST'] = []
+
 @conftest
 def gxx_modifier_platform(conf):
        # * set configurations specific for a platform.