summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-04 16:19:29 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-10-05 00:38:34 +0200
commit017196ad8501bd44bbfedfff9c8e24d801426df7 (patch)
tree2d8fe60e2f84e47211e9ea944ed826bbb7bce685
parent9eab95bd08cf63b63de63ed8dc88ca3a40345b19 (diff)
downloadsamba-017196ad8501bd44bbfedfff9c8e24d801426df7.tar.gz
samba-017196ad8501bd44bbfedfff9c8e24d801426df7.tar.bz2
samba-017196ad8501bd44bbfedfff9c8e24d801426df7.zip
heimdal-build: Add custom heimdal generator.
-rw-r--r--source4/heimdal_build/wscript_build39
1 files changed, 32 insertions, 7 deletions
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index c451f85f16..2f58a8f207 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -180,7 +180,32 @@ def HEIMDAL_LIBRARY(bld, libname, source, deps,
Build.BuildContext.HEIMDAL_LIBRARY = HEIMDAL_LIBRARY
-bld.SAMBA_GENERATOR(
+def HEIMDAL_GENERATOR(bld, name, rule, source='', target='',
+ group='generators', enabled=True,
+ vars=None):
+ '''A generic source generator target'''
+
+ if not SET_TARGET_TYPE(bld, name, 'GENERATOR'):
+ return
+
+ if not enabled:
+ return
+
+ bld.SET_BUILD_GROUP(group)
+ t = bld(
+ rule=rule,
+ source=bld.EXPAND_VARIABLES(source, vars=vars),
+ target=target,
+ shell=isinstance(rule, str),
+ on_results=True,
+ before='cc',
+ ext_out='.c',
+ name=name)
+
+ return t
+Build.BuildContext.HEIMDAL_GENERATOR = HEIMDAL_GENERATOR
+
+bld.HEIMDAL_GENERATOR(
name="HEIMDAL_ERRORLIST",
rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
source = '../heimdal/lib/wind/gen-errorlist.py ../heimdal/lib/wind/rfc3454.txt ../heimdal/lib/wind/stringprep.py',
@@ -188,21 +213,21 @@ bld.SAMBA_GENERATOR(
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
name = 'HEIMDAL_NORMALIZE_TABLE',
rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[2].abspath()} ${SRC[1].parent.abspath(env)}",
source = '../heimdal/lib/wind/gen-normalize.py ../heimdal/lib/wind/UnicodeData.txt ../heimdal/lib/wind/CompositionExclusions-3.2.0.txt',
target = '../heimdal/lib/wind/normalize_table.h ../heimdal/lib/wind/normalize_table.c'
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
name = 'HEIMDAL_COMBINING_TABLE',
rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
source = '../heimdal/lib/wind/gen-combining.py ../heimdal/lib/wind/UnicodeData.txt',
target = '../heimdal/lib/wind/combining_table.h ../heimdal/lib/wind/combining_table.c'
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
name = 'HEIMDAL_BIDI_TABLE',
rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
source = '../heimdal/lib/wind/gen-bidi.py ../heimdal/lib/wind/rfc3454.txt',
@@ -210,7 +235,7 @@ bld.SAMBA_GENERATOR(
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
name = 'HEIMDAL_MAP_TABLE',
rule="${PYTHON} ${SRC[0].abspath()} ${SRC[2].abspath()} ${SRC[2].parent.abspath(env)}",
source = '../heimdal/lib/wind/gen-map.py ../heimdal/lib/wind/stringprep.py ../heimdal/lib/wind/rfc3454.txt',
@@ -485,7 +510,7 @@ bld.HEIMDAL_LIBRARY('gssapi',
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
name="HEIMDAL_IFADDRS_H",
rule="rm -f ${TGT} && ln ${SRC} ${TGT}",
source = 'ifaddrs.hin',
@@ -493,7 +518,7 @@ bld.SAMBA_GENERATOR(
enabled = not bld.CONFIG_SET('HAVE_IFADDRS_H')
)
-bld.SAMBA_GENERATOR(
+bld.HEIMDAL_GENERATOR(
group='build_compiler_source',
name="HEIMDAL_ERR_H",
rule="rm -f ${TGT} && ln ${SRC} ${TGT}",