build: a hack to get perl to put its generated blib files in the build directory
authorAndrew Tridgell <tridge@samba.org>
Sat, 27 Mar 2010 05:47:43 +0000 (16:47 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:10 +0000 (20:27 +1000)
perl wants to put generated files in the source directory, whereas waf wants
them in the build directory. Use a symlink to trick perl into putting them
in the right place

buildtools/wafsamba/wafsamba.py

index 876cdf6988f20fc4099ea720bcbfb948ad94b852..1dc71b4faeef8d8a6300e803e4e4a029eeb79d62 100644 (file)
@@ -37,6 +37,14 @@ def SAMBA_BUILD_ENV(conf):
         if not os.path.lexists(link_target):
             os.symlink('../' + p, link_target)
 
+    # get perl to put the blib files in the build directory
+    blib_bld = os.path.join(conf.blddir, 'default/pidl/blib')
+    blib_src = os.path.join(conf.srcdir, 'pidl/blib')
+    mkdir_p(blib_bld + '/man1')
+    mkdir_p(blib_bld + '/man3')
+    if not os.path.lexists(blib_src):
+        os.symlink(blib_bld, blib_src)
+
 
 
 ################################################################
@@ -459,7 +467,7 @@ def SAMBA_GENERATOR(bld, name, rule, source, target,
         return
 
     bld.SET_BUILD_GROUP(group)
-    bld(
+    t = bld(
         rule=rule,
         source=bld.EXPAND_VARIABLES(source, vars=vars),
         target=target,
@@ -471,6 +479,7 @@ def SAMBA_GENERATOR(bld, name, rule, source, target,
 
     if public_headers is not None:
         bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
+    return t
 Build.BuildContext.SAMBA_GENERATOR = SAMBA_GENERATOR