summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/config_mk.pm
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2006-04-11 11:37:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:04:03 -0500
commit9cf41988ff6cf0647ec4850f25415ba66845fd70 (patch)
treeb0af5ecca5db64b45b2ab3bf4a83b4050efa18ee /source4/build/smb_build/config_mk.pm
parent970f7122d9095aa95e0513793f69994e235cb1e0 (diff)
downloadsamba-9cf41988ff6cf0647ec4850f25415ba66845fd70.tar.gz
samba-9cf41988ff6cf0647ec4850f25415ba66845fd70.tar.bz2
samba-9cf41988ff6cf0647ec4850f25415ba66845fd70.zip
r15036: Add out of tree build support and see how buildfarm will respond to make constructs
(This used to be commit 9329854489e2c231ffb7986d39009e0936873c11)
Diffstat (limited to 'source4/build/smb_build/config_mk.pm')
-rw-r--r--source4/build/smb_build/config_mk.pm23
1 files changed, 17 insertions, 6 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 587335ac3e..fa948f4bd9 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -109,19 +109,30 @@ use vars qw(@parsed_files);
#
# $filename - the path of the config.mk file
# which should be parsed
-sub run_config_mk($$$)
+sub run_config_mk($$$$)
{
- sub run_config_mk($$$);
- my ($input, $srcdir, $filename) = @_;
+ sub run_config_mk($$$$);
+ my ($input, $srcdir, $builddir, $filename) = @_;
my $result;
my $linenum = -1;
my $infragment = 0;
my $section = "GLOBAL";
my $makefile = "";
- push (@parsed_files, $srcdir."/".$filename);
+ my $parsing_file = $builddir."/".$filename;
+
+ $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");
+ }
+
+ push (@parsed_files, $parsing_file);
+
- open(CONFIG_MK, $srcdir."/".$filename) or die("Can't open `$srcdir/$filename'\n");
my @lines = <CONFIG_MK>;
close(CONFIG_MK);
@@ -151,7 +162,7 @@ sub run_config_mk($$$)
# include
if ($line =~ /^include (.*)$/) {
- $makefile .= run_config_mk($input, $srcdir, dirname($filename)."/$1");
+ $makefile .= run_config_mk($input, $srcdir, $builddir, dirname($filename)."/$1");
next;
}