From 930e624d816a175d5ca4448e6ed40bc7dd8ec5b7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 28 Jul 2005 11:51:37 +0000 Subject: r8826: Make configure generate config.mk files (with the external libraries that were found) and a config.pm file (with all substitution variables) (This used to be commit 52bb1374bbcfc9b9a6d098687bafe9021a1ee858) --- source4/build/smb_build/config_mk.pm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (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 ba8badc3d1..d26d85f5b9 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -19,6 +19,10 @@ my %attribute_types = ( "ADD_OBJ_FILES" => "list", "OBJ_FILES" => "list", "SUBSYSTEM" => "string", + "CFLAGS" => "list", + "CPPFLAGS" => "list", + "LDFLAGS" => "list", + "LIBS" => "list", "INIT_FUNCTION" => "string", "MAJOR_VERSION" => "string", "MINOR_VERSION" => "string", @@ -168,7 +172,7 @@ sub import_file($$) $input->{$name}{TYPE} = $type; foreach my $key (values %{$result->{$section}}) { - $key->{VAL} = input::strtrim($key->{VAL}); + $key->{VAL} = smb_build::input::strtrim($key->{VAL}); my $vartype = $attribute_types{$key->{KEY}}; if (not defined($vartype)) { die("Unknown attribute $key->{KEY}"); @@ -176,7 +180,7 @@ sub import_file($$) if ($vartype eq "string") { $input->{$name}{$key->{KEY}} = $key->{VAL}; } elsif ($vartype eq "list") { - $input->{$name}{$key->{KEY}} = [input::str2array($key->{VAL})]; + $input->{$name}{$key->{KEY}} = [smb_build::input::str2array($key->{VAL})]; } elsif ($vartype eq "bool") { if (($key->{VAL} ne "YES") and ($key->{VAL} ne "NO")) { die("Invalid value for bool attribute $key->{KEY}: $key->{VAL}"); @@ -186,4 +190,20 @@ sub import_file($$) } } } + +sub import_files($$) +{ + my ($input, $config_list) = @_; + + open(IN, $config_list) or die("Can't open $config_list: $!"); + my @mkfiles = grep{!/^#/} ; + close(IN); + + $| = 1; + + foreach (@mkfiles) { + s/\n//g; + import_file($input, $_); + } +} 1; -- cgit