diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-10-21 16:29:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:06 -0500 |
commit | 4c5a4a7e0288e9ac0b2f795befd5684059e4c429 (patch) | |
tree | e4ba25456c59c45b535225cae34228f69e3d0551 /source4/build/smb_build | |
parent | 568dd26ac783385c1c2a69a392f5a569ebdd13a2 (diff) | |
download | samba-4c5a4a7e0288e9ac0b2f795befd5684059e4c429.tar.gz samba-4c5a4a7e0288e9ac0b2f795befd5684059e4c429.tar.bz2 samba-4c5a4a7e0288e9ac0b2f795befd5684059e4c429.zip |
r11244: Relative path names in .mk files
(This used to be commit 24e10300906c380919d2d631bfb3b8fd6b3f54ba)
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r-- | source4/build/smb_build/config_mk.pm | 4 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 21 |
2 files changed, 21 insertions, 4 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index e5c8c293aa..b26e70f88b 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -8,6 +8,7 @@ package smb_build::config_mk; use smb_build::input; +use File::Basename; use strict; @@ -131,7 +132,7 @@ sub run_config_mk($$) # include if ($line =~ /^include (.*)$/) { - $makefile .= run_config_mk($input, $1); + $makefile .= run_config_mk($input, dirname($filename)."/$1"); next; } @@ -171,6 +172,7 @@ sub run_config_mk($$) $input->{$name}{NAME} = $name; $input->{$name}{TYPE} = $type; + $input->{$name}{BASEDIR} = dirname($filename); foreach my $key (values %{$result->{$section}}) { $key->{VAL} = smb_build::input::strtrim($key->{VAL}); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index f6c4a78274..46e8ffb0c5 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -10,6 +10,21 @@ package output; use strict; +sub add_dir($$) +{ + my ($dir,$files) = @_; + my @ret = (); + + foreach (@$files) { + $_ = "$dir/$_"; + s/\/\//\//g; + s/\/([^\/\.]+)\/\.\.\//\//g; + push (@ret, $_); + } + + return @ret; +} + sub generate_mergedobj($) { my $subsys = shift; @@ -93,9 +108,9 @@ sub create_output($) next if not defined($part->{OUTPUT_TYPE}); # Combine object lists - push(@{$part->{OBJ_LIST}}, @{$part->{INIT_OBJ_FILES}}) if defined($part->{INIT_OBJ_FILES}); - push(@{$part->{OBJ_LIST}}, @{$part->{ADD_OBJ_FILES}}) if defined($part->{ADD_OBJ_FILES}); - push(@{$part->{OBJ_LIST}}, @{$part->{OBJ_FILES}}) if defined($part->{OBJ_FILES}); + push(@{$part->{OBJ_LIST}}, add_dir($part->{BASEDIR}, $part->{INIT_OBJ_FILES})) if defined($part->{INIT_OBJ_FILES}); + push(@{$part->{OBJ_LIST}}, add_dir($part->{BASEDIR}, $part->{ADD_OBJ_FILES})) if defined($part->{ADD_OBJ_FILES}); + push(@{$part->{OBJ_LIST}}, add_dir($part->{BASEDIR}, $part->{OBJ_FILES})) if defined($part->{OBJ_FILES}); if ((not defined($part->{OBJ_LIST}) or scalar(@{$part->{OBJ_LIST}}) == 0) and |