[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sun Oct 3 08:25:14 MDT 2010


The branch, master has been updated
       via  120f5ee wafsamba: Some reformatting.
       via  257e259 heimdal: Move asn1 list to heimdal_build.
       via  dd5a91b heimdal: Move SAMBA_ERRTABLE to heimdal_build.
       via  8e5a9e7 heimdal: Move autoproto code to heimdal_build.
       via  3c1eca1 wafsamba: Move heimdal library code to heimdal_build.
       via  958d7a5 land: Inherit EMAIL from the environment.
       via  88d08c1 pidl: Allow longs for bitmasks.
       via  b7acb8e pidl: simplify some generated code.
       via  9aa90b6 heimdal: Convert hx509 to library.
       via  beed95e heimdal: convert some subsystems to libraries, consistent with upstream heimdal.
      from  e2eae17 Make sure REG_SZ is properly written to a .reg file (not as hex(1)), fix trailing comma REG_BINARY.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 120f5ee429eabc84a36434854fb0a194cc1312e1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 16:25:34 2010 +0200

    wafsamba: Some reformatting.

commit 257e259a26031945243dcd08ba739614ddaf695b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 16:08:13 2010 +0200

    heimdal: Move asn1 list to heimdal_build.

commit dd5a91b4372daf3c098348881d04496918ddf097
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 16:04:34 2010 +0200

    heimdal: Move SAMBA_ERRTABLE to heimdal_build.

commit 8e5a9e7721a966ce1491f727d25ab3f0b8e8fa58
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 16:01:58 2010 +0200

    heimdal: Move autoproto code to heimdal_build.

commit 3c1eca124e791207d3afa9511d9a9201dfd933b7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 15:59:21 2010 +0200

    wafsamba: Move heimdal library code to heimdal_build.

commit 958d7a5710e52bbb04d5db79a6b2c0e1dab0e355
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 15:06:51 2010 +0200

    land: Inherit EMAIL from the environment.

commit 88d08c172c46fa218eaf9347736e9754be9bce40
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 15:00:33 2010 +0200

    pidl: Allow longs for bitmasks.

commit b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 14:38:12 2010 +0200

    pidl: simplify some generated code.

commit 9aa90b6cef5d8a6219ab3a6f6f2de55d52f88f62
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 07:10:58 2010 +0200

    heimdal: Convert hx509 to library.

commit beed95e3a2ae4460e80294fc43ef3d916c7f7454
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Oct 3 06:58:39 2010 +0200

    heimdal: convert some subsystems to libraries, consistent with upstream heimdal.

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_asn1.py      |  109 -----
 buildtools/wafsamba/samba_autoproto.py |   23 -
 buildtools/wafsamba/samba_errtable.py  |   27 --
 buildtools/wafsamba/samba_utils.py     |    4 +-
 buildtools/wafsamba/wafsamba.py        |    9 -
 pidl/lib/Parse/Pidl/Samba4/Python.pm   |   43 ++-
 script/land-remote.py                  |    3 +
 source4/heimdal_build/wscript_build    |  735 ++++++++++++++++++++------------
 source4/lib/ldb/wscript                |    2 +-
 source4/libcli/wscript_build           |    2 +-
 10 files changed, 487 insertions(+), 470 deletions(-)
 delete mode 100644 buildtools/wafsamba/samba_asn1.py
 delete mode 100644 buildtools/wafsamba/samba_errtable.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_asn1.py b/buildtools/wafsamba/samba_asn1.py
deleted file mode 100644
index eb17f6b..0000000
--- a/buildtools/wafsamba/samba_asn1.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# samba ASN1 rules
-
-import Build, os
-from samba_utils import *
-from samba_autoconf import *
-
-
-def SAMBA_ASN1(bld, name, source,
-               options='',
-               directory='',
-               option_file=None,
-               includes=''):
-    '''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)
-    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')
-
-    out_files = []
-    out_files.append("../heimdal/%s/asn1_%s_asn1.x" % (directory, bname))
-    out_files.append("../heimdal/%s/%s_asn1.hx" % (directory, bname))
-    out_files.append("../heimdal/%s/%s_asn1-priv.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 + ' && ${BLDBIN}/asn1_compile ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file ${SRC[0].abspath(env)} ${ASN1NAME}'
-
-    source = TO_LIST(source)
-    source.append('asn1_compile')
-
-    if option_file is not None:
-        source.append(option_file)
-
-    t = bld(rule=asn1_rule,
-            ext_out = '.x',
-            before = 'cc',
-            on_results = True,
-            shell = True,
-            source = source,
-            target = out_files,
-            name=name + '_ASN1')
-
-    t.env.ASN1NAME     = asn1name
-    t.env.ASN1OPTIONS  = options
-    t.env.BLDBIN       = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..'))
-    if option_file is not None:
-        t.env.OPTION_FILE = "--option-file=%s" % os.path.normpath(os.path.join(bld.curdir, option_file))
-
-    cfile = out_files[0][0:-2] + '.c'
-    hfile = out_files[1][0:-3] + '.h',
-    hpriv = out_files[2][0:-3] + '.h',
-
-    # now generate a .c file from the .x file
-    t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''',
-            source = out_files[0],
-            target = cfile,
-            shell = True,
-            on_results=True,
-	    ext_out = '.c',
-            ext_in = '.x',
-            depends_on = name + '_ASN1',
-            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',
-            on_results=True,
-            target = hfile,
-            depends_on = name + '_ASN1',
-            name = name + '_H')
-
-    # and generate a .h file from the .hx file
-    t = bld(rule='cp ${SRC} ${TGT}',
-            source = out_files[2],
-            ext_out = '.c',
-            ext_in = '.x',
-            on_results=True,
-            target = hpriv,
-            depends_on = name + '_ASN1',
-            name = name + '_PRIV_H')
-
-    bld.SET_BUILD_GROUP('main')
-
-    includes = TO_LIST(includes)
-    includes.append(os.path.dirname(out_files[0]))
-
-    t = bld(features       = 'cc',
-            source         = cfile,
-            target         = name,
-            samba_cflags   = CURRENT_CFLAGS(bld, name, ''),
-            depends_on     = '',
-            samba_deps     = TO_LIST('HEIMDAL_ROKEN'),
-            samba_includes = includes,
-            local_include  = True)
-
-Build.BuildContext.SAMBA_ASN1 = SAMBA_ASN1
diff --git a/buildtools/wafsamba/samba_autoproto.py b/buildtools/wafsamba/samba_autoproto.py
index b9c6380..bb6400c 100644
--- a/buildtools/wafsamba/samba_autoproto.py
+++ b/buildtools/wafsamba/samba_autoproto.py
@@ -3,29 +3,6 @@
 import Build
 from samba_utils import *
 
-def HEIMDAL_AUTOPROTO(bld, header, source, options=None, group='prototypes'):
-    '''rule for heimdal prototype generation'''
-    bld.SET_BUILD_GROUP(group)
-    if options is None:
-        options='-q -P comment -o'
-    SET_TARGET_TYPE(bld, header, 'PROTOTYPE')
-    t = bld(rule='${PERL} ${HEIMDAL}/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}',
-            source=source,
-            target=header,
-            on_results=True,
-            ext_out='.c',
-            before='cc')
-    t.env.HEIMDAL = os.path.join(bld.srcnode.abspath(), 'source4/heimdal')
-    t.env.OPTIONS = options
-Build.BuildContext.HEIMDAL_AUTOPROTO = HEIMDAL_AUTOPROTO
-
-
-def HEIMDAL_AUTOPROTO_PRIVATE(bld, header, source):
-    '''rule for private heimdal prototype generation'''
-    bld.HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p')
-Build.BuildContext.HEIMDAL_AUTOPROTO_PRIVATE = HEIMDAL_AUTOPROTO_PRIVATE
-
-
 def SAMBA_AUTOPROTO(bld, header, source):
     '''rule for samba prototype generation'''
     bld.SET_BUILD_GROUP('prototypes')
diff --git a/buildtools/wafsamba/samba_errtable.py b/buildtools/wafsamba/samba_errtable.py
deleted file mode 100644
index 7848022..0000000
--- a/buildtools/wafsamba/samba_errtable.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# waf build tool for building .et files with compile_et
-import Build
-from samba_utils import *
-
-def SAMBA_ERRTABLE(bld, name, source):
-    '''Build a heimdal errtable from a .et file'''
-
-    bname = source[0:-3]; # strip off the .et suffix
-
-    if not SET_TARGET_TYPE(bld, name, 'ET'):
-        return
-
-    bld.SET_BUILD_GROUP('build_source')
-
-    out_files = []
-    out_files.append('%s.c' % bname)
-    out_files.append('%s.h' % bname)
-
-    t = bld(rule='${SRC[1].abspath(env)} . ${TGT[0].parent.abspath(env)} default/source4/heimdal_build/compile_et ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
-            ext_out = '.c',
-            before  = 'cc',
-            on_results = True,
-            shell   = True,
-            source  = [source, 'et_compile_wrapper.sh', 'compile_et'],
-            target  = out_files,
-            name    = name)
-Build.BuildContext.SAMBA_ERRTABLE = SAMBA_ERRTABLE
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index aa4fa20..d466cfa 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -16,9 +16,7 @@ def SET_TARGET_TYPE(ctx, target, value):
     '''set the target type of a target'''
     cache = LOCAL_CACHE(ctx, 'TARGET_TYPE')
     if target in cache and cache[target] != 'EMPTY':
-        Logs.error("ERROR: Target '%s' in directory %s re-defined as %s - was %s" % (target,
-                                                                                     ctx.curdir,
-                                                                                     value, cache[target]))
+        Logs.error("ERROR: Target '%s' in directory %s re-defined as %s - was %s" % (target, ctx.curdir, value, cache[target]))
         sys.exit(1)
     LOCAL_CACHE_SET(ctx, 'TARGET_TYPE', target, value)
     debug("task_gen: Target '%s' created of type '%s' in %s" % (target, value, ctx.curdir))
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 11de9d5..3da1e14 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -14,8 +14,6 @@ from samba_version import *
 from samba_autoconf import *
 from samba_patterns import *
 from samba_pidl import *
-from samba_errtable import *
-from samba_asn1 import *
 from samba_autoproto import *
 from samba_python import *
 from samba_deps import *
@@ -394,9 +392,6 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
                     cflags_end=None,
                     group='main',
                     init_function_sentinal=None,
-                    heimdal_autoproto=None,
-                    heimdal_autoproto_options=None,
-                    heimdal_autoproto_private=None,
                     autoproto=None,
                     autoproto_extra_source='',
                     depends_on='',
@@ -452,10 +447,6 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
     if cflags_end is not None:
         t.samba_cflags.extend(TO_LIST(cflags_end))
 
-    if heimdal_autoproto is not None:
-        bld.HEIMDAL_AUTOPROTO(heimdal_autoproto, source, options=heimdal_autoproto_options)
-    if heimdal_autoproto_private is not None:
-        bld.HEIMDAL_AUTOPROTO_PRIVATE(heimdal_autoproto_private, source)
     if autoproto is not None:
         bld.SAMBA_AUTOPROTO(autoproto, source + TO_LIST(autoproto_extra_source))
     if public_headers is not None:
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 45d33b8..b494ec9 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -506,7 +506,7 @@ sub PythonFunctionPackIn($$$)
 		if ($metadata_args->{in}->{$e->{NAME}}) {
 			my $py_var = "py_".$metadata_args->{in}->{$e->{NAME}};
 			$self->pidl("PY_CHECK_TYPE(&PyList_Type, $py_var, $fail);");
-			my $val = "PyList_Size($py_var)";
+			my $val = "PyList_GET_SIZE($py_var)";
 			if ($e->{LEVELS}[0]->{TYPE} eq "POINTER") {
 				$self->pidl("r->in.$e->{NAME} = talloc_ptrtype(r, r->in.$e->{NAME});");
 				$self->pidl("*r->in.$e->{NAME} = $val;");
@@ -844,19 +844,30 @@ sub ConvertObjectFromPythonData($$$$$$;$)
 	}
 
 	if ($actual_ctype->{TYPE} eq "ENUM" or $actual_ctype->{TYPE} eq "BITMAP") {
-		$self->pidl("PY_CHECK_TYPE(&PyInt_Type, $cvar, $fail);");
+		$self->pidl("if (PyLong_Check($cvar)) {");
+		$self->indent;
+		$self->pidl("$target = PyLong_AsLongLong($cvar);");
+		$self->deindent;
+		$self->pidl("} else if (PyInt_Check($cvar)) {");
+		$self->indent;
 		$self->pidl("$target = PyInt_AsLong($cvar);");
+		$self->deindent;
+		$self->pidl("} else {");
+		$self->indent;
+		$self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s\",\\");
+		$self->pidl("  PyInt_Type.tp_name, PyLong_Type.tp_name);");
+		$self->pidl($fail);
+		$self->deindent;
+		$self->pidl("}");
 		return;
 	}
 	if ($actual_ctype->{TYPE} eq "SCALAR" ) {
 		if (expandAlias($actual_ctype->{NAME}) =~ /^(u?int64|hyper|dlong|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
-			$self->pidl("if (PyObject_TypeCheck($cvar, &PyLong_Type)) {");
+			$self->pidl("if (PyLong_Check($cvar)) {");
 			$self->indent;
 			$self->pidl("$target = PyLong_AsLongLong($cvar);");
 			$self->deindent;
-			$self->pidl("} else {");
-			$self->indent;
-			$self->pidl("if (PyObject_TypeCheck($cvar, &PyInt_Type)) {");
+			$self->pidl("} else if (PyInt_Check($cvar)) {");
 			$self->indent;
 			$self->pidl("$target = PyInt_AsLong($cvar);");
 			$self->deindent;
@@ -867,8 +878,6 @@ sub ConvertObjectFromPythonData($$$$$$;$)
 			$self->pidl($fail);
 			$self->deindent;
 			$self->pidl("}");
-			$self->deindent;
-			$self->pidl("}");
 			return;
 		}
 		if (expandAlias($actual_ctype->{NAME}) =~ /^(char|u?int[0-9]*|time_t)$/) {
@@ -897,23 +906,23 @@ sub ConvertObjectFromPythonData($$$$$$;$)
 	}
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "DATA_BLOB") {
-		$self->pidl("$target = data_blob_talloc($mem_ctx, PyString_AsString($cvar), PyString_Size($cvar));");
+		$self->pidl("$target = data_blob_talloc($mem_ctx, PyString_AS_STRING($cvar), PyString_GET_SIZE($cvar));");
 		return;
 	}
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and 
 		($actual_ctype->{NAME} eq "string" or $actual_ctype->{NAME} eq "nbt_string" or $actual_ctype->{NAME} eq "nbt_name" or $actual_ctype->{NAME} eq "wrepl_nbt_name")) {
-		$self->pidl("$target = talloc_strdup($mem_ctx, PyString_AsString($cvar));");
+		$self->pidl("$target = talloc_strdup($mem_ctx, PyString_AS_STRING($cvar));");
 		return;
 	}
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "ipv4address") {
-		$self->pidl("$target = PyString_AsString($cvar);");
+		$self->pidl("$target = PyString_AS_STRING($cvar);");
 		return;
 	}
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "dnsp_name") {
-		$self->pidl("$target = PyString_AsString($cvar);");
+		$self->pidl("$target = PyString_AS_STRING($cvar);");
 		return;
 	}
 
@@ -982,11 +991,11 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
 			$self->pidl("if (PyUnicode_Check($py_var)) {");
 			$self->indent;
 			# FIXME: Use Unix charset setting rather than utf-8
-			$self->pidl($var_name . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
+			$self->pidl($var_name . " = PyString_AS_STRING(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
 			$self->deindent;
 			$self->pidl("} else if (PyString_Check($py_var)) {");
 			$self->indent;
-			$self->pidl($var_name . " = PyString_AsString($py_var);");
+			$self->pidl($var_name . " = PyString_AS_STRING($py_var);");
 			$self->deindent;
 			$self->pidl("} else {");
 			$self->indent;
@@ -1001,13 +1010,13 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
 			$self->indent;
 			$self->pidl("int $counter;");
 			if (ArrayDynamicallyAllocated($e, $l)) {
-				$self->pidl("$var_name = talloc_array_ptrtype($mem_ctx, $var_name, PyList_Size($py_var));");
+				$self->pidl("$var_name = talloc_array_ptrtype($mem_ctx, $var_name, PyList_GET_SIZE($py_var));");
 				$self->pidl("if (!$var_name) { $fail; }");
 				$self->pidl("talloc_set_name_const($var_name, \"ARRAY: $var_name\");");
 			}
-			$self->pidl("for ($counter = 0; $counter < PyList_Size($py_var); $counter++) {");
+			$self->pidl("for ($counter = 0; $counter < PyList_GET_SIZE($py_var); $counter++) {");
 			$self->indent;
-			$self->ConvertObjectFromPythonLevel($env, $var_name, "PyList_GetItem($py_var, $counter)", $e, GetNextLevel($e, $l), $var_name."[$counter]", $fail);
+			$self->ConvertObjectFromPythonLevel($env, $var_name, "PyList_GET_ITEM($py_var, $counter)", $e, GetNextLevel($e, $l), $var_name."[$counter]", $fail);
 			$self->deindent;
 			$self->pidl("}");
 			$self->deindent;
diff --git a/script/land-remote.py b/script/land-remote.py
index a705165..4a9c3fa 100755
--- a/script/land-remote.py
+++ b/script/land-remote.py
@@ -34,6 +34,9 @@ parser.add_option("--fail-slowly", help="continue running tests even after one h
 
 (opts, extra_args) = parser.parse_args()
 
+if opts.email is None and os.getenv("EMAIL") is not None:
+    opts.email = os.getenv("EMAIL")
+
 if not opts.foreground and not opts.email:
     print "Not running in foreground and --email not specified."
     sys.exit(1)
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index ae90f23..1b45fb7 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -1,5 +1,180 @@
 #!/usr/bin/env python
 
+import Build
+import os
+from samba_utils import SET_TARGET_TYPE, TO_LIST
+from samba_autoconf import CURRENT_CFLAGS
+
+# waf build tool for building .et files with compile_et
+
+def HEIMDAL_ASN1(bld, name, source,
+               options='',
+               directory='',
+               option_file=None,
+               includes=''):
+    '''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)
+    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')
+
+    out_files = []
+    out_files.append("../heimdal/%s/asn1_%s_asn1.x" % (directory, bname))
+    out_files.append("../heimdal/%s/%s_asn1.hx" % (directory, bname))
+    out_files.append("../heimdal/%s/%s_asn1-priv.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 + ' && ${BLDBIN}/asn1_compile ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file ${SRC[0].abspath(env)} ${ASN1NAME}'
+
+    source = TO_LIST(source)
+    source.append('asn1_compile')
+
+    if option_file is not None:
+        source.append(option_file)
+
+    t = bld(rule=asn1_rule,
+            ext_out = '.x',
+            before = 'cc',
+            on_results = True,
+            shell = True,
+            source = source,
+            target = out_files,
+            name=name + '_ASN1')
+
+    t.env.ASN1NAME     = asn1name
+    t.env.ASN1OPTIONS  = options
+    t.env.BLDBIN       = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..'))
+    if option_file is not None:
+        t.env.OPTION_FILE = "--option-file=%s" % os.path.normpath(os.path.join(bld.curdir, option_file))
+
+    cfile = out_files[0][0:-2] + '.c'
+    hfile = out_files[1][0:-3] + '.h',
+    hpriv = out_files[2][0:-3] + '.h',
+
+    # now generate a .c file from the .x file
+    t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''',
+            source = out_files[0],
+            target = cfile,
+            shell = True,
+            on_results=True,
+	    ext_out = '.c',
+            ext_in = '.x',
+            depends_on = name + '_ASN1',
+            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',
+            on_results=True,
+            target = hfile,
+            depends_on = name + '_ASN1',
+            name = name + '_H')
+
+    # and generate a .h file from the .hx file
+    t = bld(rule='cp ${SRC} ${TGT}',
+            source = out_files[2],
+            ext_out = '.c',
+            ext_in = '.x',
+            on_results=True,
+            target = hpriv,
+            depends_on = name + '_ASN1',
+            name = name + '_PRIV_H')
+
+    bld.SET_BUILD_GROUP('main')
+
+    includes = TO_LIST(includes)
+    includes.append(os.path.dirname(out_files[0]))
+
+    t = bld(features       = 'cc',
+            source         = cfile,
+            target         = name,
+            samba_cflags   = CURRENT_CFLAGS(bld, name, ''),
+            depends_on     = '',
+            samba_deps     = TO_LIST('HEIMDAL_ROKEN'),
+            samba_includes = includes,
+            local_include  = True)
+
+Build.BuildContext.HEIMDAL_ASN1 = HEIMDAL_ASN1
+
+def HEIMDAL_ERRTABLE(bld, name, source):
+    '''Build a heimdal errtable from a .et file'''
+
+    bname = source[0:-3]; # strip off the .et suffix
+
+    if not SET_TARGET_TYPE(bld, name, 'ET'):
+        return
+
+    bld.SET_BUILD_GROUP('build_source')
+
+    out_files = []
+    out_files.append('%s.c' % bname)
+    out_files.append('%s.h' % bname)
+
+    t = bld(rule='${SRC[1].abspath(env)} . ${TGT[0].parent.abspath(env)} default/source4/heimdal_build/compile_et ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
+            ext_out = '.c',
+            before  = 'cc',
+            on_results = True,
+            shell   = True,
+            source  = [source, 'et_compile_wrapper.sh', 'compile_et'],
+            target  = out_files,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list