diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-09-09 11:03:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:00 -0500 |
commit | 899ffd9ba00e823c15fcbf5de602bac4898c2f9a (patch) | |
tree | 3b448394f0ccedf6b4103527a56da3fc53b2c704 /source4/build/smb_build | |
parent | 8b5a9537250e2d55a782c40f51fbedafa3d6bee7 (diff) | |
download | samba-899ffd9ba00e823c15fcbf5de602bac4898c2f9a.tar.gz samba-899ffd9ba00e823c15fcbf5de602bac4898c2f9a.tar.bz2 samba-899ffd9ba00e823c15fcbf5de602bac4898c2f9a.zip |
r10112: - check attributes depending on the section type
metze
(This used to be commit d6af241d7b1459d81479205356c7422c4dcca0fb)
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r-- | source4/build/smb_build/config_mk.pm | 98 |
1 files changed, 74 insertions, 24 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 46b8bf76de..e5c8c293aa 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -11,27 +11,72 @@ use smb_build::input; use strict; -my %attribute_types = ( - "NOPROTO" => "bool", - "REQUIRED_SUBSYSTEMS" => "list", - "OUTPUT_TYPE" => "string", - "INIT_OBJ_FILES" => "list", - "ADD_OBJ_FILES" => "list", - "OBJ_FILES" => "list", - "SUBSYSTEM" => "string", - "CFLAGS" => "list", - "CPPFLAGS" => "list", - "LDFLAGS" => "list", - "INSTALLDIR" => "string", - "LIBS" => "list", - "INIT_FUNCTION" => "string", - "MAJOR_VERSION" => "string", - "MINOR_VERSION" => "string", - "RELEASE_VERSION" => "string", - "ENABLE" => "bool", - "CMD" => "string", - "MANPAGE" => "string" -); +my $section_types = { + "EXT_LIB" => { + "LIBS" => "list", + "CFLAGS" => "list", + "CPPFLAGS" => "list", + "LDFLAGS" => "list", + }, + "SUBSYSTEM" => { + "INIT_FUNCTION" => "string", + "INIT_OBJ_FILES" => "list", + "ADD_OBJ_FILES" => "list", + "OBJ_FILES" => "list", + + "REQUIRED_SUBSYSTEMS" => "list", + "TARGET_DEPS" => "list", + + "ENABLE" => "bool", + "NOPROTO" => "bool", + + "MANPAGE" => "string", + }, + "MODULE" => { + "SUBSYSTEM" => "string", + + "INIT_FUNCTION" => "string", + "INIT_OBJ_FILES" => "list", + "ADD_OBJ_FILES" => "list", + "OBJ_FILES" => "list", + + "REQUIRED_SUBSYSTEMS" => "list", + "TARGET_DEPS" => "list", + + "ENABLE" => "bool", + "NOPROTO" => "bool", + + "MANPAGE" => "string", + }, + "BINARY" => { + "OBJ_FILES" => "list", + + "REQUIRED_SUBSYSTEMS" => "list", + "TARGET_DEPS" => "list", + + "ENABLE" => "bool", + "NOPROTO" => "bool", + + "MANPAGE" => "string", + "INSTALLDIR" => "string", + }, + "LIBRARY" => { + "MAJOR_VERSION" => "string", + "MINOR_VERSION" => "string", + "RELEASE_VERSION" => "string", + + "OBJ_FILES" => "list", + + "REQUIRED_SUBSYSTEMS" => "list", + "TARGET_DEPS" => "list", + + "ENABLE" => "bool", + "NOPROTO" => "bool", + + "MANPAGE" => "string", + "INSTALLDIR" => "string", + } +}; use vars qw(@parsed_files); @@ -118,15 +163,20 @@ sub run_config_mk($$) foreach my $section (keys %{$result}) { my ($type, $name) = split(/::/, $section, 2); - + + my $sectype = $section_types->{$type}; + if (not defined($sectype)) { + die($filename.":[".$section."] unknown section type \"".$type."\"!"); + } + $input->{$name}{NAME} = $name; $input->{$name}{TYPE} = $type; foreach my $key (values %{$result->{$section}}) { $key->{VAL} = smb_build::input::strtrim($key->{VAL}); - my $vartype = $attribute_types{$key->{KEY}}; + my $vartype = $sectype->{$key->{KEY}}; if (not defined($vartype)) { - die("$filename:Unknown attribute $key->{KEY} with value $key->{VAL} in section $section"); + die($filename.":[".$section."]: unknown attribute type \"$key->{KEY}\"!"); } if ($vartype eq "string") { $input->{$name}{$key->{KEY}} = $key->{VAL}; |