summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/config_mk.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-14 16:22:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:47 -0500
commit8e16d8a76f8a3b8ccc89eb317c8e5daa6cf43b71 (patch)
tree8e8ccaddb94efc6a85ab6c339cab76cea1f44085 /source4/build/smb_build/config_mk.pm
parent7367d23713a34a6c29a492adb365292399adffe8 (diff)
downloadsamba-8e16d8a76f8a3b8ccc89eb317c8e5daa6cf43b71.tar.gz
samba-8e16d8a76f8a3b8ccc89eb317c8e5daa6cf43b71.tar.bz2
samba-8e16d8a76f8a3b8ccc89eb317c8e5daa6cf43b71.zip
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)
Diffstat (limited to 'source4/build/smb_build/config_mk.pm')
-rw-r--r--source4/build/smb_build/config_mk.pm24
1 files changed, 23 insertions, 1 deletions
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;