summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-17 20:21:47 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:38 +1000
commit07eeed33f63754b4fa4ab629e52e423b04b59bb6 (patch)
tree167f6db8447741094edd288e0f3d39e086688c5d
parentbb1e36a86baa10be9241d22ce34b8eb9b5784577 (diff)
downloadsamba-07eeed33f63754b4fa4ab629e52e423b04b59bb6.tar.gz
samba-07eeed33f63754b4fa4ab629e52e423b04b59bb6.tar.bz2
samba-07eeed33f63754b4fa4ab629e52e423b04b59bb6.zip
build: heimdal_build waf support
heimdal now mostly builds
-rw-r--r--buildtools/mktowscript/mklist.txt2
-rwxr-xr-xbuildtools/mktowscript/mktowscript.pl385
-rwxr-xr-xbuildtools/mktowscript/rebuild_all.sh34
l---------buildtools/waf2
-rwxr-xr-xbuildtools/waf-1.5.13-fixedbin89817 -> 0 bytes
-rw-r--r--lib/replace/wafsamba.py309
-rw-r--r--source4/dsdb/wscript_build52
-rw-r--r--source4/heimdal_build/wscript_build304
-rw-r--r--source4/heimdal_build/wscript_configure37
-rw-r--r--source4/wscript_build81
10 files changed, 948 insertions, 258 deletions
diff --git a/buildtools/mktowscript/mklist.txt b/buildtools/mktowscript/mklist.txt
index 86f738bc2c..203c9a3ab3 100644
--- a/buildtools/mktowscript/mklist.txt
+++ b/buildtools/mktowscript/mklist.txt
@@ -28,7 +28,7 @@ source4/cldap_server/config.mk
source4/smb_server/config.mk
source4/smb_server/smb2/config.mk
source4/smb_server/smb/config.mk
-source4/smbd/config.mk
+source4/smbd/config.mk source4/smbd/process_model.mk
source4/kdc/config.mk
source4/dsdb/config.mk
source4/dsdb/samdb/ldb_modules/config.mk
diff --git a/buildtools/mktowscript/mktowscript.pl b/buildtools/mktowscript/mktowscript.pl
index 1db7297261..68fb7c69d3 100755
--- a/buildtools/mktowscript/mktowscript.pl
+++ b/buildtools/mktowscript/mktowscript.pl
@@ -3,10 +3,10 @@
use strict;
use Data::Dumper;
use File::Basename;
+use List::MoreUtils qw(uniq);
-my $filename=$ARGV[0];
-my $dname=dirname($filename);
my $globals;
+my $dname;
sub read_file($)
{
@@ -46,7 +46,9 @@ sub strlist($)
# these need to use the library names
$s =~ s/\bLIBLDB\b/ldb/g;
+ $s =~ s/\bLDB\b/ldb/g;
$s =~ s/\bLIBTALLOC\b/talloc/g;
+ $s =~ s/\bTALLOC\b/talloc/g;
$s =~ s/\bLIBTEVENT\b/tevent/g;
$s =~ s/\bRESOLV\b/resolv/g;
@@ -85,9 +87,9 @@ sub find_file($)
return $b if (-e $b);
return $f if (-e $f);
+
while ($f =~ /\//) {
$f =~ s/^[^\/]+\///g;
- #printf(STDERR "Trying $f in $dname\n");
return $f if (-e $f);
}
my $f2;
@@ -120,7 +122,11 @@ sub find_files($)
$f =~ s/^[.]\///;
$ret .= ' ' . $f;
}
- return strlist($ret);
+ $ret = strlist($ret);
+ my @list = split(/\s+/, $ret);
+ @list = uniq(@list);
+ $ret = trim(join(' ', @list));
+ return $ret;
}
sub read_config_mk($)
@@ -242,186 +248,195 @@ sub read_config_mk($)
}
-my $result = read_config_mk($filename);
-
-#print Dumper $result;
-
-print "# AUTOGENERATED by mktowscript.pl\n# Please remove this notice if hand editing\n\n";
-
-chdir($dname);
-
-foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}} keys %{$result}) {
- next if ($s eq "GLOBAL");
- my $sec = $result->{$s};
- if ($sec->{TYPE} eq "SUBCONFIG") {
- my $d = dirname($s);
- next if ($d eq ".");
- printf "bld.BUILD_SUBDIR('%s')\n", dirname($s);
- } else {
- printf "\nbld.SAMBA_%s('%s'", $sec->{TYPE}, $s;
- my $trailer="";
- my $got_src = 0;
-
- foreach my $k (keys %{$sec}) {
- #print "key=$k\n";
-
- next if ($k eq "SECNUMBER");
- next if ($k eq "TYPE");
- if ($k eq "INIT_FUNCTION") {
- $trailer .= sprintf(",\n\tinit_function='%s'", trim($sec->{$k}));
- next;
- }
- if ($k eq "INIT_FUNCTION_SENTINEL") {
- $trailer .= sprintf(",\n\tinit_function_sentinal='%s'", trim($sec->{$k}));
- next;
- }
- if ($k eq "_PY_FILES" ||
- $k eq "EPYDOC_OPTIONS" ||
- $k eq "COV_TARGET" ||
- $k eq "GCOV" ||
- $k eq "PC_FILES" ||
- $k eq "CONFIG4FILE" ||
- $k eq "LMHOSTSFILE4") {
- $trailer .= sprintf(",\n\t# %s='%s'", $k, trim($sec->{$k}));
- next;
- }
- if ($k eq "SUBSYSTEM") {
- $trailer .= sprintf(",\n\tsubsystem='%s'", trim($sec->{$k}));
- next;
- }
- if ($k eq "PRIVATE_DEPENDENCIES") {
- $trailer .= sprintf(",\n\tdeps='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "PUBLIC_DEPENDENCIES") {
- $trailer .= sprintf(",\n\tpublic_deps='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "ALIASES") {
- $trailer .= sprintf(",\n\taliases='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "CFLAGS") {
- $trailer .= sprintf(",\n\tcflags='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "OPTIONS") {
- $trailer .= sprintf(",\n\toptions='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "DIRECTORY") {
- $trailer .= sprintf(",\n\tdirectory='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "LDFLAGS") {
- $trailer .= sprintf(",\n\tldflags='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "INSTALLDIR") {
- $trailer .= sprintf(",\n\tinstalldir='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "ASN1C") {
- $trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "ET_COMPILER") {
- $trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "ENABLE") {
- my $v = strlist($sec->{$k});
- if ($v eq "NO") {
- $trailer .= sprintf(",\n\tenabled=False");
- next;
- }
- next if ($v eq "YES");
- die("Unknown ENABLE value $v in $s\n");
- }
- if ($k eq "USE_HOSTCC") {
- my $v = strlist($sec->{$k});
- if ($v eq "YES") {
- $trailer .= sprintf(",\n\tuse_hostcc=True");
- next;
- }
- next if ($v eq "NO");
- die("Unknown HOST_CC value $v in $s\n");
- }
- if ($k eq "$s" . "_VERSION") {
- $trailer .= sprintf(",\n\tvnum='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "$s" . "_SOVERSION") {
- next;
- }
- if ($k eq "LIBRARY_REALNAME") {
- $trailer .= sprintf(",\n\trealname='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "OUTPUT_TYPE") {
- $trailer .= sprintf(",\n\toutput_type='%s'", strlist($sec->{$k}));
- next;
- }
- if ($k eq "AUTOPROTO") {
- my $list = trim(find_files(strlist($sec->{$k})));
- $trailer .= sprintf(",\n\tautoproto='%s'", $list);
- next;
- }
- if ($k eq "PUBLIC_HEADERS") {
- my $list = trim(strlist($sec->{$k}));
- if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
- $list = trim("$1 $2");
- $list = find_files($list);
- } else {
- $list = trim(find_files(strlist($sec->{$k})));
- }
- $trailer .= sprintf(",\n\tpublic_headers='%s'", $list);
- next;
- }
- if ($k eq "MANPAGES") {
- my $list = trim(find_files(strlist($sec->{$k})));
- $trailer .= sprintf(",\n\tmanpages='%s'", $list);
- next;
- }
- if ($k eq "$s" . "_OBJ_FILES") {
- my $list = trim(strlist($sec->{$k}));
- $list =~ s/\.o/.c/g;
- if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
- $list = trim("$1 $2");
- $list = find_files($list);
- $list = "'$list'";
- } elsif ($list =~ /\$\(addprefix \$\((\w+)\)(.*),(.*)\)(.*)$/) {
- my $src = trim($3);
- my $dir = "$1$2";
- $dir =~ s/\/$//;
- my $res = "bld.SUBDIR('$dir', '$src')";
- if ($4) {
- $res = "$res + '$4'";
- }
- $list = $res;
- } else {
- $list = find_files($list);
- $list="'$list'";
- }
- $list =~ s/\$\(\w+srcdir\)\///g;
- printf(",\n\t%s", $list);
- $got_src = 1;
- next;
- }
- if ($k eq "HEIMDAL_GSSAPI_KRB5_OBJ_FILES" ||
- $k eq "HEIMDAL_GSSAPI_SPNEGO_OBJ_FILES" ||
- $k eq "HEIMDAL_HEIM_ASN1_DER_OBJ_FILES" ||
- $k eq "HEIMDAL_HX509_OBJH_FILES" ||
- $k eq "HEIMDAL_HX509_OBJG_FILES" ||
- $k eq "HEIMDAL_ROKEN_OBJ_FILES"
- ) {
- next;
- }
- die("Unknown keyword $k in $s\n");
- }
- die("No source list in $s\n") unless $got_src;
- printf("%s\n\t)\n\n", $trailer);
- }
+sub process_results($)
+{
+ my $result = shift;
+
+ foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}} keys %{$result}) {
+ next if ($s eq "GLOBAL");
+ my $sec = $result->{$s};
+ if ($sec->{TYPE} eq "SUBCONFIG") {
+ my $d = dirname($s);
+ next if ($d eq ".");
+ printf "bld.BUILD_SUBDIR('%s')\n", dirname($s);
+ } else {
+ printf "\nbld.SAMBA_%s('%s'", $sec->{TYPE}, $s;
+ my $trailer="";
+ my $got_src = 0;
+
+ foreach my $k (keys %{$sec}) {
+ #print "key=$k\n";
+
+ next if ($k eq "SECNUMBER");
+ next if ($k eq "TYPE");
+ if ($k eq "INIT_FUNCTION") {
+ $trailer .= sprintf(",\n\tinit_function='%s'", trim($sec->{$k}));
+ next;
+ }
+ if ($k eq "INIT_FUNCTION_SENTINEL") {
+ $trailer .= sprintf(",\n\tinit_function_sentinal='%s'", trim($sec->{$k}));
+ next;
+ }
+ if ($k eq "_PY_FILES" ||
+ $k eq "EPYDOC_OPTIONS" ||
+ $k eq "COV_TARGET" ||
+ $k eq "GCOV" ||
+ $k eq "PC_FILES" ||
+ $k eq "CONFIG4FILE" ||
+ $k eq "LMHOSTSFILE4") {
+ $trailer .= sprintf(",\n\t# %s='%s'", $k, trim($sec->{$k}));
+ next;
+ }
+ if ($k eq "SUBSYSTEM") {
+ $trailer .= sprintf(",\n\tsubsystem='%s'", trim($sec->{$k}));
+ next;
+ }
+ if ($k eq "PRIVATE_DEPENDENCIES") {
+ $trailer .= sprintf(",\n\tdeps='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "PUBLIC_DEPENDENCIES") {
+ $trailer .= sprintf(",\n\tpublic_deps='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "ALIASES") {
+ $trailer .= sprintf(",\n\taliases='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "CFLAGS") {
+ $trailer .= sprintf(",\n\tcflags='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "OPTIONS") {
+ $trailer .= sprintf(",\n\toptions='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "DIRECTORY") {
+ $trailer .= sprintf(",\n\tdirectory='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "LDFLAGS") {
+ $trailer .= sprintf(",\n\tldflags='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "INSTALLDIR") {
+ $trailer .= sprintf(",\n\tinstalldir='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "ASN1C") {
+ $trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "ET_COMPILER") {
+ $trailer .= sprintf(",\n\tcompiler='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "ENABLE") {
+ my $v = strlist($sec->{$k});
+ if ($v eq "NO") {
+ $trailer .= sprintf(",\n\tenabled=False");
+ next;
+ }
+ next if ($v eq "YES");
+ die("Unknown ENABLE value $v in $s\n");
+ }
+ if ($k eq "USE_HOSTCC") {
+ my $v = strlist($sec->{$k});
+ if ($v eq "YES") {
+ $trailer .= sprintf(",\n\tuse_hostcc=True");
+ next;
+ }
+ next if ($v eq "NO");
+ die("Unknown HOST_CC value $v in $s\n");
+ }
+ if ($k eq "$s" . "_VERSION") {
+ $trailer .= sprintf(",\n\tvnum='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "$s" . "_SOVERSION") {
+ next;
+ }
+ if ($k eq "LIBRARY_REALNAME") {
+ $trailer .= sprintf(",\n\trealname='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "OUTPUT_TYPE") {
+ $trailer .= sprintf(",\n\toutput_type='%s'", strlist($sec->{$k}));
+ next;
+ }
+ if ($k eq "AUTOPROTO") {
+ my $list = trim(find_files(strlist($sec->{$k})));
+ $trailer .= sprintf(",\n\tautoproto='%s'", $list);
+ next;
+ }
+ if ($k eq "PUBLIC_HEADERS") {
+ my $list = trim(strlist($sec->{$k}));
+ if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
+ $list = trim("$1 $2");
+ $list = find_files($list);
+ } else {
+ $list = trim(find_files(strlist($sec->{$k})));
+ }
+ $trailer .= sprintf(",\n\tpublic_headers='%s'", $list);
+ next;
+ }
+ if ($k eq "MANPAGES") {
+ my $list = trim(find_files(strlist($sec->{$k})));
+ $trailer .= sprintf(",\n\tmanpages='%s'", $list);
+ next;
+ }
+ if ($k eq "$s" . "_OBJ_FILES") {
+ my $list = trim(strlist($sec->{$k}));
+ $list =~ s/\.o/.c/g;
+ $list =~ s/\.ho/.c/g;
+ if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
+ $list = trim("$1 $2");
+ $list = find_files($list);
+ $list = "'$list'";
+ } elsif ($list =~ /\$\(addprefix \$\((\w+)\)(.*),(.*)\)(.*)$/) {
+ my $src = trim($3);
+ my $dir = "$1$2";
+ $dir =~ s/\/$//;
+ my $res = "bld.SUBDIR('$dir', '$src')";
+ if ($4) {
+ $res = "$res + '$4'";
+ }
+ $list = $res;
+ } else {
+ $list = find_files($list);
+ $list="'$list'";
+ }
+ $list =~ s/\$\(\w+srcdir\)\///g;
+ printf(",\n\t%s", $list);
+ $got_src = 1;
+ next;
+ }
+ if ($k eq "HEIMDAL_GSSAPI_KRB5_OBJ_FILES" ||
+ $k eq "HEIMDAL_GSSAPI_SPNEGO_OBJ_FILES" ||
+ $k eq "HEIMDAL_HEIM_ASN1_DER_OBJ_FILES" ||
+ $k eq "HEIMDAL_HX509_OBJH_FILES" ||
+ $k eq "HEIMDAL_HX509_OBJG_FILES" ||
+ $k eq "HEIMDAL_ROKEN_OBJ_FILES"
+ ) {
+ next;
+ }
+ die("Unknown keyword $k in $s\n");
+ }
+ die("No source list in $s\n") unless $got_src;
+ printf("%s\n\t)\n\n", $trailer);
+ }
+ }
+}
+
+for (my $i=0; $i <= $#ARGV; $i++) {
+ my $filename=$ARGV[$i];
+ $dname=dirname($filename);
+ my $result = read_config_mk($filename);
+ if ($i != 0) {
+ print "\n\n\n";
+ }
+ print "# AUTOGENERATED by mktowscript.pl from $filename\n# Please remove this notice if hand editing\n\n";
+ die("Unable to chdir to $dname\n") unless chdir($dname);
+ process_results($result);
}
-#print Dumper $result;
diff --git a/buildtools/mktowscript/rebuild_all.sh b/buildtools/mktowscript/rebuild_all.sh
index 5209eee50b..23622b2abe 100755
--- a/buildtools/mktowscript/rebuild_all.sh
+++ b/buildtools/mktowscript/rebuild_all.sh
@@ -1,21 +1,29 @@
#!/bin/bash
cat mklist.txt |
-while read f; do
- echo "Processing $f"
- f="../../$f"
- test -f $f || {
- echo "$f doesn't exist"
- exit 1
- }
- ws="$(dirname $f)/wscript_build"
- if [ -f $ws ]; then
- if ! grep "AUTOGENERATED.by.mktowscript" $ws > /dev/null; then
- echo "Skipping manually edited file $ws"
- continue
+while read line; do
+ ws=""
+ list=""
+ for f in $line; do
+ echo "Processing $f"
+ f="../../$f"
+ test -f $f || {
+ echo "$f doesn't exist"
+ exit 1
+ }
+ ws="$(dirname $f)/wscript_build"
+ if [ -f $ws ]; then
+ if test -s $ws && ! grep "AUTOGENERATED.by.mktowscript" $ws > /dev/null; then
+ echo "Skipping manually edited file $ws"
+ continue
+ fi
fi
+ list="$list $f"
+ done
+ if [ "$list" = "" ]; then
+ continue
fi
- ./mktowscript.pl $f > wscript_build.$$ || {
+ ./mktowscript.pl $list > wscript_build.$$ || {
echo "Failed on $f"
rm -f wscript_build.$$
exit 1
diff --git a/buildtools/waf b/buildtools/waf
index 50ecc12ebb..734fbd13a9 120000
--- a/buildtools/waf
+++ b/buildtools/waf
@@ -1 +1 @@
-waf-1.5.13-fixed \ No newline at end of file
+waf-1.5.13 \ No newline at end of file
diff --git a/buildtools/waf-1.5.13-fixed b/buildtools/waf-1.5.13-fixed
deleted file mode 100755
index a3849535c0..0000000000
--- a/buildtools/waf-1.5.13-fixed
+++ /dev/null
Binary files differ
diff --git a/lib/replace/wafsamba.py b/lib/replace/wafsamba.py
index 60a43ae989..80190f3904 100644
--- a/lib/replace/wafsamba.py
+++ b/lib/replace/wafsamba.py
@@ -1,8 +1,9 @@
# a waf tool to add autoconf-like macros to the configure section
# and for SAMBA_ macros for building libraries, binaries etc
-import Build, os, Logs, sys, Configure, Options
+import Build, os, Logs, sys, Configure, Options, string
from Configure import conf
+from Logs import debug
LIB_PATH="shared"
@@ -84,12 +85,12 @@ def CHECK_FUNCS_IN(conf, list, library, mandatory=False):
conf.ASSERT(not mandatory,
"Mandatory library '%s' not found for functions '%s'" % (library, list))
# if it isn't a mandatory library, then remove it from dependency lists
- cache = LOCAL_CACHE(conf, 'EMPTY_LIBS')
- cache[library.upper()] = True
+ LOCAL_CACHE_SET(conf, 'EMPTY_TARGETS', library.upper(), True)
return
for f in list.split():
conf.check(function_name=f, lib=library, header_name=conf.env.hlist)
conf.env['LIB_' + library.upper()] = library
+ LOCAL_CACHE_SET(conf, 'TARGET_TYPE', library, 'SYSLIB')
#################################################
@@ -132,7 +133,7 @@ def set_rpath(bld):
else:
bld.env['RPATH'] = []
else:
- rpath = os.path.normpath('%s/bin/%s' % (bld.curdir, LIB_PATH))
+ rpath = os.path.normpath('%s/%s' % (bld.env['BUILD_DIRECTORY'], LIB_PATH))
bld.env.append_value('RPATH', '-Wl,-rpath=%s' % rpath)
Build.BuildContext.set_rpath = set_rpath
@@ -149,6 +150,38 @@ def LOCAL_CACHE(ctx, name):
#############################################################
+# set a value in a local cache
+@conf
+def LOCAL_CACHE_SET(ctx, cachename, key, value):
+ cache = LOCAL_CACHE(ctx, cachename)
+ cache[key] = value
+
+#############################################################
+# set a value in a local cache
+# return False if it's already set
+def SET_TARGET_TYPE(ctx, target, value):
+ cache = LOCAL_CACHE(ctx, 'TARGET_TYPE')
+ if target in cache:
+ ASSERT(ctx, cache[target] == value,
+ "Target '%s' re-defined as %s - was %s" % (target, value, cache[target]))
+ debug("task_gen: Skipping duplicate target %s (curdir=%s)" % (target, ctx.curdir))
+ return False
+ assumed = LOCAL_CACHE(ctx, 'ASSUMED_TARGET')
+ if target in assumed:
+ #if assumed[target] != value:
+ # print "Target '%s' was assumed of type '%s' but is '%s'" % (target, assumed[target], value)
+ ASSERT(ctx, assumed[target] == value,
+ "Target '%s' was assumed of type '%s' but is '%s'" % (target, assumed[target], value))
+ predeclared = LOCAL_CACHE(ctx, 'PREDECLARED_TARGET')
+ if target in predeclared:
+ ASSERT(ctx, predeclared[target] == value,
+ "Target '%s' was predeclared of type '%s' but is '%s'" % (target, predeclared[target], value))
+ LOCAL_CACHE_SET(ctx, 'TARGET_TYPE', target, value)
+ debug("task_gen: Target '%s' created of type '%s' in %s" % (target, value, ctx.curdir))
+ return True
+
+
+#############################################################
# a build assert call
@conf
def ASSERT(ctx, expression, msg):
@@ -171,6 +204,7 @@ Build.BuildContext.SUBDIR = SUBDIR
@conf
def SAMBA_BUILD_ENV(conf):
libpath="%s/%s" % (conf.blddir, LIB_PATH)
+ conf.env['BUILD_DIRECTORY'] = conf.blddir
if not os.path.exists(libpath):
os.mkdir(libpath)
@@ -216,13 +250,43 @@ def FULL_DEPENDENCIES(bld, cache, target, chain, path):
# check our build dependencies for circular dependencies
def CHECK_TARGET_DEPENDENCY(bld, target):
cache = LOCAL_CACHE(bld, 'LIB_DEPS')
- FULL_DEPENDENCIES(bld, cache, target, { target:True }, target)
+ return FULL_DEPENDENCIES(bld, cache, target, { target:True }, target)
+
+############################################################
+# check that all dependencies have been declared
+def CHECK_DEPENDENCIES(bld):
+ cache = LOCAL_CACHE(bld, 'LIB_DEPS')
+ target_cache = LOCAL_CACHE(bld, 'TARGET_TYPE')
+ debug('deps: Checking dependencies')
+ for t in cache:
+ deps = CHECK_TARGET_DEPENDENCY(bld, t)
+ for d in deps:
+ #if not d in target_cache:
+ # print "Dependency '%s' of target '%s' not declared" % (d, t)
+ ASSERT(bld, d in target_cache,
+ "Dependency '%s' of target '%s' not declared" % (d, t))
+ debug("deps: Dependencies checked for %u targets" % len(target_cache))
+Build.BuildContext.CHECK_DEPENDENCIES = CHECK_DEPENDENCIES
+
+
+############################################################
+# pre-declare a target as being of a particular type
+def PREDECLARE(bld, target, type):
+ cache = LOCAL_CACHE(bld, 'PREDECLARED_TARGET')
+ target_cache = LOCAL_CACHE(bld, 'TARGET_TYPE')
+ ASSERT(bld, not target in target_cache, "Target '%s' is already declared" % target)
+ ASSERT(bld, not target in cache, "Target '%s' already predeclared" % target)
+ cache[target] = type
+Build.BuildContext.PREDECLARE = PREDECLARE
+
+
################################################################
# add to the dependency list. Return a new dependency list with
# any circular dependencies removed
# returns a tuple containing (systemdeps, localdeps)
def ADD_DEPENDENCIES(bld, name, deps):
+ debug('deps: Calculating dependencies for %s' % name)
cache = LOCAL_CACHE(bld, 'LIB_DEPS')
if not name in cache:
cache[name] = {}
@@ -234,24 +298,49 @@ def ADD_DEPENDENCIES(bld, name, deps):
CHECK_TARGET_DEPENDENCY(bld, name)
list2.append(d)
except AssertionError:
- print "Removing dependency %s from target %s" % (d, name)
+ debug("deps: Removing dependency %s from target %s" % (d, name))
del(cache[name][d])
# extract out the system dependencies
sysdeps = []
localdeps = []
- cache = LOCAL_CACHE(bld, 'EMPTY_LIBS')
+ add_objects = []
+ cache = LOCAL_CACHE(bld, 'EMPTY_TARGETS')
+ target_cache = LOCAL_CACHE(bld, 'TARGET_TYPE')
+ predeclare = LOCAL_CACHE(bld, 'PREDECLARED_TARGET')
for d in list2:
# strip out any dependencies on empty libraries
if d in cache:
- print "Removing dependence of '%s' on empty library '%s'" % (name, d)
+ debug("deps: Removing empty dependency '%s' from '%s'" % (d, name))
continue
- libname = 'LIB_%s' % d.upper()
- if libname in bld.env:
- sysdeps.append(d)
+ type = None
+
+ if d in target_cache:
+ type = target_cache[d]
+ elif d in predeclare:
+ type = predeclare[d]
else:
+ type = 'SUBSYSTEM'
+ LOCAL_CACHE_SET(bld, 'ASSUMED_TARGET', d, type)
+
+ if type == 'SYSLIB':
+ sysdeps.append(d)
+ elif type == 'LIBRARY':
localdeps.append(d)
- return (' '.join(sysdeps), ' '.join(localdeps))
+ elif type == 'SUBSYSTEM':
+ add_objects.append(d)
+ elif type == 'MODULE':
+ add_objects.append(d)
+ elif type == 'PYTHON':
+ pass
+ elif type == 'ASN1':
+ pass
+ else:
+ ASSERT(bld, False, "Unknown target type '%s' for dependency %s" % (
+ type, d))
+ debug('deps: Dependencies for %s: sysdeps: %u localdeps: %u add_objects=%u' % (
+ name, len(sysdeps), len(localdeps), len(add_objects)))
+ return (' '.join(sysdeps), ' '.join(localdeps), ' '.join(add_objects))
#################################################################
@@ -275,18 +364,15 @@ def SAMBA_LIBRARY(bld, libname, source_list,
vnum=None,
cflags=None,
autoproto=None):
- # print "Declaring SAMBA_LIBRARY %s" % libname
- #print "SAMBA_LIBRARY '%s' with deps '%s'" % (libname, deps)
+ if not SET_TARGET_TYPE(bld, libname, 'LIBRARY'):
+ return
# remember empty libraries, so we can strip the dependencies
if (source_list == '') or (source_list == []):
- cache = LOCAL_CACHE(bld, 'EMPTY_LIBS')
- cache[libname] = True
+ LOCAL_CACHE_SET(bld, 'EMPTY_TARGETS', libname, True)
return
- (sysdeps, localdeps) = ADD_DEPENDENCIES(bld, libname, deps)
-
- #print "SAMBA_LIBRARY: sysdeps='%s' deps='%s'" % (sysdeps, deps)
+ (sysdeps, localdeps, add_objects) = ADD_DEPENDENCIES(bld, libname, deps)
ilist = bld.SAMBA_LIBRARY_INCLUDE_LIST(deps) + bld.SUBDIR(bld.curdir, include_list)
ilist = bld.NORMPATH(ilist)
@@ -296,7 +382,8 @@ def SAMBA_LIBRARY(bld, libname, source_list,
target=libname,
uselib_local = localdeps,
uselib = sysdeps,
- includes='. ' + os.environ.get('PWD') + '/bin/default ' + ilist,
+ add_objects = add_objects,
+ includes='. ' + bld.env['BUILD_DIRECTORY'] + '/default ' + ilist,
vnum=vnum)
# put a link to the library in bin/shared
@@ -305,13 +392,12 @@ def SAMBA_LIBRARY(bld, libname, source_list,
soext = '.' + vnum.split('.')[0]
bld(
source = 'lib%s.so' % libname,
- target = '%s.lnk' % libname,
- rule = 'ln -sf ../${SRC}%s %s/lib%s.so%s && touch ${TGT}' %
+ rule = 'ln -sf ../${SRC}%s %s/lib%s.so%s' %
(soext, LIB_PATH, libname, soext),
- shell = True
+ shell = True,
+ after = 'cc_link',
)
- cache = LOCAL_CACHE(bld, 'INCLUDE_LIST')
- cache[libname] = ilist
+ LOCAL_CACHE_SET(bld, 'INCLUDE_LIST', libname, ilist)
Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY
@@ -330,15 +416,14 @@ def SAMBA_BINARY(bld, binname, source_list,
use_hostcc=None,
compiler=None,
manpages=None):
- ilist = '. ' + os.environ.get('PWD') + '/bin/default ' + bld.SAMBA_LIBRARY_INCLUDE_LIST(deps) + ' ' + include_list
+ ilist = '. ' + bld.env['BUILD_DIRECTORY'] + '/default ' + bld.SAMBA_LIBRARY_INCLUDE_LIST(deps) + ' ' + include_list
ilist = bld.NORMPATH(ilist)
ccflags = ''
- #print "SAMBA_BINARY '%s' with deps '%s'" % (binname, deps)
-
- (sysdeps, localdeps) = ADD_DEPENDENCIES(bld, binname, deps)
+ if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
+ return
- #print "SAMBA_BINARY: sysdeps='%s' deps='%s'" % (sysdeps, deps)
+ (sysdeps, localdeps, add_objects) = ADD_DEPENDENCIES(bld, binname, deps)
cache = LOCAL_CACHE(bld, 'INIT_FUNCTIONS')
if modules is not None:
@@ -355,12 +440,16 @@ def SAMBA_BINARY(bld, binname, source_list,
uselib = sysdeps,
includes = ilist,
ccflags = ccflags,
+ add_objects = add_objects,
top=True)
# put a link to the binary in bin/
- bld(
- source = binname,
- rule = 'ln -sf ${SRC} .',
- )
+ if not Options.is_install:
+ bld(
+ source = binname,
+ rule = 'rm -f %s && cp ${SRC} .' % (binname),
+ shell = True,
+ after = 'cc_link'
+ )
Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY
@@ -371,34 +460,53 @@ def SAMBA_PYTHON(bld, name, source_list,
public_deps='',
realname=''):
- #print "SAMBA_PYTHON '%s' with deps '%s'" % (name, deps)
+ if not SET_TARGET_TYPE(bld, name, 'PYTHON'):
+ return
- (sysdeps, localdeps) = ADD_DEPENDENCIES(bld, name, deps)
+ (sysdeps, localdeps, add_objects) = ADD_DEPENDENCIES(bld, name, deps)
- #Logs.debug('runner: PYTHON_SAMBA not implemented')
return
Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
+###################################################################
+# declare the ASN1 build pattern
+@runonce
+def SAMBA_ASN1_PATTERN(bld):
+ bld(
+ name = 'asn1_compile',
+ rule = 'echo ASN1_COMPILE ${SRC} > {$TGT}',
+ shall = True,
+ ext_in = '.asn1',
+ ext_out = '.c',
+ reentrant = True,
+ install = False)
+
+
#################################################################
# define a Samba ASN1 target
def SAMBA_ASN1(bld, name, source,
options='',
directory=''):
import string
+
+ if not SET_TARGET_TYPE(bld, name, 'ASN1'):
+ return
+
cfile = string.replace(source, '.asn1', '.c')
- bld(
- source = source,
- target = cfile,
- rule = 'echo ASN1_COMPILE ${SRC} > {$TGT}',
- uselib = '',
- name = name)
+
+ # declare the pattern rule
+ SAMBA_ASN1_PATTERN(bld)
+
+ bld(source=source)
+
bld(
features = 'cc cshlib',
source = cfile,
target = name,
uselib = '',
- after = name)
+ after = 'asn1_compile'
+ )
Build.BuildContext.SAMBA_ASN1 = SAMBA_ASN1
@@ -407,6 +515,8 @@ Build.BuildContext.SAMBA_ASN1 = SAMBA_ASN1
def SAMBA_ERRTABLE(bld, name, source,
directory=''):
import string
+ if not SET_TARGET_TYPE(bld, name, 'ERRTABLE'):
+ return
cfile = string.replace(source, '.et', '.c')
bld(
source = source,
@@ -418,6 +528,34 @@ def SAMBA_ERRTABLE(bld, name, source,
Build.BuildContext.SAMBA_ERRTABLE = SAMBA_ERRTABLE
+#################################################################
+# define a PIDL target
+def SAMBA_PIDL(bld, directory, source):
+ pidl = "../../pidl/pidl"
+ idl_dir = os.path.dirname(source)
+ base = os.path.basename(string.replace(source, '.idl', ''))
+ rule = "pidl --outputdir %s --header --ndr-parser --server --client --python --dcom-proxy --com-header --includedir %s -- %s" % (directory, idl_dir, source)
+ output = '%s/ndr_%s.c' % (directory, base)
+ tname = 'PIDL_%s' % base.upper()
+ bld(
+ rule = rule,
+ source = source,
+ target = output,
+ name = 'pidl_compile'
+ )
+
+Build.BuildContext.SAMBA_PIDL = SAMBA_PIDL
+
+
+
+#################################################################
+# define a set of Samba PIDL targets
+def SAMBA_PIDL_LIST(bld, directory, source_list):
+ for p in source_list.split():
+ bld.SAMBA_PIDL(directory, p)
+Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST
+
+
################################################################
# build a C prototype file automatically
def AUTOPROTO(bld, header, source_list):
@@ -441,13 +579,31 @@ def SAMBA_MODULE(bld, modname, source_list,
aliases=None,
cflags=None,
output_type=None):
- #print "SAMBA_MODULE '%s' with deps '%s'" % (modname, deps)
- bld.ADD_INIT_FUNCTION(subsystem, init_function)
- bld.AUTOPROTO(autoproto, source_list)
- bld.SAMBA_LIBRARY(modname, source_list,
- deps=deps, include_list=include_list)
+
+ if not SET_TARGET_TYPE(bld, modname, 'MODULE'):
+ return
+
+ # remember empty modules, so we can strip the dependencies
+ if (source_list == '') or (source_list == []):
+ LOCAL_CACHE_SET(bld, 'EMPTY_TARGETS', modname, True)
+ return
+
+ (sysdeps, localdeps, add_objects) = ADD_DEPENDENCIES(bld, modname, deps)
+
+ ilist = bld.SAMBA_LIBRARY_INCLUDE_LIST(deps) + bld.SUBDIR(bld.curdir, include_list)
+ ilist = bld.NORMPATH(ilist)
+ bld(
+ features = 'cc',
+ source = source_list,
+ target=modname,
+# we don't supply dependencies here, as this is just a compile, not a link
+# uselib_local = localdeps,
+# uselib = sysdeps,
+# add_objects = add_objects,
+ includes='. ' + bld.env['BUILD_DIRECTORY'] + '/default ' + ilist)
Build.BuildContext.SAMBA_MODULE = SAMBA_MODULE
+
#################################################################
# define a Samba subsystem
def SAMBA_SUBSYSTEM(bld, modname, source_list,
@@ -458,8 +614,28 @@ def SAMBA_SUBSYSTEM(bld, modname, source_list,
autoproto=None,
cflags=None,
init_function_sentinal=None):
- bld.SAMBA_LIBRARY(modname, source_list,
- deps=deps, include_list=include_list)
+
+ if not SET_TARGET_TYPE(bld, modname, 'SUBSYSTEM'):
+ return
+
+ # remember empty subsystems, so we can strip the dependencies
+ if (source_list == '') or (source_list == []):
+ LOCAL_CACHE_SET(bld, 'EMPTY_TARGETS', modname, True)
+ return
+
+ (sysdeps, localdeps, add_objects) = ADD_DEPENDENCIES(bld, modname, deps)
+
+ ilist = bld.SAMBA_LIBRARY_INCLUDE_LIST(deps) + bld.SUBDIR(bld.curdir, include_list)
+ ilist = bld.NORMPATH(ilist)
+ bld(
+ features = 'cc',
+ source = source_list,
+ target=modname,
+# we don't supply dependencies here, as this is just a compile, not a link
+# uselib_local = localdeps,
+# uselib = sysdeps,
+# add_objects = add_objects,
+ includes='. ' + bld.env['BUILD_DIRECTORY'] + '/default ' + ilist)
Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
@@ -467,9 +643,14 @@ Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
# add a new set of build rules from a subdirectory
# the @runonce decorator ensures we don't end up
# with duplicate rules
-@runonce
def BUILD_SUBDIR(bld, dir):
+ path = os.path.normpath(bld.curdir + '/' + dir)
+ cache = LOCAL_CACHE(bld, 'SUBDIR_LIST')
+ if path in cache: return
+ cache[path] = True
+ debug("build: Processing subdirectory %s" % dir)
bld.add_subdirs(dir)
+
Build.BuildContext.BUILD_SUBDIR = BUILD_SUBDIR
@@ -482,7 +663,7 @@ def exec_command(self, cmd, **kw):
_cmd = cmd
if isinstance(cmd, list):
_cmd = ' '.join(cmd)
- Logs.debug('runner: %s' % _cmd)
+ debug('runner: %s' % _cmd)
if self.log:
self.log.write('%s\n' % cmd)
kw['log'] = self.log
@@ -495,3 +676,25 @@ def exec_command(self, cmd, **kw):
Build.BuildContext.exec_command = exec_command
+###########################################################
+# list the build targets
+def cmd_list(ctx):
+ '''List the build targets'''
+ import Utils, Environment
+ proj = Environment.Environment(Options.lockfile)
+ bld_cls = getattr(Utils.g_module, 'build_context', Utils.Context)
+ bld = bld_cls()
+ bld.load_dirs(proj['srcdir'], proj['blddir'])
+ bld.load_envs()
+ targets = bld.env['TARGET_TYPE']
+ for t in targets:
+ print "Target %20s of type %s" % (t, targets[t])
+
+
+###########################################################
+# add some extra top level targets
+@runonce
+def add_extra_targets():
+ import Utils
+ setattr(Utils.g_module, 'list', cmd_list)
+
diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build
new file mode 100644
index 0000000000..3db27c35c4
--- /dev/null
+++ b/source4/dsdb/wscript_build
@@ -0,0 +1,52 @@
+# AUTOGENERATED by mktowscript.pl from ../../source4/dsdb/config.mk
+# Please remove this notice if hand editing
+
+bld.BUILD_SUBDIR('samdb/ldb_modules')
+
+bld.SAMBA_SUBSYSTEM('SAMDB',
+ 'samdb/samdb.c samdb/samdb_privilege.c samdb/cracknames.c repl/replicated_objects.c',
+ autoproto='samdb/samdb_proto.h',
+ public_deps='HEIMDAL_KRB5',
+ deps='LIBNDR NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER auth_system_session LIBCLI_AUTH LIBNDR SAMDB_SCHEMA LDB_WRAP SAMDB_COMMON LIBCLI_DRSUAPI LIBCLI_LDAP_NDR LIBSAMBA-UTIL'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('SAMDB_COMMON',
+ 'samdb/ldb_modules/util.c ./common/util.c common/dsdb_dn.c ./common/tests/dsdb_dn.c ../../libds/common/flag_mapping.c',
+ autoproto='common/proto.h',
+ deps='ldb NDR_DRSBLOBS LIBCLI_LDAP_NDR UTIL_LDB LIBCLI_AUTH'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('SAMDB_SCHEMA',
+ 'schema/schema_init.c schema/schema_set.c schema/schema_query.c schema/tests/schema_syntax.c ./schema/schema_syntax.c schema/schema_description.c schema/schema_convert_to_ol.c schema/schema_inferiors.c schema/schema_prefixmap.c',
+ autoproto='schema/proto.h',
+ deps='SAMDB_COMMON NDR_DRSUAPI NDR_DRSBLOBS LDBSAMBA'
+ )
+
+
+bld.SAMBA_MODULE('DREPL_SRV',
+ 'repl/drepl_service.c repl/drepl_periodic.c repl/drepl_partitions.c repl/drepl_out_pull.c repl/drepl_out_helpers.c repl/drepl_notify.c repl/drepl_ridalloc.c',
+ autoproto='repl/drepl_service_proto.h',
+ subsystem='service',
+ init_function='server_service_drepl_init',
+ deps='SAMDB process_model RPC_NDR_DRSUAPI'
+ )
+
+
+bld.SAMBA_MODULE('KCC_SRV',
+ 'kcc/kcc_service.c kcc/kcc_connection.c kcc/kcc_topology.c kcc/kcc_deleted.c kcc/kcc_periodic.c kcc/kcc_drs_replica_info.c',
+ autoproto='kcc/kcc_service_proto.h',
+ subsystem='service',
+ init_function='server_service_kcc_init',
+ deps='SAMDB process_model RPC_NDR_DRSUAPI'
+ )
+
+
+bld.SAMBA_MODULE('DNS_UPDATE_SRV',
+ 'dns/dns_update.c',
+ subsystem='service',
+ init_function='server_service_dnsupdate_init',
+ deps='SAMDB process_model UTIL_RUNCMD'
+ )
+
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
new file mode 100644
index 0000000000..3a66f57fbd
--- /dev/null
+++ b/source4/heimdal_build/wscript_build
@@ -0,0 +1,304 @@
+bld.SAMBA_ASN1('HEIMDAL_SPNEGO_ASN1',
+ '../heimdal/lib/gssapi/spnego/spnego.asn1',
+ options='--sequence=MechTypeList',
+ directory='lib/gssapi'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_GSSAPI_ASN1',
+ '../heimdal/lib/gssapi/mech/gssapi.asn1',
+ directory='lib/gssapi'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_KRB5_ASN1',
+ '../heimdal/lib/asn1/krb5.asn1',
+ options='--option-file=krb5.opt',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_DIGEST_ASN1',
+ '../heimdal/lib/asn1/digest.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_PKCS8_ASN1',
+ '../heimdal/lib/asn1/pkcs8.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_PKCS9_ASN1',
+ '../heimdal/lib/asn1/pkcs9.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_PKCS12_ASN1',
+ '../heimdal/lib/asn1/pkcs12.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_RFC2459_ASN1',
+ '../heimdal/lib/asn1/rfc2459.asn1',
+ options='--preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_PKINIT_ASN1',
+ '../heimdal/lib/asn1/pkinit.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_CMS_ASN1',
+ '../heimdal/lib/asn1/cms.asn1',
+ options='--option-file=cms.opt',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_OCSP_ASN1',
+ '../heimdal/lib/hx509/ocsp.asn1',
+ options='--preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData',
+ directory='lib/hx509'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_KX509_ASN1',
+ '../heimdal/lib/asn1/kx509.asn1',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_PKCS10_ASN1',
+ '../heimdal/lib/hx509/pkcs10.asn1',
+ options='--preserve-binary=CertificationRequestInfo',
+ directory='lib/hx509'
+ )
+
+
+bld.SAMBA_ASN1('HEIMDAL_HDB_ASN1',
+ '../heimdal/lib/hdb/hdb.asn1',
+ directory='lib/hdb'
+ )
+
+bld.SAMBA_ERRTABLE('HEIMDAL_ASN1_ERR_ET',
+ '../heimdal/lib/asn1/asn1_err.et',
+ directory='lib/asn1'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_HDB_ERR_ET',
+ '../heimdal/lib/hdb/hdb_err.et',
+ directory='lib/hdb'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_HEIM_ERR_ET',
+ '../heimdal/lib/krb5/heim_err.et',
+ directory='lib/krb5'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_K524_ERR_ET',
+ '../heimdal/lib/krb5/k524_err.et',
+ directory='lib/krb5'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_KRB_ERR_ET',
+ '../heimdal/lib/krb5/krb_err.et',
+ directory='lib/krb5'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_KRB5_ERR_ET',
+ '../heimdal/lib/krb5/krb5_err.et',
+ directory='lib/krb5'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_GKRB5_ERR_ET',
+ '../heimdal/lib/gssapi/krb5/gkrb5_err.et',
+ directory='lib/gssapi'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_HX509_ERR_ET',
+ '../heimdal/lib/hx509/hx509_err.et',
+ directory='lib/hx509'
+ )
+
+
+bld.SAMBA_ERRTABLE('HEIMDAL_WIND_ERR_ET',
+ '../heimdal/lib/wind/wind_err.et',
+ directory='lib/wind'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_KDC',
+ '../heimdal/kdc/default_config.c ../heimdal/kdc/kerberos5.c ../heimdal/kdc/krb5tgs.c ../heimdal/kdc/pkinit.c ../heimdal/kdc/log.c ../heimdal/kdc/misc.c ../heimdal/kdc/kaserver.c ../heimdal/kdc/digest.c ../heimdal/kdc/process.c ../heimdal/kdc/windc.c ../heimdal/kdc/kx509.c',
+ cflags='-I../heimdal_build -I../heimdal/kdc',
+ deps='HEIMDAL_ROKEN HEIMDAL_KRB5 HEIMDAL_HDB HEIMDAL_HEIM_ASN1 HEIMDAL_DIGEST_ASN1 HEIMDAL_KX509_ASN1 HEIMDAL_NTLM HEIMDAL_HCRYPTO'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_NTLM',
+ '../heimdal/lib/ntlm/ntlm.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/ntlm',
+ deps='HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HDB_KEYS',
+ '../heimdal/lib/hdb/keys.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/hdb',
+ deps='HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5 HEIMDAL_HDB_ASN1'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HDB',
+ '../heimdal/lib/hdb/db.c ../heimdal/lib/hdb/dbinfo.c ../heimdal/lib/hdb/ext.c ../heimdal/lib/hdb/keytab.c ../heimdal/lib/hdb/mkey.c ../heimdal/lib/hdb/ndbm.c ../heimdal/lib/hdb/hdb_err.c hdb-glue.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/hdb',
+ deps='HDB_LDB HEIMDAL_KRB5 HEIMDAL_HDB_KEYS HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_COM_ERR HEIMDAL_HDB_ASN1'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_GSSAPI',
+ '../heimdal/lib/gssapi/spnego/init_sec_context.c ../heimdal/lib/gssapi/spnego/external.c ../heimdal/lib/gssapi/spnego/compat.c ../heimdal/lib/gssapi/spnego/context_stubs.c ../heimdal/lib/gssapi/spnego/cred_stubs.c ../heimdal/lib/gssapi/spnego/accept_sec_context.c ../heimdal/lib/gssapi/krb5/copy_ccache.c ../heimdal/lib/gssapi/krb5/delete_sec_context.c ../heimdal/lib/gssapi/krb5/init_sec_context.c ../heimdal/lib/gssapi/krb5/context_time.c ../heimdal/lib/gssapi/krb5/init.c ../heimdal/lib/gssapi/krb5/address_to_krb5addr.c ../heimdal/lib/gssapi/krb5/get_mic.c ../heimdal/lib/gssapi/krb5/inquire_context.c ../heimdal/lib/gssapi/krb5/add_cred.c ../heimdal/lib/gssapi/krb5/inquire_cred.c ../heimdal/lib/gssapi/krb5/inquire_cred_by_oid.c ../heimdal/lib/gssapi/krb5/inquire_cred_by_mech.c ../heimdal/lib/gssapi/krb5/inquire_mechs_for_name.c ../heimdal/lib/gssapi/krb5/inquire_names_for_mech.c ../heimdal/lib/gssapi/krb5/indicate_mechs.c ../heimdal/lib/gssapi/krb5/inquire_sec_context_by_oid.c ../heimdal/lib/gssapi/krb5/export_sec_context.c ../heimdal/lib/gssapi/krb5/import_sec_context.c ../heimdal/lib/gssapi/krb5/duplicate_name.c ../heimdal/lib/gssapi/krb5/import_name.c ../heimdal/lib/gssapi/krb5/compare_name.c ../heimdal/lib/gssapi/krb5/export_name.c ../heimdal/lib/gssapi/krb5/canonicalize_name.c ../heimdal/lib/gssapi/krb5/unwrap.c ../heimdal/lib/gssapi/krb5/wrap.c ../heimdal/lib/gssapi/krb5/release_name.c ../heimdal/lib/gssapi/krb5/cfx.c ../heimdal/lib/gssapi/krb5/8003.c ../heimdal/lib/gssapi/krb5/arcfour.c ../heimdal/lib/gssapi/krb5/encapsulate.c ../heimdal/lib/gssapi/krb5/display_name.c ../heimdal/lib/gssapi/krb5/sequence.c ../heimdal/lib/gssapi/krb5/display_status.c ../heimdal/lib/gssapi/krb5/release_buffer.c ../heimdal/lib/gssapi/krb5/external.c ../heimdal/lib/gssapi/krb5/compat.c ../heimdal/lib/gssapi/krb5/creds.c ../heimdal/lib/gssapi/krb5/acquire_cred.c ../heimdal/lib/gssapi/krb5/release_cred.c ../heimdal/lib/gssapi/krb5/store_cred.c ../heimdal/lib/gssapi/krb5/set_cred_option.c ../heimdal/lib/gssapi/krb5/decapsulate.c ../heimdal/lib/gssapi/krb5/verify_mic.c ../heimdal/lib/gssapi/krb5/accept_sec_context.c ../heimdal/lib/gssapi/krb5/set_sec_context_option.c ../heimdal/lib/gssapi/krb5/process_context_token.c ../heimdal/lib/gssapi/krb5/prf.c ../heimdal/lib/gssapi/krb5/aeap.c ../heimdal/lib/gssapi/mech/context.c ../heimdal/lib/gssapi/mech/gss_krb5.c ../heimdal/lib/gssapi/mech/gss_mech_switch.c ../heimdal/lib/gssapi/mech/gss_process_context_token.c ../heimdal/lib/gssapi/mech/gss_buffer_set.c ../heimdal/lib/gssapi/mech/gss_aeap.c ../heimdal/lib/gssapi/mech/gss_add_cred.c ../heimdal/lib/gssapi/mech/gss_cred.c ../heimdal/lib/gssapi/mech/gss_add_oid_set_member.c ../heimdal/lib/gssapi/mech/gss_compare_name.c ../heimdal/lib/gssapi/mech/gss_release_oid_set.c ../heimdal/lib/gssapi/mech/gss_create_empty_oid_set.c ../heimdal/lib/gssapi/mech/gss_decapsulate_token.c ../heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c ../heimdal/lib/gssapi/mech/gss_canonicalize_name.c ../heimdal/lib/gssapi/mech/gss_inquire_sec_context_by_oid.c ../heimdal/lib/gssapi/mech/gss_inquire_names_for_mech.c ../heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c ../heimdal/lib/gssapi/mech/gss_wrap_size_limit.c ../heimdal/lib/gssapi/mech/gss_names.c ../heimdal/lib/gssapi/mech/gss_verify.c ../heimdal/lib/gssapi/mech/gss_display_name.c ../heimdal/lib/gssapi/mech/gss_duplicate_oid.c ../heimdal/lib/gssapi/mech/gss_display_status.c ../heimdal/lib/gssapi/mech/gss_release_buffer.c ../heimdal/lib/gssapi/mech/gss_release_oid.c ../heimdal/lib/gssapi/mech/gss_test_oid_set_member.c ../heimdal/lib/gssapi/mech/gss_release_cred.c ../heimdal/lib/gssapi/mech/gss_set_sec_context_option.c ../heimdal/lib/gssapi/mech/gss_export_name.c ../heimdal/lib/gssapi/mech/gss_seal.c ../heimdal/lib/gssapi/mech/gss_acquire_cred.c ../heimdal/lib/gssapi/mech/gss_unseal.c ../heimdal/lib/gssapi/mech/gss_verify_mic.c ../heimdal/lib/gssapi/mech/gss_accept_sec_context.c ../heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c ../heimdal/lib/gssapi/mech/gss_indicate_mechs.c ../heimdal/lib/gssapi/mech/gss_delete_sec_context.c ../heimdal/lib/gssapi/mech/gss_sign.c ../heimdal/lib/gssapi/mech/gss_utils.c ../heimdal/lib/gssapi/mech/gss_init_sec_context.c ../heimdal/lib/gssapi/mech/gss_oid_equal.c ../heimdal/lib/gssapi/mech/gss_oid_to_str.c ../heimdal/lib/gssapi/mech/gss_context_time.c ../heimdal/lib/gssapi/mech/gss_encapsulate_token.c ../heimdal/lib/gssapi/mech/gss_get_mic.c ../heimdal/lib/gssapi/mech/gss_import_sec_context.c ../heimdal/lib/gssapi/mech/gss_inquire_cred.c ../heimdal/lib/gssapi/mech/gss_wrap.c ../heimdal/lib/gssapi/mech/gss_import_name.c ../heimdal/lib/gssapi/mech/gss_duplicate_name.c ../heimdal/lib/gssapi/mech/gss_unwrap.c ../heimdal/lib/gssapi/mech/gss_export_sec_context.c ../heimdal/lib/gssapi/mech/gss_inquire_context.c ../heimdal/lib/gssapi/mech/gss_release_name.c ../heimdal/lib/gssapi/mech/gss_set_cred_option.c ../heimdal/lib/gssapi/mech/gss_pseudo_random.c gssapi-glue.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/gssapi -I../heimdal/lib/gssapi/gssapi -I../heimdal/lib/gssapi/spnego -I../heimdal/lib/gssapi/krb5 -I../heimdal/lib/gssapi/mech',
+ deps='HEIMDAL_HCRYPTO HEIMDAL_HEIM_ASN1 HEIMDAL_SPNEGO_ASN1 HEIMDAL_GSSAPI_ASN1 HEIMDAL_ROKEN HEIMDAL_KRB5'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_KRB5',
+ '../heimdal/lib/krb5/acache.c ../heimdal/lib/krb5/add_et_list.c ../heimdal/lib/krb5/addr_families.c ../heimdal/lib/krb5/appdefault.c ../heimdal/lib/krb5/asn1_glue.c ../heimdal/lib/krb5/auth_context.c ../heimdal/lib/krb5/build_ap_req.c ../heimdal/lib/krb5/build_auth.c ../heimdal/lib/krb5/cache.c ../heimdal/lib/krb5/changepw.c ../heimdal/lib/krb5/codec.c ../heimdal/lib/krb5/config_file.c ../heimdal/lib/krb5/constants.c ../heimdal/lib/krb5/context.c ../heimdal/lib/krb5/convert_creds.c ../heimdal/lib/krb5/copy_host_realm.c ../heimdal/lib/krb5/crc.c ../heimdal/lib/krb5/creds.c ../heimdal/lib/krb5/crypto.c ../heimdal/lib/krb5/data.c ../heimdal/lib/krb5/eai_to_heim_errno.c ../heimdal/lib/krb5/error_string.c ../heimdal/lib/krb5/expand_hostname.c ../heimdal/lib/krb5/fcache.c ../heimdal/lib/krb5/free.c ../heimdal/lib/krb5/free_host_realm.c ../heimdal/lib/krb5/generate_seq_number.c ../heimdal/lib/krb5/generate_subkey.c ../heimdal/lib/krb5/get_addrs.c ../heimdal/lib/krb5/get_cred.c ../heimdal/lib/krb5/get_default_principal.c ../heimdal/lib/krb5/get_default_realm.c ../heimdal/lib/krb5/get_for_creds.c ../heimdal/lib/krb5/get_host_realm.c ../heimdal/lib/krb5/get_in_tkt.c ../heimdal/lib/krb5/get_port.c ../heimdal/lib/krb5/init_creds.c ../heimdal/lib/krb5/init_creds_pw.c ../heimdal/lib/krb5/kcm.c ../heimdal/lib/krb5/keyblock.c ../heimdal/lib/krb5/keytab.c ../heimdal/lib/krb5/keytab_any.c ../heimdal/lib/krb5/keytab_file.c ../heimdal/lib/krb5/keytab_memory.c ../heimdal/lib/krb5/keytab_keyfile.c ../heimdal/lib/krb5/krbhst.c ../heimdal/lib/krb5/log.c ../heimdal/lib/krb5/mcache.c ../heimdal/lib/krb5/misc.c ../heimdal/lib/krb5/mk_error.c ../heimdal/lib/krb5/mk_priv.c ../heimdal/lib/krb5/mk_rep.c ../heimdal/lib/krb5/mk_req.c ../heimdal/lib/krb5/mk_req_ext.c ../heimdal/lib/krb5/mit_glue.c ../heimdal/lib/krb5/n-fold.c ../heimdal/lib/krb5/padata.c ../heimdal/lib/krb5/pkinit.c ../heimdal/lib/krb5/plugin.c ../heimdal/lib/krb5/principal.c ../heimdal/lib/krb5/prog_setup.c ../heimdal/lib/krb5/pac.c ../heimdal/lib/krb5/prompter_posix.c ../heimdal/lib/krb5/rd_cred.c ../heimdal/lib/krb5/rd_error.c ../heimdal/lib/krb5/rd_priv.c ../heimdal/lib/krb5/rd_rep.c ../heimdal/lib/krb5/rd_req.c ../heimdal/lib/krb5/replay.c ../heimdal/lib/krb5/send_to_kdc.c ../heimdal/lib/krb5/set_default_realm.c ../heimdal/lib/krb5/store.c ../heimdal/lib/krb5/store_emem.c ../heimdal/lib/krb5/store_fd.c ../heimdal/lib/krb5/store_mem.c ../heimdal/lib/krb5/ticket.c ../heimdal/lib/krb5/time.c ../heimdal/lib/krb5/transited.c ../heimdal/lib/krb5/v4_glue.c ../heimdal/lib/krb5/version.c ../heimdal/lib/krb5/warn.c ../heimdal/lib/krb5/krb5_err.c ../heimdal/lib/krb5/heim_err.c ../heimdal/lib/krb5/k524_err.c krb5-glue.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/krb5 -I../heimdal/lib/asn1 -I../heimdal/lib/com_err',
+ public_deps='HEIMDAL_COM_ERR',
+ deps='HEIMDAL_ROKEN HEIMDAL_PKINIT_ASN1 HEIMDAL_WIND HEIMDAL_KRB5_ASN1 HEIMDAL_HX509 HEIMDAL_HCRYPTO LIBNETIF LIBSAMBA-HOSTCONFIG INTL'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HEIM_ASN1',
+ '../heimdal/lib/asn1/der_get.c ../heimdal/lib/asn1/der_put.c ../heimdal/lib/asn1/der_free.c ../heimdal/lib/asn1/der_format.c ../heimdal/lib/asn1/der_length.c ../heimdal/lib/asn1/der_copy.c ../heimdal/lib/asn1/der_cmp.c ../heimdal/lib/asn1/extra.c ../heimdal/lib/asn1/timegm.c ../heimdal/lib/asn1/asn1_err.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/asn1',
+ deps='HEIMDAL_ROKEN HEIMDAL_COM_ERR'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HCRYPTO_IMATH',
+ '../heimdal/lib/hcrypto/imath/imath.c ../heimdal/lib/hcrypto/imath/iprime.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/hcrypto/imath',
+ deps='HEIMDAL_ROKEN'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HCRYPTO',
+ '../heimdal/lib/hcrypto/aes.c ../heimdal/lib/hcrypto/bn.c ../heimdal/lib/hcrypto/dh.c ../heimdal/lib/hcrypto/dh-imath.c ../heimdal/lib/hcrypto/des.c ../heimdal/lib/hcrypto/dsa.c ../heimdal/lib/hcrypto/engine.c ../heimdal/lib/hcrypto/md2.c ../heimdal/lib/hcrypto/md4.c ../heimdal/lib/hcrypto/md5.c ../heimdal/lib/hcrypto/rsa.c ../heimdal/lib/hcrypto/rsa-imath.c ../heimdal/lib/hcrypto/rc2.c ../heimdal/lib/hcrypto/rc4.c ../heimdal/lib/hcrypto/rijndael-alg-fst.c ../heimdal/lib/hcrypto/rnd_keys.c ../heimdal/lib/hcrypto/sha.c ../heimdal/lib/hcrypto/sha256.c ../heimdal/lib/hcrypto/ui.c ../heimdal/lib/hcrypto/evp.c ../heimdal/lib/hcrypto/evp-hcrypto.c ../heimdal/lib/hcrypto/evp-cc.c ../heimdal/lib/hcrypto/pkcs5.c ../heimdal/lib/hcrypto/pkcs12.c ../heimdal/lib/hcrypto/rand.c ../heimdal/lib/hcrypto/rand-egd.c ../heimdal/lib/hcrypto/rand-unix.c ../heimdal/lib/hcrypto/rand-fortuna.c ../heimdal/lib/hcrypto/rand-timer.c ../heimdal/lib/hcrypto/hmac.c ../heimdal/lib/hcrypto/camellia.c ../heimdal/lib/hcrypto/camellia-ntt.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/hcrypto -I../heimdal/lib',
+ deps='HEIMDAL_ROKEN HEIMDAL_HEIM_ASN1 HEIMDAL_HCRYPTO_IMATH HEIMDAL_RFC2459_ASN1'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_HX509',
+ '../heimdal/lib/hx509/ca.c ../heimdal/lib/hx509/cert.c ../heimdal/lib/hx509/cms.c ../heimdal/lib/hx509/collector.c ../heimdal/lib/hx509/crypto.c ../heimdal/lib/hx509/error.c ../heimdal/lib/hx509/env.c ../heimdal/lib/hx509/file.c ../heimdal/lib/hx509/keyset.c ../heimdal/lib/hx509/ks_dir.c ../heimdal/lib/hx509/ks_file.c ../heimdal/lib/hx509/ks_keychain.c ../heimdal/lib/hx509/ks_mem.c ../heimdal/lib/hx509/ks_null.c ../heimdal/lib/hx509/ks_p11.c ../heimdal/lib/hx509/ks_p12.c ../heimdal/lib/hx509/lock.c ../heimdal/lib/hx509/name.c ../heimdal/lib/hx509/peer.c ../heimdal/lib/hx509/print.c ../heimdal/lib/hx509/req.c ../heimdal/lib/hx509/revoke.c ../heimdal/lib/hx509/sel.c ../heimdal/lib/hx509/hx509_err.c ../heimdal/lib/hx509/sel-lex.c ../heimdal/lib/hx509/sel-gram.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/hx509',
+ deps='HEIMDAL_ROKEN HEIMDAL_COM_ERR HEIMDAL_HEIM_ASN1 HEIMDAL_HCRYPTO HEIMDAL_CMS_ASN1 HEIMDAL_RFC2459_ASN1 HEIMDAL_OCSP_ASN1 HEIMDAL_PKCS8_ASN1 HEIMDAL_PKCS9_ASN1 HEIMDAL_PKCS12_ASN1 HEIMDAL_PKINIT_ASN1 HEIMDAL_PKCS10_ASN1 HEIMDAL_WIND'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_WIND',
+ '../heimdal/lib/wind/wind_err.c ../heimdal/lib/wind/stringprep.c ../heimdal/lib/wind/errorlist.c ../heimdal/lib/wind/errorlist_table.c ../heimdal/lib/wind/normalize.c ../heimdal/lib/wind/normalize_table.c ../heimdal/lib/wind/combining.c ../heimdal/lib/wind/combining_table.c ../heimdal/lib/wind/utf8.c ../heimdal/lib/wind/bidi.c ../heimdal/lib/wind/bidi_table.c ../heimdal/lib/wind/ldap.c ../heimdal/lib/wind/map.c ../heimdal/lib/wind/map_table.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/wind',
+ deps='HEIMDAL_ROKEN HEIMDAL_COM_ERR'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_PROGNAME',
+ '../heimdal/lib/roken/getprogname.c ../heimdal/lib/roken/setprogname.c',
+ config_option='HAVE_GETPROGNAME'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_CLOSEFROM',
+ '../heimdal/lib/roken/closefrom.c',
+ config_option='HAVE_CLOSEFROM'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_PROGNAME_H',
+ '../heimdal/lib/roken/getprogname.c ../heimdal/lib/roken/setprogname.c',
+ cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
+ config_option='HAVE_GETPROGNAME'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_CLOSEFROM_H',
+ '../heimdal/lib/roken/closefrom.c',
+ cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
+ config_option='HAVE_CLOSEFROM'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN',
+ '../heimdal/lib/roken/base64.c ../heimdal/lib/roken/ct.c ../heimdal/lib/roken/hex.c ../heimdal/lib/roken/bswap.c ../heimdal/lib/roken/dumpdata.c ../heimdal/lib/roken/emalloc.c ../heimdal/lib/roken/ecalloc.c ../heimdal/lib/roken/getarg.c ../heimdal/lib/roken/get_window_size.c ../heimdal/lib/roken/getdtablesize.c ../heimdal/lib/roken/h_errno.c ../heimdal/lib/roken/issuid.c ../heimdal/lib/roken/net_read.c ../heimdal/lib/roken/net_write.c ../heimdal/lib/roken/socket.c ../heimdal/lib/roken/parse_time.c ../heimdal/lib/roken/parse_units.c ../heimdal/lib/roken/resolve.c ../heimdal/lib/roken/roken_gethostby.c ../heimdal/lib/roken/signal.c ../heimdal/lib/roken/vis.c ../heimdal/lib/roken/strlwr.c ../heimdal/lib/roken/strsep_copy.c ../heimdal/lib/roken/strsep.c ../heimdal/lib/roken/strupr.c ../heimdal/lib/roken/strpool.c ../heimdal/lib/roken/estrdup.c ../heimdal/lib/roken/erealloc.c ../heimdal/lib/roken/simple_exec.c ../heimdal/lib/roken/strcollect.c ../heimdal/lib/roken/rtbl.c ../heimdal/lib/roken/cloexec.c ../heimdal/lib/roken/xfree.c replace.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/roken -I../heimdal/include -I$(socketwrappersrcdir)',
+ deps='HEIMDAL_ROKEN_PROGNAME HEIMDAL_ROKEN_CLOSEFROM resolv LIBREPLACE_NETWORK UID_WRAPPER'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_H',
+ '../heimdal/lib/roken/base64.c ../heimdal/lib/roken/ct.c ../heimdal/lib/roken/hex.c ../heimdal/lib/roken/bswap.c ../heimdal/lib/roken/dumpdata.c ../heimdal/lib/roken/emalloc.c ../heimdal/lib/roken/ecalloc.c ../heimdal/lib/roken/getarg.c ../heimdal/lib/roken/get_window_size.c ../heimdal/lib/roken/getdtablesize.c ../heimdal/lib/roken/h_errno.c ../heimdal/lib/roken/issuid.c ../heimdal/lib/roken/net_read.c ../heimdal/lib/roken/net_write.c ../heimdal/lib/roken/socket.c ../heimdal/lib/roken/parse_time.c ../heimdal/lib/roken/parse_units.c ../heimdal/lib/roken/resolve.c ../heimdal/lib/roken/roken_gethostby.c ../heimdal/lib/roken/signal.c ../heimdal/lib/roken/vis.c ../heimdal/lib/roken/strlwr.c ../heimdal/lib/roken/strsep_copy.c ../heimdal/lib/roken/strsep.c ../heimdal/lib/roken/strupr.c ../heimdal/lib/roken/strpool.c ../heimdal/lib/roken/estrdup.c ../heimdal/lib/roken/erealloc.c ../heimdal/lib/roken/simple_exec.c ../heimdal/lib/roken/strcollect.c ../heimdal/lib/roken/rtbl.c ../heimdal/lib/roken/cloexec.c ../heimdal/lib/roken/xfree.c replace.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/roken -DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
+ deps='HEIMDAL_ROKEN_PROGNAME_H HEIMDAL_ROKEN_CLOSEFROM_H resolv LIBREPLACE_NETWORK'
+ )
+
+
+bld.SAMBA_SUBSYSTEM('HEIMDAL_COM_ERR',
+ '../heimdal/lib/com_err/com_err.c ../heimdal/lib/com_err/error.c',
+ cflags='-I../heimdal_build -I../heimdal/lib/com_err',
+ deps='HEIMDAL_ROKEN',
+ config_option='HAVE_COM_ERR'
+ )
+
+
+bld.SAMBA_BINARY('asn1_compile',
+ '../heimdal/lib/asn1/main.c ../heimdal/lib/asn1/gen.c ../heimdal/lib/asn1/gen_copy.c ../heimdal/lib/asn1/gen_decode.c ../heimdal/lib/asn1/gen_encode.c ../heimdal/lib/asn1/gen_free.c ../heimdal/lib/asn1/gen_glue.c ../heimdal/lib/asn1/gen_length.c ../heimdal/lib/asn1/gen_seq.c ../heimdal/lib/asn1/hash.c ../heimdal/lib/asn1/symbol.c ../heimdal/lib/asn1/asn1parse.c ../heimdal/lib/asn1/lex.c ../heimdal/lib/vers/print_version.c',
+ use_hostcc=True,
+ cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_ -I../heimdal_build',
+ group='build_compilers',
+ deps='HEIMDAL_ROKEN_H replace',
+ )
+
+
+bld.SAMBA_BINARY('compile_et',
+ '../heimdal/lib/vers/print_version.c ../heimdal/lib/com_err/parse.c ../heimdal/lib/com_err/lex.c ../heimdal/lib/com_err/compile_et.c',
+ use_hostcc=True,
+ group='build_compilers',
+ cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
+ deps='HEIMDAL_ROKEN_H'
+ )
+
+
+bld.SAMBA_BINARY('samba4kinit',
+ '../heimdal/kuser/kinit.c ../heimdal/lib/vers/print_version.c',
+ deps='HEIMDAL_KRB5 HEIMDAL_NTLM'
+ )
+
+
+bld.SAMBA_BINARY('samba4kpasswd',
+ '../heimdal/kpasswd/kpasswd.c ../heimdal/lib/vers/print_version.c',
+ deps='HEIMDAL_KRB5 HEIMDAL_NTLM'
+ )
+
+
+bld.SAMBA_BINARY('rkpty',
+ '../heimdal/lib/roken/rkpty.c ../../lib/socket_wrapper/socket_wrapper.c',
+ deps='HEIMDAL_ROKEN OPENPTY'
+ )
+
diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure
new file mode 100644
index 0000000000..b56b4f5f63
--- /dev/null
+++ b/source4/heimdal_build/wscript_configure
@@ -0,0 +1,37 @@
+conf.CHECK_TYPE('u_char', 'uint8_t')
+conf.CHECK_TYPE('u_int32_t', 'uint32_t')
+
+conf.CHECK_HEADERS('err.h')
+
+conf.CHECK_HEADERS('ifaddrs.h')
+conf.CHECK_HEADERS('''crypt.h curses.h errno.h inttypes.h netdb.h signal.h sys/bswap.h
+ sys/file.h sys/stropts.h sys/timeb.h sys/times.h sys/uio.h sys/un.h
+ sys/utsname.h term.h termcap.h time.h timezone.h ttyname.h netinet/in.h
+ netinet/in6.h netinet6/in6.h libintl.h''')
+
+conf.CHECK_FUNCS('''atexit cgetent getprogname setprogname inet_aton gethostname getnameinfo
+ iruserok putenv rcmd readv sendmsg setitimer socket strlwr strncasecmp
+ strptime strsep strsep_copy strtok_r strupr swab umask uname unsetenv
+ closefrom hstrerror err warn errx warnx flock getipnodebyname
+ getipnodebyaddr freehostent writev''')
+
+conf.CHECK_FUNCS('bswap16')
+conf.CHECK_FUNCS('bswap32')
+
+conf.DEFINE('HAVE_KRB_STRUCT_WINSIZE', 1)
+conf.DEFINE('VOID_RETSIGTYPE', 1)
+conf.CHECK_VARIABLE('h_errno')
+
+conf.CHECK_HEADERS('arpa/nameser.h dns.h')
+conf.CHECK_FUNCS_IN('res_search res_nsearch res_ndestroy dns_search dn_expand', 'resolv')
+conf.CHECK_VARIABLE('_res')
+conf.CHECK_HEADERS('pty.h util.h libutil.h')
+conf.CHECK_FUNCS_IN('openpty', 'util')
+conf.CHECK_FUNCS_IN('gettext', 'intl')
+
+
+conf.DEFINE('HAVE_COM_ERR',1)
+conf.DEFINE('HAVE_KRB5',1)
+conf.DEFINE('HAVE_GSSAPI',1)
+
+conf.DEFINE('SAMBA4_INTERNAL_HEIMDAL', 1)
diff --git a/source4/wscript_build b/source4/wscript_build
index f18e54ca53..b1a59a0408 100644
--- a/source4/wscript_build
+++ b/source4/wscript_build
@@ -1,7 +1,80 @@
# top level waf build script for samba4
+bld.PREDECLARE('LIBNDR', 'LIBRARY')
+bld.PREDECLARE('LIBSAMBA-UTIL', 'LIBRARY')
+bld.PREDECLARE('torture', 'LIBRARY')
+bld.PREDECLARE('TORTURE_RAW', 'MODULE')
+bld.PREDECLARE('TORTURE_RAP', 'MODULE')
+bld.PREDECLARE('TORTURE_LDAP', 'MODULE')
+bld.PREDECLARE('python_dcerpc_misc', 'PYTHON')
+bld.PREDECLARE('python_dcerpc_security', 'PYTHON')
+bld.PREDECLARE('pycredentials', 'PYTHON')
+bld.PREDECLARE('pyauth', 'PYTHON')
+bld.PREDECLARE('gensec', 'LIBRARY')
+bld.PREDECLARE('registry', 'LIBRARY')
+bld.PREDECLARE('HEIMDAL_HDB_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_SPNEGO_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_GSSAPI_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_KRB5_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_DIGEST_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_PKCS8_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_PKCS9_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_PKCS12_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_RFC2459_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_PKINIT_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_CMS_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_OCSP_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_KX509_ASN1', 'ASN1')
+bld.PREDECLARE('HEIMDAL_PKCS10_ASN1', 'ASN1')
+
+# missing subsystems
+bld.SAMBA_SUBSYSTEM('pyldb_util', '')
+bld.SAMBA_SUBSYSTEM('pyldb', '')
+bld.SAMBA_SUBSYSTEM('LIBPOPT', '')
+bld.SAMBA_SUBSYSTEM('LIBCLI_SMB2', '')
+bld.SAMBA_SUBSYSTEM('dcerpc_mgmt', '')
+bld.SAMBA_SUBSYSTEM('TORTURE_LDB_MODULE', '')
+bld.SAMBA_SUBSYSTEM('INTL', '')
+bld.SAMBA_SUBSYSTEM('NDR_SAMR', '')
+bld.SAMBA_SUBSYSTEM('LIBLDB_CMDLINE', '')
+bld.SAMBA_SUBSYSTEM('NETAPI', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('SMBREADLINE', '')
+bld.SAMBA_SUBSYSTEM('OPENPTY', '')
+bld.SAMBA_SUBSYSTEM('SMBCLIENT', '')
+bld.SAMBA_SUBSYSTEM('BLKID', '')
+bld.SAMBA_SUBSYSTEM('LIBTEVENT_EXT', '')
+bld.SAMBA_SUBSYSTEM('LIBTEVENT_EXT', '')
+bld.SAMBA_SUBSYSTEM('PTHREAD', '')
+bld.SAMBA_SUBSYSTEM('CRYPT', '')
+bld.SAMBA_SUBSYSTEM('PAM', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('SASL', '')
+bld.SAMBA_SUBSYSTEM('smbcalls', '')
+bld.SAMBA_SUBSYSTEM('SMBREADLINE', '')
+bld.SAMBA_SUBSYSTEM('SMBREADLINE', '')
+bld.SAMBA_SUBSYSTEM('SETPROCTITLE', '')
+bld.SAMBA_SUBSYSTEM('ZLIB', '')
+bld.SAMBA_SUBSYSTEM('NDR_SRVSVC', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('SETPROCTITLE', '')
+bld.SAMBA_SUBSYSTEM('HDB_LDB', '')
+bld.SAMBA_SUBSYSTEM('ICONV', '')
+bld.SAMBA_SUBSYSTEM('NDR_MISC', '')
+
bld.BUILD_SUBDIR('../lib/replace')
+bld.BUILD_SUBDIR('../lib/talloc')
+bld.BUILD_SUBDIR('../lib/tdb')
+bld.BUILD_SUBDIR('../lib/tevent')
+bld.BUILD_SUBDIR('lib/ldb')
bld.BUILD_SUBDIR('dynconfig')
+bld.BUILD_SUBDIR('../lib/util/charset')
+bld.BUILD_SUBDIR('scripting/python')
+bld.BUILD_SUBDIR('param')
+bld.BUILD_SUBDIR('librpc')
bld.BUILD_SUBDIR('dsdb')
bld.BUILD_SUBDIR('smbd')
bld.BUILD_SUBDIR('cluster')
@@ -12,8 +85,6 @@ bld.BUILD_SUBDIR('../nsswitch')
bld.BUILD_SUBDIR('../nsswitch/libwbclient')
bld.BUILD_SUBDIR('lib/samba3')
bld.BUILD_SUBDIR('lib/socket')
-bld.BUILD_SUBDIR('lib/ldb')
-bld.BUILD_SUBDIR('../lib/util/charset')
bld.BUILD_SUBDIR('lib/ldb-samba')
bld.BUILD_SUBDIR('lib/tls')
bld.BUILD_SUBDIR('lib/registry')
@@ -31,7 +102,6 @@ bld.BUILD_SUBDIR('../lib/crypto')
bld.BUILD_SUBDIR('../lib/torture')
bld.BUILD_SUBDIR('lib')
bld.BUILD_SUBDIR('lib/com')
-bld.BUILD_SUBDIR('param')
bld.BUILD_SUBDIR('smb_server')
bld.BUILD_SUBDIR('rpc_server')
bld.BUILD_SUBDIR('ldap_server')
@@ -46,12 +116,11 @@ bld.BUILD_SUBDIR('utils')
bld.BUILD_SUBDIR('ntvfs')
bld.BUILD_SUBDIR('ntptr')
bld.BUILD_SUBDIR('torture')
-bld.BUILD_SUBDIR('librpc')
+bld.BUILD_SUBDIR('../librpc')
bld.BUILD_SUBDIR('client')
bld.BUILD_SUBDIR('libcli')
bld.BUILD_SUBDIR('../libcli/smb')
bld.BUILD_SUBDIR('../libcli/cldap')
-bld.BUILD_SUBDIR('scripting/python')
bld.BUILD_SUBDIR('kdc')
bld.BUILD_SUBDIR('../lib/smbconf')
bld.BUILD_SUBDIR('../lib/async_req')
@@ -64,3 +133,5 @@ bld.BUILD_SUBDIR('../libcli/samsync')
bld.BUILD_SUBDIR('../libgpo')
bld.BUILD_SUBDIR('../libcli/named_pipe_auth')
bld.BUILD_SUBDIR('heimdal_build')
+
+bld.CHECK_DEPENDENCIES()