summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-09 09:05:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:03 -0500
commit1a7ad8e573b87f6db3f955498b736ce69bf484ec (patch)
treef29802edec5b5cd1c91f0064da1ca2da55dbadf1 /source4/build
parente04ad03d66329a45d9855b4e65ea62acceb6ecb8 (diff)
downloadsamba-1a7ad8e573b87f6db3f955498b736ce69bf484ec.tar.gz
samba-1a7ad8e573b87f6db3f955498b736ce69bf484ec.tar.bz2
samba-1a7ad8e573b87f6db3f955498b736ce69bf484ec.zip
r18294: remove leading ././ from .mk files
metze (This used to be commit f41e2f7f5a71d22ae6b27ac9fb0239512728e12c)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/smb_build/config_mk.pm36
1 files changed, 28 insertions, 8 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 5c5c0ad92b..fbf20f4ae9 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -130,17 +130,32 @@ sub run_config_mk($$$$)
my $section = "GLOBAL";
my $makefile = "";
- my $parsing_file = $builddir."/".$filename;
+ my $parsing_file = $filename;
+ my $retry_parsing_file = undef;
$ENV{samba_builddir} = $builddir;
$ENV{samba_srcdir} = $srcdir;
-
- if (!open(CONFIG_MK, $parsing_file)) {
- $parsing_file = $srcdir."/".$filename;
- open(CONFIG_MK, $parsing_file) or
- die("Can't open neither `$builddir."/".$filename' nor `$srcdir/$filename'\n");
+
+ if (($srcdir ne ".") or ($builddir ne ".")) {
+ $parsing_file = $builddir."/".$filename;
+ $retry_parsing_file = $srcdir."/".$filename;
}
-
+
+ if (open(CONFIG_MK, $parsing_file)) {
+ $retry_parsing_file = undef;
+ } else {
+ die("Can't open $parsing_file") unless defined($retry_parsing_file);
+ }
+
+ if (defined($retry_parsing_file)) {
+ if (open(CONFIG_MK, $parsing_file)) {
+ $parsing_file = $retry_parsing_file;
+ $retry_parsing_file = undef;
+ } else {
+ die("Can't open neither '$parsing_file' nor '$retry_parsing_file'\n");
+ }
+ }
+
push (@parsed_files, $parsing_file);
@@ -173,7 +188,12 @@ sub run_config_mk($$$$)
# include
if ($line =~ /^include (.*)$/) {
- $makefile .= run_config_mk($input, $srcdir, $builddir, dirname($filename)."/$1");
+ my $subfile= $1;
+ my $subdir = dirname($filename);
+ $subdir =~ s/^\.$//g;
+ $subdir =~ s/^\.\///g;
+ $subdir .= "/" if ($subdir ne "");
+ $makefile .= run_config_mk($input, $srcdir, $builddir, $subdir.$subfile);
next;
}