mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
build: cope with the common gen_ndr files being in the git tree
This commit is contained in:
parent
9f47c0e7b7
commit
a9ea3d6fa5
@ -4,7 +4,10 @@ from TaskGen import before
|
||||
import Build, os
|
||||
from samba_utils import *
|
||||
|
||||
def SAMBA_PIDL(bld, pname, source, options='', output_dir='.'):
|
||||
def SAMBA_PIDL(bld, pname, source,
|
||||
options='',
|
||||
output_dir='.',
|
||||
symlink=False):
|
||||
'''Build a IDL file using pidl.
|
||||
This will produce up to 13 output files depending on the options used'''
|
||||
|
||||
@ -58,7 +61,21 @@ def SAMBA_PIDL(bld, pname, source, options='', output_dir='.'):
|
||||
|
||||
t.env.PIDL = "../pidl/pidl"
|
||||
t.env.OPTIONS = TO_LIST(options)
|
||||
t.env.OUTPUTDIR = bld.bldnode.name + '/' + bld.path.find_dir(output_dir).bldpath(t.env)
|
||||
|
||||
# this rather convoluted set of path calculations is to cope with the possibility
|
||||
# that gen_ndr is a symlink into the source tree. By doing this for the source3
|
||||
# gen_ndr directory we end up generating identical output in gen_ndr for the old
|
||||
# build system and the new one. That makes keeping things in sync much easier.
|
||||
# eventually we should drop the gen_ndr files in git, but in the meanwhile this works
|
||||
outdir = bld.bldnode.name + '/' + bld.path.find_dir(output_dir).bldpath(t.env)
|
||||
|
||||
if not os.path.lexists(outdir):
|
||||
link_source = os.path.normpath(os.path.join(bld.curdir,output_dir))
|
||||
link_source = os_path_relpath(link_source, os.path.dirname(outdir))
|
||||
os.symlink(link_source, outdir)
|
||||
|
||||
real_outputdir = os.path.realpath(outdir)
|
||||
t.env.OUTPUTDIR = os_path_relpath(real_outputdir, bld.bldnode.name + '/..')
|
||||
|
||||
if table_header_idx is not None:
|
||||
pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS')
|
||||
@ -68,10 +85,13 @@ def SAMBA_PIDL(bld, pname, source, options='', output_dir='.'):
|
||||
Build.BuildContext.SAMBA_PIDL = SAMBA_PIDL
|
||||
|
||||
|
||||
def SAMBA_PIDL_LIST(bld, name, source, options='', output_dir='.'):
|
||||
def SAMBA_PIDL_LIST(bld, name, source,
|
||||
options='',
|
||||
output_dir='.',
|
||||
symlink=False):
|
||||
'''A wrapper for building a set of IDL files'''
|
||||
for p in TO_LIST(source):
|
||||
bld.SAMBA_PIDL(name, p, options=options, output_dir=output_dir)
|
||||
bld.SAMBA_PIDL(name, p, options=options, output_dir=output_dir, symlink=symlink)
|
||||
Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST
|
||||
|
||||
|
||||
|
@ -1,4 +1,11 @@
|
||||
bld.SAMBA_PIDL_LIST('PIDL_COMMON',
|
||||
# note that we use symlink=True for the common IDL files.
|
||||
# this is because the gen_ndr output is committed in git,
|
||||
# and we don't want the result of a waf build to be a large
|
||||
# git diff of all of the changes in include paths in the gen_ndr directory
|
||||
# by using a symlink, we end up putting the generated files (and the associated
|
||||
# object files) in ../gen_ndr in the source tree, but still allow waf to be
|
||||
# happy about all the build files appearing in the expected location in bin/default
|
||||
bld.SAMBA_PIDL_LIST('PIDL',
|
||||
'''atsvc.idl dcom.idl drsuapi.idl epmapper.idl initshutdown.idl
|
||||
misc.idl ntlmssp.idl protected_storage.idl schannel.idl trkwks.idl
|
||||
wmi.idl audiosrv.idl dfsblobs.idl dsbackup.idl eventlog.idl keysvc.idl
|
||||
@ -8,5 +15,8 @@ bld.SAMBA_PIDL_LIST('PIDL_COMMON',
|
||||
dbgidl.idl dnsserver.idl echo.idl frsrpc.idl lsa.idl nbt.idl
|
||||
oxidresolver.idl samr.idl srvsvc.idl winreg.idl dcerpc.idl
|
||||
drsblobs.idl efs.idl frstrans.idl mgmt.idl netlogon.idl
|
||||
policyagent.idl scerpc.idl svcctl.idl wkssvc.idl''')
|
||||
policyagent.idl scerpc.idl svcctl.idl wkssvc.idl''',
|
||||
options='--header --ndr-parser --samba3-ndr-server --samba3-ndr-client --server --client --python --dcom-proxy --com-header',
|
||||
output_dir='../gen_ndr',
|
||||
symlink=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user