From owner-freebsd-ports Tue Apr 27 8:20: 6 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 51B7515107 for ; Tue, 27 Apr 1999 08:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA14166; Tue, 27 Apr 1999 08:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by hub.freebsd.org (Postfix) with ESMTP id 19CA814EE3 for ; Tue, 27 Apr 1999 08:18:04 -0700 (PDT) (envelope-from reg@shale.csir.co.za) Received: (from reg@localhost) by shale.csir.co.za (8.9.3/8.9.3) id RAA01449; Tue, 27 Apr 1999 17:18:01 +0200 (SAT) (envelope-from reg) Message-Id: <199904271518.RAA01449@shale.csir.co.za> Date: Tue, 27 Apr 1999 17:18:01 +0200 (SAT) From: reg@shale.csir.co.za Reply-To: reg@shale.csir.co.za To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/11353: Feature additions to bsd.port.mk. Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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