svn commit: samba r11307 - in branches/SAMBA_4_0/source: . build/smb_build

jelmer at samba.org jelmer at samba.org
Wed Oct 26 20:06:26 GMT 2005


Author: jelmer
Date: 2005-10-26 20:06:26 +0000 (Wed, 26 Oct 2005)
New Revision: 11307

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

Log:
Add support for generating pkg-config files

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


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/env.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/env.pm	2005-10-26 19:07:01 UTC (rev 11306)
+++ branches/SAMBA_4_0/source/build/smb_build/env.pm	2005-10-26 20:06:26 UTC (rev 11307)
@@ -45,5 +45,28 @@
 	}
 }
 
+sub PkgConfig($$$$$$)
+{
+	my ($self,$path,$name,$libs,$cflags,$version) = @_;
 
+	print __FILE__.": creating $path\n";
+
+	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__
+
+	print OUT "Name: $name\n";
+	print OUT "Version: $version\n";
+	print OUT "Libs: $libs\n";
+	print OUT "Cflags: $cflags\n";
+
+	close(OUT);
+}
+
 1;

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2005-10-26 19:07:01 UTC (rev 11306)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2005-10-26 20:06:26 UTC (rev 11307)
@@ -26,6 +26,7 @@
 	$self->{static_libs} = [];
 	$self->{shared_libs} = [];
 	$self->{headers} = [];
+	$self->{pc_files} = [];
 	$self->{output} = "";
 
 	$self->{mkfile} = $mkfile;
@@ -60,6 +61,8 @@
 		$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 @@
 	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 @@
 	$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 @@
 	print MAKEFILE $self->{output};
 	close(MAKEFILE);
 
-	print "build/smb_build/main.pl: creating $file\n";
-	return;	
+	print __FILE__.": creating $file\n";
 }
 
 1;

Modified: branches/SAMBA_4_0/source/build/smb_build/smb_build_h.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/smb_build_h.pm	2005-10-26 19:07:01 UTC (rev 11306)
+++ branches/SAMBA_4_0/source/build/smb_build/smb_build_h.pm	2005-10-26 20:06:26 UTC (rev 11307)
@@ -108,7 +108,7 @@
 	print SMB_BUILD_H $output;
 	close(SMB_BUILD_H);
 
-	print "build/smb_build/main.pl: creating $file\n";
+	print __FILE__.": creating $file\n";
 	return;	
 }
 1;

Modified: branches/SAMBA_4_0/source/main.mk
===================================================================
--- branches/SAMBA_4_0/source/main.mk	2005-10-26 19:07:01 UTC (rev 11306)
+++ branches/SAMBA_4_0/source/main.mk	2005-10-26 20:06:26 UTC (rev 11307)
@@ -199,7 +199,6 @@
 	-rm -f config.log config.cache
 	-rm -f samba4-deps.dot
 	-rm -f config.pm config.mk
-	-rm -f lib/registry/winregistry.pc
 
 removebackup:
 	-rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~



More information about the samba-cvs mailing list