r15271: Fix --enable-dso
authorJelmer Vernooij <jelmer@samba.org>
Wed, 26 Apr 2006 11:58:42 +0000 (11:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:04:59 +0000 (14:04 -0500)
source/build/smb_build/TODO
source/build/smb_build/input.pm
source/build/smb_build/output.pm
source/lib/socket/config.mk

index e74e7790a028e0ea2ca61941e2890ce548ec2d73..2c4a913828a286c5e5bbef71b4c1cc167bbfc1da 100644 (file)
@@ -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?
index 488ac5c6ecbe0843231ee62167d0f6bfa49a5dcc..c153e0c95d327c36f8af145ec3b9455f8ab497c7 100644 (file)
@@ -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;
index 5c54feee1b43cfe7c5d1b03b4bd9c31b41752b3a..a53a9263f9772c4724b53e667f1d1b886d90649e 100644 (file)
@@ -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});
index db60a8bf9f99010fcfeb5b82b3361f38d8de14f2..fe4e00eedf7e6a26249c226cbf42cb6a5ef099ed 100644 (file)
@@ -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
 ################################################