Author: jelmer
Date: 2006-11-24 16:45:42 +0000 (Fri, 24 Nov 2006)
New Revision: 19881

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19881

Log:
Add private library flags when linking to static libraries.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/env.pm
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/env.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/env.pm    2006-11-24 16:31:42 UTC 
(rev 19880)
+++ branches/SAMBA_4_0/source/build/smb_build/env.pm    2006-11-24 16:45:42 UTC 
(rev 19881)
@@ -53,9 +53,9 @@
        $self->{automatic_deps} = ($self->{config}->{automatic_dependencies} eq 
"yes");
 }
 
-sub PkgConfig($$$$$$$$$$$)
+sub PkgConfig($$$$$$$$$$$$)
 {
-       my 
($self,$path,$name,$libs,$cflags,$version,$desc,$hasmodules,$pubdep,$privdep,$dirs)
 = @_;
+       my 
($self,$path,$name,$libs,$privlibs,$cflags,$version,$desc,$hasmodules,$pubdep,$privdep,$dirs)
 = @_;
 
        print __FILE__.": creating $path\n";
 
@@ -83,6 +83,7 @@
        print OUT "Requires.private: $privdep\n" if defined($privdep);
        print OUT "Version: $version\n";
        print OUT "Libs: $libs\n";
+       print OUT "Libs.private: $privlibs\n" if (defined($privlibs));
        print OUT "Cflags: -I\${includedir} $cflags\n";
 
        close(OUT);

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm       2006-11-24 
16:31:42 UTC (rev 19880)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm       2006-11-24 
16:45:42 UTC (rev 19881)
@@ -411,6 +411,7 @@
 
        my $pubs;
        my $privs;
+       my $privlibs;
 
        if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
                foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
@@ -425,12 +426,17 @@
 
        if (defined($ctx->{PRIVATE_DEPENDENCIES})) {
                foreach (@{$ctx->{PRIVATE_DEPENDENCIES}}) {
-                       next unless ($other->{$_}->{TYPE} eq "LIBRARY");
+                       if ($other->{$_}->{TYPE} eq "LIBRARY") {
+                               s/^LIB//g;
+                               $_ = lc($_);
 
-                       s/^LIB//g;
-                       $_ = lc($_);
+                               $privs .= "$_ ";
+                       } else {
+                               s/^LIB//g;
+                               $_ = lc($_);
 
-                       $privs .= "$_ ";
+                               $privlibs .= "-l$_ ";
+                       }
                }
        }
 
@@ -438,6 +444,7 @@
                $path,
                $link_name,
                "-L\${libdir} -l$link_name",
+               $privlibs,
                "",
                "$ctx->{VERSION}",
                $ctx->{DESCRIPTION},
@@ -455,6 +462,7 @@
                "bin/pkgconfig/$link_name-uninstalled.pc",
                $link_name,
                "-Lbin/shared -Lbin/static -l$link_name",
+               $privlibs,
                "-I. -Iinclude -Ilib -Ilib/replace",
                "$ctx->{VERSION}",
                $ctx->{DESCRIPTION},

Reply via email to