wafsamba: remove hardcoded '..' and '/default/' from SAMBA_PIDL()
authorStefan Metzmacher <metze@samba.org>
Thu, 15 Nov 2018 11:51:37 +0000 (12:51 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 20 Nov 2018 00:33:34 +0000 (01:33 +0100)
This makes it possible to remove some move waf 1.8 compat code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_pidl.py

index 2ff2c0dc64dbc724463d8ca1e14c2b3a75f97976..8073229bdd6fa920a506bd3984e67c2fc262184f 100644 (file)
@@ -76,7 +76,7 @@ def SAMBA_PIDL(bld, pname, source,
         else:
             cc = 'CC="%s"' % bld.CONFIG_GET("CC")
 
-    t = bld(rule='cd .. && %s %s ${PERL} "${PIDL}" --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${SRC[0].abspath(env)}"' % (cpp, cc),
+    t = bld(rule='cd ${PIDL_LAUNCH_DIR} && %s %s ${PERL} ${PIDL} --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${IDLSRC}"' % (cpp, cc),
             ext_out    = '.c',
             before     = 'c',
             update_outputs = True,
@@ -89,9 +89,13 @@ def SAMBA_PIDL(bld, pname, source,
     # prime the list of nodes we are dependent on with the cached pidl sources
     t.allnodes = pidl_src_nodes
 
-    t.env.PIDL = os.path.join(bld.srcnode.abspath(), 'pidl/pidl')
+    t.env.PIDL_LAUNCH_DIR = bld.srcnode.path_from(bld.bldnode.parent)
+    pnode = bld.srcnode.find_resource('pidl/pidl')
+    t.env.PIDL = pnode.path_from(bld.srcnode)
     t.env.OPTIONS = TO_LIST(options)
-    t.env.OUTPUTDIR = bld.bldnode.parent.name + '/default/' + bld.path.find_dir(output_dir).path_from(bld.srcnode)
+    snode = t.path.find_resource(source[0])
+    t.env.IDLSRC = snode.path_from(bld.srcnode)
+    t.env.OUTPUTDIR = bld.bldnode.path_from(bld.srcnode) + '/' + bld.path.find_dir(output_dir).path_from(bld.srcnode)
 
     if generate_tables and table_header_idx is not None:
         pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS')