From 6b5e86f47b21b560827c3ca24ee09f92f80fad3b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 6 Sep 2006 15:28:20 +0000 Subject: r18183: - add LIBREPLACE globaly and add LIBREPLACE_HOSTCC - also specify USE_HOSTCC = YES on binaries that use HOSTCC I also disable autodependecies as this change let make run forever, I hopefully fix that tomorrow metze (This used to be commit 159f74570233a8707dc1deb70fb1917a854213f8) --- source4/build/m4/check_cc.m4 | 1 + source4/build/smb_build/config_mk.pm | 4 +++- source4/build/smb_build/input.pm | 23 +++++++++++++++++++++++ source4/build/smb_build/makefile.pm | 4 ++-- 4 files changed, 29 insertions(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 7f166ff641..397a6dd044 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -285,6 +285,7 @@ if test x$GNU_MAKE = x"yes"; then new_make=yes fi fi +new_make=no AC_MSG_RESULT($new_make) automatic_dependencies=no AX_CFLAGS_GCC_OPTION([-M -MT conftest.d -MF conftest.o], [], [ automatic_dependencies=$new_make ], []) 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) -- cgit