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/env.pm16
-rw-r--r--source4/build/smb_build/main.pl2
-rw-r--r--source4/build/smb_build/makefile.pm48
3 files changed, 44 insertions, 22 deletions
diff --git a/source4/build/smb_build/env.pm b/source4/build/smb_build/env.pm
index 8a34f40ad6..1466a8679c 100644
--- a/source4/build/smb_build/env.pm
+++ b/source4/build/smb_build/env.pm
@@ -53,9 +53,9 @@ sub _set_config($$)
$self->{automatic_deps} = ($self->{config}->{automatic_dependencies} eq "yes");
}
-sub PkgConfig($$$$$$$$$$)
+sub PkgConfig($$$$$$$$$$$)
{
- my ($self,$path,$name,$libs,$cflags,$version,$desc,$hasmodules,$pubdep,$privdep) = @_;
+ my ($self,$path,$name,$libs,$cflags,$version,$desc,$hasmodules,$pubdep,$privdep,$dirs) = @_;
print __FILE__.": creating $path\n";
@@ -66,13 +66,9 @@ sub PkgConfig($$$$$$$$$$)
mkpath(dirname($path),0,0755);
open(OUT, ">$path") or die("Can't open $path: $!");
- print OUT <<"__EOF__";
-prefix=$self->{config}->{prefix}
-exec_prefix=$self->{config}->{exec_prefix}
-libdir=$self->{config}->{libdir}
-includedir=$self->{config}->{includedir}
-__EOF__
-
+ foreach (keys %$dirs) {
+ print OUT "$_=" . $dirs->{$_} . "\n";
+ }
if ($hasmodules) {
print OUT "modulesdir=$self->{config}->{modulesdir}/$name\n" ;
}
@@ -86,7 +82,7 @@ __EOF__
print OUT "Requires: $pubdep\n" if defined($pubdep);
print OUT "Requires.private: $privdep\n" if defined($privdep);
print OUT "Version: $version\n";
- print OUT "Libs: -L\${libdir} $libs\n";
+ print OUT "Libs: $libs\n";
print OUT "Cflags: -I\${includedir} $cflags\n";
close(OUT);
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index 7500a8c81b..841464d03b 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -53,7 +53,7 @@ foreach my $key (values %$OUTPUT) {
next unless defined $key->{OUTPUT_TYPE};
$mkenv->StaticLibrary($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}});
- $mkenv->PkgConfig($key) if $key->{TYPE} eq "LIBRARY"
+ $mkenv->PkgConfig($key, $OUTPUT) if $key->{TYPE} eq "LIBRARY"
and defined($key->{VERSION});
$mkenv->SharedLibrary($key) if grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}});
$mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}});
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index d872f0189b..63bf3c0916 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -265,8 +265,7 @@ __EOD__
my $soarg = "";
my $soargdebug = "";
- if ($self->{config}->{SONAMEFLAG} ne "" and
- defined($ctx->{LIBRARY_SONAME})) {
+ if ($self->{config}->{SONAMEFLAG} ne "" and defined($ctx->{LIBRARY_SONAME})) {
$soarg = "$self->{config}->{SONAMEFLAG}$ctx->{LIBRARY_SONAME} ";
if ($ctx->{LIBRARY_REALNAME} ne $ctx->{LIBRARY_SONAME}) {
$soargdebug = "\n\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}";
@@ -291,7 +290,7 @@ $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_
\$($ctx->{TYPE}_$ctx->{NAME}\_FULL_OBJ_LIST) \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $extraflags \\
$soarg \\
- $init_obj $singlesoarg
+ $init_obj $singlesoarg$soargdebug
__EOD__
);
@@ -395,9 +394,9 @@ sub Manpage($$)
push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
}
-sub PkgConfig($$)
+sub PkgConfig($$$)
{
- my ($self,$ctx) = @_;
+ my ($self,$ctx,$other) = @_;
my $link_name = $ctx->{NAME};
@@ -415,30 +414,57 @@ sub PkgConfig($$)
if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
-# next unless ($self-> ) {
+ next unless ($other->{$_}->{TYPE} eq "LIBRARY");
-#FIXME $pubs .= "$_ ";
+ s/^LIB//g;
+ $_ = lc($_);
+
+ $pubs .= "$_ ";
}
}
if (defined($ctx->{PRIVATE_DEPENDENCIES})) {
foreach (@{$ctx->{PRIVATE_DEPENDENCIES}}) {
-# next unless ($self-> ) {
+ next unless ($other->{$_}->{TYPE} eq "LIBRARY");
+
+ s/^LIB//g;
+ $_ = lc($_);
-#FIXME $privs .= "$_ ";
+ $privs .= "$_ ";
}
}
smb_build::env::PkgConfig($self,
$path,
$link_name,
- "-l$link_name",
+ "-L\${libdir} -l$link_name",
"",
"$ctx->{VERSION}",
$ctx->{DESCRIPTION},
defined($ctx->{INIT_FUNCTIONS}),
$pubs,
- $privs
+ $privs,
+ {
+ "prefix" => $self->{config}->{prefix},
+ "exec_prefix" => $self->{config}->{exec_prefix},
+ "libdir" => $self->{config}->{libdir},
+ "includedir" => $self->{config}->{includedir}
+ }
+ );
+ smb_build::env::PkgConfig($self,
+ "bin/pkgconfig/$link_name-uninstalled.pc",
+ $link_name,
+ "-Lbin/shared -Lbin/static -l$link_name",
+ "-I. -Iinclude -Ilib -Ilib/replace",
+ "$ctx->{VERSION}",
+ $ctx->{DESCRIPTION},
+ defined($ctx->{INIT_FUNCTIONS}),
+ $pubs,
+ $privs,
+ {
+ "prefix" => "bin/",
+ "includedir" => "$ctx->{BASEDIR}"
+ }
);
}