Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 1999 12:59:55 +0200
From:      Jeremy Lea <reg@shale.csir.co.za>
To:        Kris Kennaway <kkennawa@physics.adelaide.edu.au>, freebsd-ports@freebsd.org
Subject:   Patch for USE_LIBTOOL
Message-ID:  <19990408125954.O1798@shale.csir.co.za>

next in thread | raw e-mail | index | archive | help
Hi Kris, all,

Attached is a patch to bsd.port.mk to implement the automatic use of a
system libtool rather than a ports own version.  This working for all
the GNOME ports.

Instructions:
Replace GNU_CONFIGURE=yes with USE_LIBTOOL=yes in the port's Makefile. 
Remove libtool patching...

LIBTOOLFILES controls which files to patch.  If you have more than one
configure script you need to add something like this (for ORBit):
LIBTOOLFILES=	configure popt/configure libIDL/configure

Don't worry about the setting of LIBTOOL for the moment.  It's just
there for flexibility.

Ports which don't work for this should not be affected.  They can still
use their own copy of libtool, but it will have to be patched.  I have
not started on fixing libtool yet, but I would like to make it not
install the .la files and also fix up some library naming to help ports.

Regards,
 -Jeremy

-- 
  |   "Come home my prodigal son, come home and lets be one,
--+--  don't want to see you cry, don't make me tell you why,
  |    you've lived in a house with me, my blood has set you free,
  |    in the world you'll surely die, nothing else will satisfy." -MIC

Index: bsd.port.mk
===================================================================
RCS file: /usr/home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.309
diff -u -r1.309 bsd.port.mk
--- bsd.port.mk	1999/04/08 07:13:38	1.309
+++ bsd.port.mk	1999/04/08 10:46:58
@@ -119,6 +119,10 @@
 # USE_AUTOCONF	- Says that the port uses autoconf.  Implies GNU_CONFIGURE.
 # AUTOCONF		- Set to path of GNU autoconf if not in $PATH (default:
 #				  autoconf).
+# USE_LIBTOOL	- Says that the port uses Libtool.  Implies GNU_CONFIGURE.
+# LIBTOOL		- Set to path of sytem libtool.
+# LIBTOOLFILES	- Files to patch for libtool.  Defaults to configure or 
+#				  aclocal.m4 depending on USE_AUTOCONF.
 # USE_PERL5		- Says that the port uses perl5 for building and running.
 # PERL5			- Set to full path of perl5, either in the system or
 #				  installed from a port.
@@ -573,6 +577,15 @@
 GNU_CONFIGURE=	yes
 BUILD_DEPENDS+=		autoconf:${PORTSDIR}/devel/autoconf
 .endif
+.if defined(USE_LIBTOOL)
+GNU_CONFIGURE=	yes
+BUILD_DEPENDS+=		libtool:${PORTSDIR}/devel/libtool
+.if defined(USE_AUTOCONF)
+LIBTOOLFILES?=		aclocal.m4
+.else
+LIBTOOLFILES?=		configure
+.endif
+.endif
 
 .if defined(REQUIRES_MOTIF)
 LIB_DEPENDS+=		Xpm.4:${PORTSDIR}/graphics/xpm
@@ -638,6 +651,7 @@
 # Miscellaneous overridable commands:
 GMAKE?=			gmake
 AUTOCONF?=		autoconf
+LIBTOOL?=		${LOCALBASE}/bin/libtool
 XMKMF?=			xmkmf -a
 .if exists(/sbin/md5)
 MD5?=			/sbin/md5
@@ -1667,6 +1684,9 @@
 		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
 			${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
 	fi
+.if make(real-patch) && defined(USE_LIBTOOL)
+	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} patch-libtool
+.endif
 .if make(real-install) && (defined(_MANPAGES) || defined(_MLINKS))
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} compress-man
 .endif
@@ -1768,6 +1791,22 @@
 
 .endfor
 
+# Patch-Libtool
+#
+# Special target to automagically make libtool using ports use the
+# system libtool.  We patch both configure and aclocal.m4 so that ports
+# which USE_AUTOCONF will also work.
+
+.if !target(patch-libtool)
+patch-libtool:
+	@(cd ${WRKSRC}; \
+	 for file in ${LIBTOOLFILES}; do \
+		${CP} $$file $$file.tmp; \
+		${SED} -e s^\$$\(top_builddir\)/libtool^${LIBTOOL}^g \
+			$$file.tmp > $$file; \
+	 done);
+.endif
+
 # Checkpatch
 #
 # Special target to verify patches


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990408125954.O1798>