summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/makefile.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-26 20:06:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:17 -0500
commitb89c019824cb14621da6a8dd8b016063945cfecf (patch)
tree83a49e34a8e1d40a76131da1f312f902eba7cf33 /source4/build/smb_build/makefile.pm
parent344a0ebb431936766c06043a8030e7475ebf2d13 (diff)
downloadsamba-b89c019824cb14621da6a8dd8b016063945cfecf.tar.gz
samba-b89c019824cb14621da6a8dd8b016063945cfecf.tar.bz2
samba-b89c019824cb14621da6a8dd8b016063945cfecf.zip
r11307: Add support for generating pkg-config files
(This used to be commit 9c211507c15092ce09fd519cd0ffadf4b9f69492)
Diffstat (limited to 'source4/build/smb_build/makefile.pm')
-rw-r--r--source4/build/smb_build/makefile.pm18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 929c4add18..c0b9e36e4f 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -26,6 +26,7 @@ sub new($$$$)
$self->{static_libs} = [];
$self->{shared_libs} = [];
$self->{headers} = [];
+ $self->{pc_files} = [];
$self->{output} = "";
$self->{mkfile} = $mkfile;
@@ -60,6 +61,8 @@ sub new($$$$)
$self->MergedObj($key) if $key->{OUTPUT_TYPE} eq "MERGEDOBJ";
$self->ObjList($key) if $key->{OUTPUT_TYPE} eq "OBJLIST";
$self->StaticLibrary($key) if $key->{OUTPUT_TYPE} eq "STATIC_LIBRARY";
+ $self->PkgConfig($key) if ($key->{OUTPUT_TYPE} eq "SHARED_LIBRARY") and
+ defined($key->{MAJOR_VERSION});
$self->SharedLibrary($key) if $key->{OUTPUT_TYPE} eq "SHARED_LIBRARY";
$self->Binary($key) if $key->{OUTPUT_TYPE} eq "BINARY";
$self->Manpage($key) if defined($key->{MANPAGE});
@@ -405,6 +408,17 @@ sub Manpage($$)
push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
}
+sub PkgConfig($$)
+{
+ my ($self,$ctx) = @_;
+
+ my $path = "$ctx->{BASEDIR}/$ctx->{NAME}.pc";
+
+ push (@{$self->{pc_files}}, $path);
+
+ smb_build::env::PkgConfig($self,$path,$ctx->{NAME},"FIXME",join(' ', @{$ctx->{CFLAGS}}), "$ctx->{MAJOR_VERSION}.$ctx->{MINOR_VERSION}.$ctx->{RELEASE_VERSION}");
+}
+
sub write($$)
{
my ($self,$file) = @_;
@@ -415,6 +429,7 @@ sub write($$)
$self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n");
$self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
$self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
+ $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
if ($self->{developer}) {
$self->output(<<__EOD__
@@ -433,8 +448,7 @@ __EOD__
print MAKEFILE $self->{output};
close(MAKEFILE);
- print "build/smb_build/main.pl: creating $file\n";
- return;
+ print __FILE__.": creating $file\n";
}
1;