Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 1999 17:18:01 +0200 (SAT)
From:      reg@shale.csir.co.za
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/11353: Feature additions to bsd.port.mk.
Message-ID:  <199904271518.RAA01449@shale.csir.co.za>

next in thread | raw e-mail | index | archive | help

>Number:         11353
>Category:       ports
>Synopsis:       Feature additions to bsd.port.mk.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 27 08:20:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Lea
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Arb's Inc.
>Environment:

	FreeBSD Ports collection.

>Description:

	The following patch adds three features to bsd.port.mk:

	1.  Support for using a system copy of libtool.  This does not
	affect ports which use libtool, but don't set USE_LIBTOOL.
	Thanks to those who commented.

	2.  Adds automated support for the handling of ${PREFIX}/info/dir,
	which is broken in a lot of ports.

	3.  Adds CXXFLAGS to CONFIGURE_ENV, since many configure scripts
	require this.

>How-To-Repeat:

	

>Fix:
	
	
Index: bsd.port.mk
===================================================================
RCS file: /usr/home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.310
diff -u -r1.310 bsd.port.mk
--- bsd.port.mk	1999/04/23 02:20:45	1.310
+++ bsd.port.mk	1999/04/27 00:15:40
@@ -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,9 @@
 # Miscellaneous overridable commands:
 GMAKE?=			gmake
 AUTOCONF?=		autoconf
+.if !defined(LIBTOOL)
+LIBTOOL!=		which libtool || echo ${LOCALBASE}/bin/libtool
+.endif
 XMKMF?=			xmkmf -a
 .if exists(/sbin/md5)
 MD5?=			/sbin/md5
@@ -1501,7 +1517,7 @@
 	fi
 .if defined(HAS_CONFIGURE)
 	@(cd ${WRKSRC} && CC="${CC}" CXX="${CXX}" \
-	    CFLAGS="${CFLAGS}" \
+	    CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
 	    INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
 	    INSTALL_DATA="${INSTALL_DATA}" \
 	    INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
@@ -1651,6 +1667,9 @@
 		${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
 	fi
 .endif
+	@if [ -d ${PREFIX}/info -a ! -f ${PREFIX}/info/dir -a -f /usr/share/info/dir ]; then \
+	  ${SED} -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \
+	 fi
 .endif
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
 	@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
@@ -1667,6 +1686,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 +1790,22 @@
 
 .endfor
 
+# Patch-libtool
+#
+# Special target to automagically make libtool using ports use the
+# system libtool.  We normally patch configure or aclocal.m4 depending
+# on USE_AUTOCONF.
+
+.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
@@ -2291,7 +2329,10 @@
 	@${ECHO} '@cwd ${PREFIX}' >> ${TMPPLIST}
 .endif
 .endfor
-	@${SED} ${_sedsubplist} ${PLIST} >> ${TMPPLIST}
+	@${SED} ${_sedsubplist} ${PLIST} | \
+	 ${SED} -e "/\@exec install-info.*$$/h" \
+		-e "s^^\@exec [ -f %D/info/dir -o ! -f /usr/share/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir^g" \
+		-e "t fix" -e "b" -e ":fix" -e "G" >> ${TMPPLIST}
 .if !defined(NO_FILTER_SHLIBS)
 .if (${PORTOBJFORMAT} == "aout")
 	@${SED} -e 's,\(/lib.*\.so\.[0-9]*\)$$,\1.0,' ${TMPPLIST} > ${TMPPLIST}.tmp



>Release-Note:
>Audit-Trail:
>Unformatted:


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?199904271518.RAA01449>