pidl-waf: better handling of the man page generation
authorAndrew Tridgell <tridge@samba.org>
Fri, 2 Apr 2010 09:55:37 +0000 (20:55 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:23 +0000 (20:27 +1000)
we now avoid leaving build files in the source tree

buildtools/wafsamba/wafsamba.py
pidl/wscript

index 63d657f3709c3e505a414012b52f0192b11c4a72..8dfa003091434877cf150848106d66df0ee8ab7e 100644 (file)
@@ -51,8 +51,6 @@ def SAMBA_BUILD_ENV(conf):
         os.unlink(blib_src)
     elif os.path.exists(blib_src):
         shutil.rmtree(blib_src)
-    os.symlink(blib_bld, blib_src)
-
 
 
 def ADD_INIT_FUNCTION(bld, subsystem, target, init_function):
index 4db7ca54d9b5290b9f24c122873f069056e5428a..2a0a434964c42cec64412f04559d0620b1c04c8a 100644 (file)
@@ -39,10 +39,15 @@ def build(bld):
     # use perl to build the manpages
     bld.env.pidl_srcdir = os.path.join(bld.srcnode.abspath(), 'pidl')
 
-    bld.SAMBA_GENERATOR('pidl_manpages',
-                        source=pidl_src,
-                        target=pidl_manpages,
-                        rule='cd ${pidl_srcdir} && ${PERL} Makefile.PL && make manifypods && rm -f Makefile Makefile.old')
+    blib_bld = os.path.join(bld.srcnode.abspath(bld.env), 'pidl/blib')
+
+    link_command = 'rm -rf blib && ln -s %s' % blib_bld
+
+    t = bld.SAMBA_GENERATOR('pidl_manpages',
+                            source=pidl_src,
+                            target=pidl_manpages,
+                            rule='cd ${pidl_srcdir} && ${LINK_COMMAND} && ${PERL} Makefile.PL && make manifypods && rm -f Makefile Makefile.old && rm -f blib')
+    t.env.LINK_COMMAND = link_command
 
     # we want to prefer the git version of the parsers if we can. Only if the
     # source has changed do we want to re-run yapp
@@ -51,10 +56,11 @@ def build(bld):
         bld.IS_NEWER('expr.yp', 'lib/Parse/Pidl/Expr.pm')))
 
     if need_yapp_build:
-        bld.SAMBA_GENERATOR('pidl_parser',
-                            source='idl.yp expr.yp',
-                            target='lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm Makefile.PL',
-                            rule='cd ${pidl_srcdir} && ${PERL} Makefile.PL && make lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm && rm -f Makefile Makefile.old')
+        t = bld.SAMBA_GENERATOR('pidl_parser',
+                                source='idl.yp expr.yp',
+                                target='lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm Makefile.PL',
+                                rule='cd ${pidl_srcdir} && ${LINK_COMMAND} && ${PERL} Makefile.PL && make lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm && rm -f Makefile Makefile.old && rm -f blib')
+        t.env.LINK_COMMAND = link_command
 
     for m in pidl_manpages:
         dname=os.path.dirname(m)[5:]