summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/smb_build/makefile.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index eab8674ed1..c6ab0d7220 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -10,6 +10,7 @@ use smb_build::env;
use strict;
use base 'smb_build::env';
+use Cwd 'abs_path';
sub new($$$)
{
@@ -103,6 +104,7 @@ sub _prepare_compiler_linker($)
my $devld_local = "";
my $devld_install = "";
+ my $builddir_headers = "";
$self->{duplicate_build} = 0;
if ($self->{config}->{LIBRARY_OUTPUT_TYPE} eq "SHARED_LIBRARY") {
@@ -112,6 +114,10 @@ sub _prepare_compiler_linker($)
}
$devld_install = " -Wl,-rpath-link,\$(builddir)/bin";
}
+
+ if (!(abs_path($self->{config}->{srcdir}) eq abs_path($self->{config}->{builddir}))) {
+ $builddir_headers= "-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
+ }
$self->output(<< "__EOD__"
SHELL=$self->{config}->{SHELL}
@@ -122,7 +128,7 @@ CPP=$self->{config}->{CPP}
CPPFLAGS=$self->{config}->{CPPFLAGS}
CC=$self->{config}->{CC}
-CFLAGS=-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib -I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE_CONFIG_H $self->{config}->{CFLAGS} \$(CPPFLAGS)
+CFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE_CONFIG_H $self->{config}->{CFLAGS} \$(CPPFLAGS)
PICFLAG=$self->{config}->{PICFLAG}
HOSTCC=$self->{config}->{HOSTCC}