summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/config_mk.pm4
-rw-r--r--source4/build/smb_build/input.pm23
-rw-r--r--source4/build/smb_build/makefile.pm4
3 files changed, 28 insertions, 3 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 80da0ab2fa..65f873f500 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -76,7 +76,9 @@ my $section_types = {
"PUBLIC_HEADERS" => "list",
"CFLAGS" => "string",
- "STANDARD_VISIBILITY" => "string"
+ "STANDARD_VISIBILITY" => "string",
+
+ "USE_HOSTCC" => "bool"
},
"LIBRARY" => {
"VERSION" => "string",
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index b07c9b1a07..a8f5485a35 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -30,6 +30,25 @@ sub str2array($)
return split /[ \t\n]/;
}
+sub add_libreplace($)
+{
+ my ($part) = @_;
+
+ return if ($part->{NAME} eq "LIBREPLACE");
+ return if ($part->{NAME} eq "LIBREPLACE_HOSTCC");
+
+ foreach my $n (@{$part->{PRIVATE_DEPENDENCIES}}) {
+ return if ($n eq "LIBREPLACE");
+ return if ($n eq "LIBREPLACE_HOSTCC");
+ }
+
+ if (defined($part->{USE_HOSTCC}) && $part->{USE_HOSTCC} eq "YES") {
+ push (@{$part->{PRIVATE_DEPENDENCIES}}, "LIBREPLACE_HOSTCC");
+ } else {
+ push (@{$part->{PRIVATE_DEPENDENCIES}}, "LIBREPLACE");
+ }
+}
+
sub check_subsystem($$$)
{
my ($INPUT, $subsys, $default_ot) = @_;
@@ -38,6 +57,7 @@ sub check_subsystem($$$)
unless(defined($subsys->{OUTPUT_TYPE})) {
$subsys->{OUTPUT_TYPE} = $default_ot;
}
+ add_libreplace($subsys);
}
sub check_module($$$)
@@ -75,6 +95,7 @@ sub check_module($$$)
} else {
push (@{$INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS}}, $mod->{INIT_FUNCTION}) if defined($mod->{INIT_FUNCTION});
}
+ add_libreplace($mod);
}
sub check_library($$$)
@@ -100,6 +121,7 @@ sub check_library($$$)
}
$lib->{INSTALLDIR} = "LIBDIR";
+ add_libreplace($lib);
}
sub check_binary($$)
@@ -111,6 +133,7 @@ sub check_binary($$)
($bin->{BINARY} = (lc $bin->{NAME})) if not defined($bin->{BINARY});
$bin->{OUTPUT_TYPE} = "BINARY";
+ add_libreplace($bin);
}
sub import_integrated($$)
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 5309adea1d..a453cb6203 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -117,7 +117,7 @@ sub _prepare_compiler_linker($)
}
if (!(abs_path($self->{config}->{srcdir}) eq abs_path($self->{config}->{builddir}))) {
- $builddir_headers= "-I\$(builddir)/include -I\$(builddir)/lib/replace -I\$(builddir) -I\$(builddir)/lib ";
+ $builddir_headers= "-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
}
$self->output(<< "__EOD__"
@@ -126,7 +126,7 @@ SHELL=$self->{config}->{SHELL}
PERL=$self->{config}->{PERL}
CPP=$self->{config}->{CPP}
-CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir)/lib/replace -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
+CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
CC=$self->{config}->{CC}
CFLAGS=$self->{config}->{CFLAGS} \$(CPPFLAGS)