diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-17 21:55:11 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-06 20:26:47 +1000 |
commit | 7c3234c4854f904e41c69b3c25fa3bcdce765cb7 (patch) | |
tree | 1a3e37ecd48832743645f028f2210e876c5b30a7 | |
parent | d01f75c72df6c49c2898f5f26dbffac7a55ac3bd (diff) | |
download | samba-7c3234c4854f904e41c69b3c25fa3bcdce765cb7.tar.gz samba-7c3234c4854f904e41c69b3c25fa3bcdce765cb7.tar.bz2 samba-7c3234c4854f904e41c69b3c25fa3bcdce765cb7.zip |
build: enable ENFORCE_GROUP_ORDERING()
also fixed ASN1 target names
-rw-r--r-- | buildtools/wafsamba/samba_asn1.py | 90 | ||||
-rw-r--r-- | buildtools/wafsamba/samba_autoproto.py | 1 | ||||
-rw-r--r-- | source4/lib/registry/wscript_build | 70 | ||||
-rw-r--r-- | source4/wscript_build | 1 |
4 files changed, 161 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_asn1.py b/buildtools/wafsamba/samba_asn1.py new file mode 100644 index 0000000000..3af43b8912 --- /dev/null +++ b/buildtools/wafsamba/samba_asn1.py @@ -0,0 +1,90 @@ +# samba ASN1 rules + +from TaskGen import taskgen, before +import Build, os, string, Utils +from samba_utils import * + + +# not sure if we need this exec_rule stuff ..., i'll leave it in for now +@feature('asn1') +@before('exec_rule') +def add_comp(self): + y = self.bld.name_to_obj("asn1_compile", self.env) + y.post() + + +def SAMBA_ASN1(bld, name, source, + options='', + directory='', + option_file=None): + '''Build a ASN1 file using the asn1 compiler. + This will produce 2 output files''' + bname = os.path.basename(source)[0:-5]; + dname = os.path.dirname(source) + name = "ASN1_%s" % bname.upper() + asn1name = "%s_asn1" % bname + + if not SET_TARGET_TYPE(bld, name, 'ASN1'): + return + + # for ASN1 compilation, I always put it in build_source, as it doesn't make + # sense elsewhere + bld.SET_BUILD_GROUP('build_source') + + # old build system for spnego.asn1: + # /home/tnagy/samba_old/source4/./bin/asn1_compile --sequence=MechTypeList --one-code-file /home/tnagy/samba_old/source4/heimdal/lib/gssapi/spnego/spnego.asn1 spnego_asn1 + + # new system: hmm, maybe options need to come earlier in the command line? We put them later + # /home/tnagy/samba/source4/bin/asn1_compile --one-code-file /home/tnagy/samba/source4/heimdal/lib/gssapi/spnego/spnego.asn1 spnego_asn1 --sequence=MechTypeList + + out_files = [] + out_files.append("../heimdal/%s/asn1_%s_asn1.x" % (directory, bname)) + out_files.append("../heimdal/%s/%s_asn1.hx" % (directory, bname)) + + # the ${TGT[0].parent.abspath(env)} expression gives us the parent directory of + # the first target in the build directory + # SRC[0].abspath(env) gives the absolute path to the source directory for the first + # source file. Note that in the case of a option_file, we have more than + # one source file + cd_rule = 'cd ${TGT[0].parent.abspath(env)}' + asn1_rule = cd_rule + ' && ${ASN1COMPILER} ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file ${SRC[0].abspath(env)} ${ASN1NAME}' + + if option_file is not None: + source = [ source, option_file ] + + t = bld(rule=asn1_rule, + features = 'asn1', + ext_out = '.x', + before = 'cc', + shell = True, + source = source, + target = out_files, + name=name) + + t.env.ASN1NAME = asn1name + t.env.ASN1OPTIONS = options + t.env.ASN1COMPILER = os.path.join(os.environ.get('PWD'), 'bin/asn1_compile') + if option_file is not None: + t.env.OPTION_FILE = "--option-file=%s" % os.path.normpath(os.path.join(bld.curdir, option_file)) + + + # now generate a .c file from the .x file + t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''', + source = out_files[0], + target = out_files[0][0:-2] + '.c', + shell = True, + ext_out = '.c', + ext_in = '.x', + depends_on = name, + name = name + "_C") + + # and generate a .h file from the .hx file + t = bld(rule='cp ${SRC} ${TGT}', + source = out_files[1], + ext_out = '.c', + ext_in = '.x', + target = out_files[1][0:-3] + '.h', + depends_on = name, + name = name + "_H") + +Build.BuildContext.SAMBA_ASN1 = SAMBA_ASN1 diff --git a/buildtools/wafsamba/samba_autoproto.py b/buildtools/wafsamba/samba_autoproto.py index ab21a1e1a7..19e4dbf94e 100644 --- a/buildtools/wafsamba/samba_autoproto.py +++ b/buildtools/wafsamba/samba_autoproto.py @@ -28,7 +28,6 @@ def SAMBA_AUTOPROTO(bld, header, source): ext_out='.c', rule = '../script/mkproto.pl --srcdir=.. --builddir=. --public=/dev/null --private=${TGT} ${SRC}' ) - print "Added AUTOPROTO target %s" % header Build.BuildContext.SAMBA_AUTOPROTO = SAMBA_AUTOPROTO diff --git a/source4/lib/registry/wscript_build b/source4/lib/registry/wscript_build new file mode 100644 index 0000000000..d6a40b8569 --- /dev/null +++ b/source4/lib/registry/wscript_build @@ -0,0 +1,70 @@ +bld.SAMBA_PIDL_TDR('PIDL_REG', + source='regf.idl') + +bld.SAMBA_SUBSYSTEM('TDR_REGF', + source='tdr_regf.c', + public_deps='TDR' + ) + + +bld.SAMBA_LIBRARY('registry', + source='interface.c util.c samba.c patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c dir.c rpc.c', + # PC_FILES='registry.pc', + public_deps='LIBSAMBA-UTIL CHARSET TDR_REGF ldb RPC_NDR_WINREG LDB_WRAP', + public_headers='registry.h', + vnum='0.0.1' + ) + + +bld.SAMBA_SUBSYSTEM('registry_common', + source='tools/common.c', + autoproto='tools/common.h', + public_deps='registry' + ) + + +bld.SAMBA_BINARY('regdiff', + source='tools/regdiff.c', + manpages='man/regdiff.1', + installdir='BINDIR', + deps='LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS' + ) + + +bld.SAMBA_BINARY('regpatch', + source='tools/regpatch.c', + manpages='man/regpatch.1', + installdir='BINDIR', + deps='LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS registry_common' + ) + + +bld.SAMBA_BINARY('regshell', + source='tools/regshell.c', + manpages='man/regshell.1', + installdir='BINDIR', + deps='LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS SMBREADLINE registry_common' + ) + + +bld.SAMBA_BINARY('regtree', + source='tools/regtree.c', + manpages='man/regtree.1', + installdir='BINDIR', + deps='LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS registry_common' + ) + + +bld.SAMBA_SUBSYSTEM('torture_registry', + source='tests/generic.c hive.c tests/diff.c tests/registry.c', + autoproto='tests/proto.h', + deps='torture registry' + ) + + +bld.SAMBA_PYTHON('py_registry', + source='pyregistry.c', + public_deps='registry PYTALLOC pycredentials pyparam_util', + realname='samba/registry.so' + ) + diff --git a/source4/wscript_build b/source4/wscript_build index 831c3dcef7..aa834eea18 100644 --- a/source4/wscript_build +++ b/source4/wscript_build @@ -150,3 +150,4 @@ bld.BUILD_SUBDIR('../libcli/named_pipe_auth') bld.BUILD_SUBDIR('heimdal_build') bld.CHECK_DEPENDENCIES() +bld.ENFORCE_GROUP_ORDERING() |