From 8e16d8a76f8a3b8ccc89eb317c8e5daa6cf43b71 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 14 Nov 2004 16:22:01 +0000 Subject: r3733: More build system fixes/features: - Use .mk files directly (no need for a SMB_*_MK() macro when adding a new SUBSYSTEM, MODULE or BINARY). This allows addition of new modules and subsystems without running configure - Add support for generating .dot files with the Samba4 dependency tree (as used by the graphviz and springgraph utilities) (This used to be commit 64826da834e26ee0488674e27a0eae36491ee179) --- source4/build/smb_build/config_mk.pm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'source4/build/smb_build/config_mk.pm') diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 7b8fbd93c3..11ef8cf7b1 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -61,7 +61,7 @@ sub _parse_config_mk($) } # - # 1.) lines with an aplhanumeric character indicate + # 1.) lines with an alphanumeric character indicate # a new variable, # 2.) followed by zero or more whitespaces or tabs # 3.) then one '=' character @@ -437,4 +437,26 @@ sub binary_get_array($$$) return _fetch_array_from_config_mk($filename,$section,$var); } + +sub import_file($$) +{ + my $input = shift; + my $filename = shift; + + my $result = _parse_config_mk($filename); + + die ($result->{ERROR_STR}) unless $result->{ERROR_CODE} == 0; + + foreach my $section (keys %{$result}) { + next if ($section eq "ERROR_CODE"); + my ($type, $name) = split(/::/, $section, 2); + + $input->{$name}{NAME} = $name; + $input->{$name}{TYPE} = $type; + + foreach my $key (values %{$result->{$section}}) { + $input->{$name}{$key->{KEY}} = [input::str2array($key->{VAL})]; + } + } +} 1; -- cgit