libcli/smb: Add smbXcli_conn_use_status32
[obnox/samba/samba-obnox.git] / pidl / wscript
index f3814eab01c49fd75a88d7aca634559acfb0a47f..7a25734663406e88d997212dddc6aa6458a726b5 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
-import os
+import os, sys, Logs
+from samba_utils import MODE_755
 
 def set_options(opt):
     opt.tool_options('perl')
@@ -18,7 +19,7 @@ def configure(conf):
     conf.find_program('pod2man', var='POD2MAN')
 
 def build(bld):
-    bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=0755)
+    bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755)
 
     bld.RECURSE('lib')
 
@@ -45,26 +46,40 @@ def build(bld):
 
     blib_bld = os.path.join(bld.srcnode.abspath(bld.env), 'pidl/blib')
 
-    link_command = 'rm -rf blib && ln -fs blib %s' % blib_bld
-    
-    bld.SET_BUILD_GROUP('main')
+    bld.SET_BUILD_GROUP('final')
     if 'POD2MAN' in bld.env and bld.env['POD2MAN'] != '':
         for src, manpage in pidl_manpages.iteritems():
-            bld(rule='${PERL} ${POD2MAN} -c "Samba Documentation" ${SRC} ${TGT}',
+            bld(rule='${POD2MAN} -c "Samba Documentation" ${SRC} ${TGT}',
                 shell=True,
                 source=src,
                 install_path=os.path.dirname(bld.EXPAND_VARIABLES('${MANDIR}/'+manpage)),
                 target=os.path.basename(manpage))
 
-    # 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
-    need_yapp_build = ('YAPP' in bld.env and (
+    # 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
+    # But we force the developer to use the pidl standalone build
+    # to regenerate the files.
+    # TODO: only warn in developer mode and if 'git diff HEAD'
+    #       shows a difference
+    warn_about_grammar_changes = ('PIDL_BUILD_WARNINGS' in bld.env and (
         bld.IS_NEWER('idl.yp', 'lib/Parse/Pidl/IDL.pm') or
         bld.IS_NEWER('expr.yp', 'lib/Parse/Pidl/Expr.pm')))
 
-    if need_yapp_build:
-        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
+    if warn_about_grammar_changes:
+        Logs.warn('''
+Pidl grammar files have changed. Please use the pidl standalone build
+to regenerate them with yapp.
+
+$ cd ../pidl
+$ perl Makefile.PL
+$ make lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
+$ git add lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
+$ git commit
+$ cd -
+
+If your 100% sure you haven't changed idl.yp and expr.yp
+try this to avoid this message:
+
+$ touch ../pidl/lib/Parse/Pidl/IDL.pm ../pidl/lib/Parse/Pidl/Expr.pm
+''')
+