[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-502-g88f9e11

Jelmer Vernooij jelmer at samba.org
Sun Jan 20 00:20:44 GMT 2008


The branch, v4-0-test has been updated
       via  88f9e11286bf0f12fc766dbf21f311e5373f0811 (commit)
      from  8deaaa52d305e799d04fc879c25ccbf82f01287e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 88f9e11286bf0f12fc766dbf21f311e5373f0811
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 20 01:19:59 2008 +0100

    build: Fix handling of external pkg-config dependencies when generating pkg-config files.

-----------------------------------------------------------------------

Summary of changes:
 source/build/m4/public.m4           |   11 +++++++----
 source/build/smb_build/config_mk.pm |    3 +++
 source/build/smb_build/makefile.pm  |   15 ++++++---------
 3 files changed, 16 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/build/m4/public.m4 b/source/build/m4/public.m4
index 9e82e6a..6d693ea 100644
--- a/source/build/m4/public.m4
+++ b/source/build/m4/public.m4
@@ -8,7 +8,7 @@ dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems)
 dnl
 dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
 dnl
-dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
+dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags,pcname)
 dnl
 dnl SMB_ENABLE(name,default_build)
 dnl
@@ -34,7 +34,7 @@ ENABLE = YES
 "
 ])
 
-dnl SMB_LIBRARY(name,description,obj_files,required_subsystems,version,so_version,cflags,ldflags)
+dnl SMB_LIBRARY(name,description,obj_files,required_subsystems,version,so_version,cflags,ldflags,pcname)
 AC_DEFUN([SMB_LIBRARY],
 [
 SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES
@@ -48,6 +48,7 @@ VERSION = $5
 SO_VERSION = $6 
 CFLAGS = $7
 LDFLAGS = $8
+PC_NAME = $9
 ENABLE = YES
 # End Library $1
 ###################################
@@ -93,7 +94,8 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
 					[`$PKG_CONFIG --libs-only-l '$2'`], 
 					[`$PKG_CONFIG --cflags-only-other '$2'`],
 					[`$PKG_CONFIG --cflags-only-I '$2'`],
-					[`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`])
+					[`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`],
+					[ $2 ])
 				ac_cv_$1_found=yes
 
         		else
@@ -125,7 +127,7 @@ include $1
 "
 ])
 
-dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
+dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags,pcname)
 AC_DEFUN([SMB_EXT_LIB],
 [
 
@@ -137,6 +139,7 @@ LIBS = $2
 CFLAGS = $3
 CPPFLAGS = $4
 LDFLAGS = $5
+PC_NAME = $6
 # End Ext Lib $1
 ###################################
 "
diff --git a/source/build/smb_build/config_mk.pm b/source/build/smb_build/config_mk.pm
index 7ad6600..2365ca1 100644
--- a/source/build/smb_build/config_mk.pm
+++ b/source/build/smb_build/config_mk.pm
@@ -18,6 +18,7 @@ my $section_types = {
 		"CFLAGS"		=> "list",
 		"CPPFLAGS"		=> "list",
 		"LDFLAGS"		=> "list",
+		"PC_NAME" => "string",
 		},
 	"PYTHON" => {
 		SWIG_FILE => "string",
@@ -87,6 +88,8 @@ my $section_types = {
 		"VERSION"		=> "string",
 		"SO_VERSION"		=> "string",
 		"LIBRARY_REALNAME" => "string",
+
+		"PC_NAME" => "string",
 		
 		"INIT_FUNCTION_TYPE"	=> "string",
 		"INIT_FUNCTION_SENTINEL" => "string",
diff --git a/source/build/smb_build/makefile.pm b/source/build/smb_build/makefile.pm
index ce1e757..7e715b4 100644
--- a/source/build/smb_build/makefile.pm
+++ b/source/build/smb_build/makefile.pm
@@ -570,24 +570,21 @@ sub PkgConfig($$$)
 	my $pubs;
 	my $privs;
 	my $privlibs;
+	my $publibs = "";
 
 	if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
 		foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
 			next if ($other->{$_}->{ENABLE} eq "NO");
-			if ($other->{$_}->{TYPE} eq "EXT_LIB") {
+			if (defined($other->{$_}->{PC_NAME})) {
+				$pubs .= "$other->{$_}->{PC_NAME} ";
+			} elsif ($other->{$_}->{TYPE} eq "EXT_LIB") {
 				my $e = $other->{$_};
-
 				my $ldflags = join(" ", @{$e->{LDFLAGS}});
 				$ldflags .= " " unless $ldflags eq "";
 				my $libs = join(" ", @{$e->{LIBS}});
 				$libs .= " " unless $libs eq "";
 
-				$pubs .= $ldflags.$libs;
-			} elsif ($other->{$_}->{TYPE} eq "LIBRARY") {
-				s/^LIB//g;
-				$_ = lc($_);
-
-				$pubs .= "$_ ";
+				$publibs .= $ldflags.$libs;
 			} else {
 				s/^LIB//g;
 				$_ = lc($_);
@@ -626,7 +623,7 @@ sub PkgConfig($$$)
 	smb_build::env::PkgConfig($self,
 		$path,
 		$link_name,
-		"-L\${libdir} -l$link_name",
+		"-L\${libdir} -l$link_name $publibs",
 		$privlibs,
 		"",
 		"$ctx->{VERSION}",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list