Subject: Re: CVS commit: pkgsrc/x11/gtk2-engines
To: Rene Hexel <rh@netbsd.org>
From: Johnny C. Lam <jlam@netbsd.org>
List: tech-pkg
Date: 01/07/2003 16:16:04
--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Jan 07, 2003 at 01:10:19PM -0800, Johnny C. Lam wrote:
> On Tue, Jan 07, 2003 at 07:57:49AM +1000, Rene Hexel wrote:
> > On Mon, 2003-01-06 at 17:32, Nick Hudson wrote:
> > 
> > > > Still, these files serve no purpose other than to bloat the
> > > > package size.  Can't they just be left out of the package even
> > > > though they are built?
> > > 
> > > Not without patching libtool.
> > 
> >   Hmm, we could create a libtool-dynamic package that shares most of
> > libtool-base, but configures with --disable-static.  If we can make this
> > co-exist with libtool-base, we could use libtool-dynamic instead of
> > libtool for packages that create plugins.
> 
> After some discussion with Nick, I'm actively working on this, but
> instead of a separate package, I'm including "shlibtool" in the
> libtool-base package.  I'm going to add a new pkgsrc make variable
> "SHLIBTOOL_OVERRIDE" that is analogous to LIBTOOL_OVERRIDE and should
> be set in the package Makefile.
> 
> Patches will be forthcoming.  Watch this space.

Here is the promised patch relative to /usr/pkgsrc.  I've tested converting
x11/gtk-engines without any problem.  Any comments?

	Cheers,

	-- Johnny Lam <jlam@netbsd.org>

--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="shlibtool.diff"

Index: devel/libtool/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool/Makefile.common,v
retrieving revision 1.25
diff -u -r1.25 Makefile.common
--- devel/libtool/Makefile.common	2002/12/23 14:49:54	1.25
+++ devel/libtool/Makefile.common	2003/01/08 00:12:58
@@ -3,7 +3,7 @@
 
 DISTNAME=	libtool-ml-20010614
 PKGPFX=		${DISTNAME:C/ml-/1.4./}
-PKGREVISION=	10
+PKGREVISION=	11
 WRKSRC=		${WRKDIR}/libtool-ml
 CATEGORIES=	devel pkgtools
 MASTER_SITES=	${MASTER_SITE_LOCAL}
Index: devel/libtool-base/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool-base/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- devel/libtool-base/Makefile	2002/12/22 19:04:08	1.14
+++ devel/libtool-base/Makefile	2003/01/08 00:12:58
@@ -15,21 +15,47 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-.if ${MACHINE_PLATFORM:MNetBSD-1.4-sparc} != "" || \
-	${MACHINE_PLATFORM:MNetBSD-1.4.[12]-sparc} != ""
+.if !empty(MACHINE_PLATFORM:MNetBSD-1.4-sparc) || \
+    !empty(MACHINE_PLATFORM:MNetBSD-1.4.[12]-sparc)
 DEPENDS+=	c++rt0>=1.0:../../sysutils/c++rt0
 .endif
 
 .if ${OPSYS} == "NetBSD"
 .  if !exists(/usr/libexec/ld.so) && !exists(/usr/libexec/ld.elf_so)
-CONFIGURE_ARGS=	--disable-shared
+CONFIGURE_ARGS=		--disable-shared
+BUILD_SHLIBTOOL=	NO
 .  endif
 .else
-CONFIGURE_ARGS=	--enable-ltdl-install
+CONFIGURE_ARGS=		--enable-ltdl-install
 .endif
 
 .if !empty(MACHINE_PLATFORM:MDarwin-*-*)
 .  include "../../devel/dlcompat/buildlink2.mk"
+.endif
+
+BUILD_SHLIBTOOL?=	YES
+BUILDING_SHLIBTOOL?=	NO
+
+.if ${BUILDING_SHLIBTOOL} == "YES"
+CONFIGURE_ARGS+=	--disable-static
+.else
+SHLIBTOOL_WRKDIR=	${WRKDIR}/shlibtool
+SHLIBTOOL_WRKSRC=	${WRKSRC:S/${WRKDIR}/${SHLIBTOOL_WRKDIR}/}
+SHLIBTOOL_MAKEFLAGS=	BUILDING_SHLIBTOOL=YES
+SHLIBTOOL_MAKEFLAGS+=	WRKDIR=${SHLIBTOOL_WRKDIR}
+
+.  if ${BUILD_SHLIBTOOL} == "NO"
+PLIST_SUBST+=		SHLIBTOOL="@comment "
+.  else
+PLIST_SUBST+=		SHLIBTOOL=
+
+post-build:
+	cd ${.CURDIR} && ${MAKE} build ${SHLIBTOOL_MAKEFLAGS}
+
+post-install:
+	${INSTALL_SCRIPT} ${SHLIBTOOL_WRKSRC}/libtool			\
+		${PREFIX}/bin/shlibtool
+.  endif
 .endif
 
 .include "../../mk/bsd.pkg.mk"
Index: devel/libtool-base/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool-base/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- devel/libtool-base/PLIST	2002/12/09 16:01:19	1.3
+++ devel/libtool-base/PLIST	2003/01/08 00:12:58
@@ -1,6 +1,7 @@
 @comment $NetBSD: PLIST,v 1.3 2002/12/09 16:01:19 tron Exp $
 bin/libtool
 bin/libtoolize
+${SHLIBTOOL}bin/shlibtool
 include/ltdl.h
 lib/libltdl.a
 lib/libltdl.la
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1124
diff -u -r1.1124 bsd.pkg.mk
--- mk/bsd.pkg.mk	2003/01/05 00:40:46	1.1124
+++ mk/bsd.pkg.mk	2003/01/08 00:13:13
@@ -222,10 +222,12 @@
 CONFIGURE_ENV+=		CONFIG_SHELL=${CONFIG_SHELL}
 .endif
 
-LIBTOOL_REQD=		${_OPSYS_LIBTOOL_REQD}
+LIBTOOL_REQD=		1.4.20010614nb11
 LIBTOOL=		${LOCALBASE}/bin/libtool
+SHLIBTOOL=		${LOCALBASE}/bin/shlibtool
 .if defined(USE_LIBTOOL)
 PKGLIBTOOL=		${LIBTOOL}
+PKGSHLIBTOOL=		${SHLIBTOOL}
 BUILD_DEPENDS+=		libtool-base>=${LIBTOOL_REQD}:../../devel/libtool-base
 CONFIGURE_ENV+=		LIBTOOL="${PKGLIBTOOL} ${LIBTOOL_FLAGS}"
 MAKE_ENV+=		LIBTOOL="${PKGLIBTOOL} ${LIBTOOL_FLAGS}"
@@ -1912,14 +1914,25 @@
 
 _CONFIGURE_POSTREQ+=	do-libtool-override
 do-libtool-override:
-.if defined(USE_LIBTOOL) && defined(LIBTOOL_OVERRIDE)
-.  for libtool in ${LIBTOOL_OVERRIDE}
+.if defined(USE_LIBTOOL)
+.  if defined(LIBTOOL_OVERRIDE)
+.    for libtool in ${LIBTOOL_OVERRIDE}
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	if [ -f ${libtool} ]; then					\
 		${RM} -f ${libtool};					\
-		${LN} -sf ${PKGLIBTOOL} ${libtool};		\
+		${LN} -sf ${PKGLIBTOOL} ${libtool};			\
 	fi
-.  endfor
+.    endfor
+.  endif
+.  if defined(SHLIBTOOL_OVERRIDE)
+.    for libtool in ${SHLIBTOOL_OVERRIDE}
+	${_PKG_SILENT}${_PKG_DEBUG}					\
+	if [ -f ${libtool} ]; then					\
+		${RM} -f ${libtool};					\
+		${LN} -sf ${PKGSHLIBTOOL} ${libtool};			\
+	fi
+.    endfor
+.  endif
 .else
 	${_PKG_SILENT}${_PKG_DEBUG}${TRUE}
 .endif
Index: mk/defs.Darwin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.Darwin.mk,v
retrieving revision 1.41
diff -u -r1.41 defs.Darwin.mk
--- mk/defs.Darwin.mk	2002/12/18 06:18:14	1.41
+++ mk/defs.Darwin.mk	2003/01/08 00:13:18
@@ -93,7 +93,6 @@
 _OPSYS_HAS_JAVA=	yes	# Java is standard
 _OPSYS_HAS_MANZ=	yes	# MANZ controls gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	no	# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=	5.8.0	# base version of perl required
 _OPSYS_RPATH_NAME=		# no name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes	# native patch(1) can make backups
Index: mk/defs.FreeBSD.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.FreeBSD.mk,v
retrieving revision 1.13
diff -u -r1.13 defs.FreeBSD.mk
--- mk/defs.FreeBSD.mk	2002/12/18 06:18:14	1.13
+++ mk/defs.FreeBSD.mk	2003/01/08 00:13:18
@@ -105,7 +105,6 @@
 _OPSYS_HAS_JAVA=	no	# Java is not standard
 _OPSYS_HAS_MANZ=	yes	# MANZ controls gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	yes	# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb10 # base version of libtool required
 _OPSYS_PERL_REQD=		# no base version of perl required
 _OPSYS_RPATH_NAME=	-R	# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes	# native patch(1) can make backups
Index: mk/defs.IRIX.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.IRIX.mk,v
retrieving revision 1.15
diff -u -r1.15 defs.IRIX.mk
--- mk/defs.IRIX.mk	2002/12/23 23:03:23	1.15
+++ mk/defs.IRIX.mk	2003/01/08 00:13:18
@@ -100,7 +100,6 @@
 _OPSYS_HAS_JAVA=	no		# Java is not standard
 _OPSYS_HAS_MANZ=	no		# no MANZ for gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	no		# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=			# no base version of perl required
 _OPSYS_RPATH_NAME=	-rpath,		# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	no		# native patch(1) can make backups
Index: mk/defs.Linux.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.Linux.mk,v
retrieving revision 1.42
diff -u -r1.42 defs.Linux.mk
--- mk/defs.Linux.mk	2002/12/18 06:18:14	1.42
+++ mk/defs.Linux.mk	2003/01/08 00:13:18
@@ -95,7 +95,6 @@
 _OPSYS_HAS_JAVA=	no	# Java is not standard
 _OPSYS_HAS_MANZ=	no	# no MANZ for gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	no	# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=		# no base version of perl required
 _OPSYS_RPATH_NAME=	-R	# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes	# native patch(1) can make backups
Index: mk/defs.NetBSD.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.NetBSD.mk,v
retrieving revision 1.42
diff -u -r1.42 defs.NetBSD.mk
--- mk/defs.NetBSD.mk	2002/12/18 06:18:15	1.42
+++ mk/defs.NetBSD.mk	2003/01/08 00:13:18
@@ -105,7 +105,6 @@
 _OPSYS_HAS_JAVA=	no	# Java is not standard
 _OPSYS_HAS_MANZ=	yes	# MANZ controls gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	yes	# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=		# no base version of perl required
 _OPSYS_RPATH_NAME=	-R	# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes	# native patch(1) can make backups
Index: mk/defs.OpenBSD.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.OpenBSD.mk,v
retrieving revision 1.11
diff -u -r1.11 defs.OpenBSD.mk
--- mk/defs.OpenBSD.mk	2002/12/18 06:18:15	1.11
+++ mk/defs.OpenBSD.mk	2003/01/08 00:13:18
@@ -105,7 +105,6 @@
 _OPSYS_HAS_JAVA=	no	# Java is not standard
 _OPSYS_HAS_MANZ=	yes	# MANZ controls gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	yes	# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=		# no base version of perl required
 _OPSYS_RPATH_NAME=	-R	# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes	# native patch(1) can make backups
Index: mk/defs.SunOS.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.SunOS.mk,v
retrieving revision 1.50
diff -u -r1.50 defs.SunOS.mk
--- mk/defs.SunOS.mk	2003/01/06 22:29:23	1.50
+++ mk/defs.SunOS.mk	2003/01/08 00:13:20
@@ -111,7 +111,6 @@
 _OPSYS_HAS_JAVA=	no		# Java is not standard
 _OPSYS_HAS_MANZ=	no		# no MANZ for gzipping of man pages
 _OPSYS_HAS_OSSAUDIO=	no		# libossaudio is available
-_OPSYS_LIBTOOL_REQD=	1.4.20010614nb9 # base version of libtool required
 _OPSYS_PERL_REQD=		# no base version of perl required
 _OPSYS_RPATH_NAME=	-R		# name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=	yes		# native patch(1) can make backups
Index: mk/buildlink2/bsd.buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink2/bsd.buildlink2.mk,v
retrieving revision 1.71
diff -u -r1.71 bsd.buildlink2.mk
--- mk/buildlink2/bsd.buildlink2.mk	2003/01/07 21:56:10	1.71
+++ mk/buildlink2/bsd.buildlink2.mk	2003/01/08 00:13:23
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.71 2003/01/07 21:56:10 jlam Exp $
+# $NetBSD$
 #
 # An example package buildlink2.mk file:
 #
@@ -525,8 +525,9 @@
 .endif
 .if defined(USE_LIBTOOL)
 PKGLIBTOOL=		${BUILDLINK_LIBTOOL}
+PKGSHLIBTOOL=		${BUILDLINK_SHLIBTOOL}
 .endif
-_BLNK_WRAPPEES+=	LIBTOOL
+_BLNK_WRAPPEES+=	LIBTOOL SHLIBTOOL
 .if defined(USE_X11)
 IMAKE?=			${X11BASE}/bin/imake
 _BLNK_WRAPPEES+=	IMAKE
@@ -613,13 +614,18 @@
 #
 _BLNK_WRAP_SETENV.FC+=		F77="${BUILDLINK_FC:T}"
 
-# Don't override the default LIBTOOL setting in the environment, as
-# it already correctly points to ${PKGLIBTOOL}, and don't sanitize the PATH
-# because we want libtool to invoke the wrapper scripts, too.
+# Don't override the default LIBTOOL and SHLIBTOOL settings in the
+# environment, as they already correctly point to the correct values, and
+# don't sanitize the PATH because we want libtool to invoke the wrapper
+# scripts, too.
 #
 _BLNK_WRAP_SETENV.LIBTOOL=	# empty
 _BLNK_WRAPPER_SH.LIBTOOL=	${.CURDIR}/../../mk/buildlink2/libtool.sh
 _BLNK_WRAP_SANITIZE_PATH.LIBTOOL=	# empty
+#
+_BLNK_WRAP_SETENV.SHLIBTOOL=	# empty
+_BLNK_WRAPPER_SH.SHLIBTOOL=	${.CURDIR}/../../mk/buildlink2/libtool.sh
+_BLNK_WRAP_SANITIZE_PATH.SHLIBTOOL=	# empty
 
 # We need to "unbuildlinkify" any libtool archives.
 _BLNK_WRAP_LT_UNTRANSFORM_SED=		${_REPLACE_BUILDLINK_SED}
@@ -636,6 +642,13 @@
 _BLNK_WRAP_PRIVATE_POST_CACHE.LIBTOOL=	${BUILDLINK_DIR}/bin/.libtool-post-cache
 _BLNK_WRAP_POST_LOGIC.LIBTOOL=		${BUILDLINK_DIR}/bin/.libtool-logic
 
+# shlibtool shares cache information with libtool.
+_BLNK_WRAP_PRIVATE_PRE_CACHE.SHLIBTOOL=	${_BLNK_WRAP_PRIVATE_PRE_CACHE.LIBTOOL}
+_BLNK_WRAP_PRIVATE_CACHE_ADD.SHLIBTOOL=	${_BLNK_WRAP_PRIVATE_CACHE_ADD.LIBTOOL}
+_BLNK_WRAP_PRIVATE_CACHE.SHLIBTOOL=	${_BLNK_WRAP_PRIVATE_CACHE.LIBTOOL}
+_BLNK_WRAP_PRIVATE_POST_CACHE.SHLIBTOOL= ${_BLNK_WRAP_PRIVATE_POST_CACHE.LIBTOOL}
+_BLNK_WRAP_POST_LOGIC.SHLIBTOOL=	${_BLNK_WRAP_POST_LOGIC.LIBTOOL}
+
 # Allow BUILDLINK_SETENV.<wrappee> to override _BLNK_WRAP_SETENV.<wrappee>.
 .for _wrappee_ in ${_BLNK_WRAPPEES}
 .  if defined(BUILDLINK_SETENV.${_wrappee_})
@@ -665,7 +678,6 @@
 
 _BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}=				\
 	-e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g"			\
-	-e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g"		\
 	-e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g"			\
 	-e "s|@WRKDIR@|${WRKDIR}|g"					\
 	-e "s|@WRKSRC@|${WRKSRC}|g"					\
@@ -910,7 +922,6 @@
 	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
 	${_PKG_SILENT}${_PKG_DEBUG}${SED}				\
 		-e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g"		\
-		-e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g"	\
 		-e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g"		\
 		-e "s|@BASENAME@|${BASENAME:Q}|g"			\
 		-e "s|@CC@|${BUILDLINK_CC:Q}|g"				\

--RnlQjJ0d97Da+TV1--