From 61ff97e360b92aae536a4e2b8cae9ad9c3fa875f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 26 Apr 2006 11:58:42 +0000 Subject: r15271: Fix --enable-dso (This used to be commit 8de11ec2445ce414b37938b07937fdd7837f89a2) --- source4/build/smb_build/TODO | 3 --- source4/build/smb_build/input.pm | 28 +++++++++++++++++----------- source4/build/smb_build/output.pm | 10 ++++++++-- source4/lib/socket/config.mk | 3 ++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/source4/build/smb_build/TODO b/source4/build/smb_build/TODO index e74e7790a0..2c4a913828 100644 --- a/source4/build/smb_build/TODO +++ b/source4/build/smb_build/TODO @@ -1,7 +1,4 @@ - let the build system implement some make functions($(patsubst),$(wildcard),...) and use our own implementations where `make' does not support them -- fix --enable-dso: - - loop over all the dependencies of a SUBSYSTEM - - include their PUBLIC_CFLAGS - make --enable-dso the default - fix module loading for selftest during non-developer builds - clearer distinction between dcerpc and ndr. seperate interface tables? diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index 488ac5c6ec..c153e0c95d 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -120,23 +120,24 @@ sub check_binary($$) my $level = ""; -sub calc_unique_deps($$$) +sub calc_unique_deps($$$$) { - sub calc_unique_deps($$$); - my ($name, $deps, $udeps) = @_; + sub calc_unique_deps($$$$); + my ($name, $deps, $udeps, $withlibs) = @_; print "$level-> $name\n" if ($ENV{SMB_BUILD_VERBOSE}); $level.=" "; foreach my $dep (@{$deps}) { - if (not defined($udeps->{$$dep->{NAME}})) { - if (defined ($$dep->{OUTPUT_TYPE}) && (($$dep->{OUTPUT_TYPE} eq "OBJ_LIST") - or ($$dep->{OUTPUT_TYPE} eq "MERGEDOBJ"))) { + next if defined($udeps->{$$dep->{NAME}}); + + if (defined ($$dep->{OUTPUT_TYPE}) && + ($withlibs or ($$dep->{OUTPUT_TYPE} eq "OBJ_LIST") or ($$dep->{OUTPUT_TYPE} eq "MERGEDOBJ"))) { $udeps->{$$dep->{NAME}} = "BUSY"; - calc_unique_deps($$dep->{NAME}, $$dep->{DEPENDENCIES}, $udeps); - } - $udeps->{$$dep->{NAME}} = $$dep; - } + calc_unique_deps($$dep->{NAME}, $$dep->{DEPENDENCIES}, $udeps, $withlibs); + } + + $udeps->{$$dep->{NAME}} = $$dep; } $level = substr($level, 1); @@ -209,7 +210,12 @@ sub check($$$$$) foreach my $part (values %depend) { $part->{UNIQUE_DEPENDENCIES} = {}; - calc_unique_deps($part->{NAME}, $part->{DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES}); + calc_unique_deps($part->{NAME}, $part->{DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES}, 0); + } + + foreach my $part (values %depend) { + $part->{UNIQUE_DEPENDENCIES_ALL} = {}; + calc_unique_deps($part->{NAME}, $part->{DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_ALL}, 1); } return \%depend; diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 5c54feee1b..a53a9263f9 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -147,12 +147,18 @@ sub create_output($$) foreach $part (values %{$depend}) { next if not defined($part->{OUTPUT_TYPE}); - # Always import the CFLAGS and CPPFLAGS of the unique dependencies - foreach my $elem (values %{$part->{UNIQUE_DEPENDENCIES}}) { + foreach my $elem (values %{$part->{UNIQUE_DEPENDENCIES_ALL}}) { next if $elem == $part; push(@{$part->{PUBLIC_CFLAGS}}, @{$elem->{CPPFLAGS}}) if defined(@{$elem->{CPPFLAGS}}); push(@{$part->{PUBLIC_CFLAGS}}, $elem->{CFLAGS}) if defined($elem->{CFLAGS}); + } + + + # Always import the CFLAGS and CPPFLAGS of the unique dependencies + foreach my $elem (values %{$part->{UNIQUE_DEPENDENCIES}}) { + next if $elem == $part; + push(@{$part->{LINK_LIST}}, $elem->{OUTPUT}) if defined($elem->{OUTPUT}); push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk index db60a8bf9f..fe4e00eedf 100644 --- a/source4/lib/socket/config.mk +++ b/source4/lib/socket/config.mk @@ -40,6 +40,7 @@ OBJ_FILES = \ access.o \ connect_multi.o \ connect.o -PUBLIC_DEPENDENCIES = LIBCLI_RESOLVE SOCKET_WRAPPER LIBTALLOC +PUBLIC_DEPENDENCIES = LIBTALLOC +PRIVATE_DEPENDENCIES = LIBCLI_RESOLVE SOCKET_WRAPPER # End SUBSYSTEM SOCKET ################################################ -- cgit