From owner-freebsd-ports@FreeBSD.ORG Wed Feb 7 19:31:52 2007 Return-Path: X-Original-To: ports@FreeBSD.ORG Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 355E016A401; Wed, 7 Feb 2007 19:31:52 +0000 (UTC) (envelope-from fernan@iib.unsam.edu.ar) Received: from omega.iib.unsam.edu.ar (omega.iib.unsam.edu.ar [170.210.49.14]) by mx1.freebsd.org (Postfix) with ESMTP id CA20613C461; Wed, 7 Feb 2007 19:31:49 +0000 (UTC) (envelope-from fernan@iib.unsam.edu.ar) Received: from gama.iib.unsam.edu.ar (gama.iib.unsam.edu.ar [192.168.10.72]) by omega.iib.unsam.edu.ar (8.13.6/8.13.6) with ESMTP id l17HrGtE006894; Wed, 7 Feb 2007 14:53:16 -0300 (ART) (envelope-from fernan@iib.unsam.edu.ar) Received: (from fernan@localhost) by gama.iib.unsam.edu.ar (8.13.8/8.13.8/Submit) id l17HsJV9047807; Wed, 7 Feb 2007 14:54:19 -0300 (ART) (envelope-from fernan@iib.unsam.edu.ar) X-Authentication-Warning: gama.iib.unsam.edu.ar: fernan set sender to fernan@iib.unsam.edu.ar using -f Date: Wed, 7 Feb 2007 14:54:19 -0300 From: Fernan Aguero To: FreeBSD Ports Message-ID: <20070207175419.GA59592@iib.unsam.edu.ar> Mail-Followup-To: FreeBSD Ports , ade@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Cc: ade@FreeBSD.ORG Subject: configure breaks if PATCH_WRKSRC != WRKSRC (culprit: AUTOTOOLS) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 19:31:52 -0000 Hi, I'm working on an update to the biology/emboss port that I maintain, and I need to include an external patch. So I modified the port to fetch the patchfile and apply it. For this I had to set PATCH_WRKSRC. This works fine, but now the configure target breaks. I isolated the problem to a single line: the one that defines PATCH_WRKSRC. --- Makefile.orig Wed Feb 7 14:00:36 2007 +++ Makefile Wed Feb 7 14:00:50 2007 @@ -16,6 +16,8 @@ DISTFILES= ${PORTNAME:U}-${PORTVERSION}${EXTRACT_SUFX} DIST_SUBDIR= ${PORTNAME} +PATCH_WRKSRC= ${WRKDIR} + MAINTAINER= fernan@iib.unsam.edu.ar COMMENT= A collection of open source tools for genetic sequence analysis This single change makes the configure fail: ===> Configuring for emboss-3.0.0 cp: configure: No such file or directory *** Error code 1 Stop in /freebsd/ports/biology/emboss. *** Error code 1 However this only happens in conjunction with: USE_AUTOTOOLS= libtool:15 which is set in the emboss port Makefile. If I comment out this line, everything runs smoothly again. Now, reading bsd.autotools.mk, it's clear that autotools is indeed doing something under PATCH_WRKSRC, but it assumes (wrongly?) that PATCH_WRKSRC == WRKSRC # patch-autotools # # Special target to automatically make libtool using ports use the # libtool port. See above for default values of LIBTOOLFILES. .if !target(patch-autotools) patch-autotools:: . if defined(AUTOTOOL_libtool) @(cd ${PATCH_WRKSRC}; \ for file in ${LIBTOOLFILES}; do \ ${CP} $$file $$file.tmp; \ ${SED} -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${LTMAIN}^g" \ -e '/^LIBTOOL=/s^\$$(top_builddir)/libtool^${LIBTOOL}^g' \ $$file.tmp > $$file; \ ${RM} $$file.tmp; \ done); . else @${DO_NADA} . endif .endif The following patch fixes my port (but I haven't checked if it breaks the rest of the ports tree!): --- bsd.autotools.mk.orig Wed Feb 7 14:39:01 2007 +++ bsd.autotools.mk Wed Feb 7 14:39:11 2007 @@ -311,7 +311,7 @@ .if !target(patch-autotools) patch-autotools:: . if defined(AUTOTOOL_libtool) - @(cd ${PATCH_WRKSRC}; \ + @(cd ${WRKSRC}; \ for file in ${LIBTOOLFILES}; do \ ${CP} $$file $$file.tmp; \ ${SED} -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${LTMAIN}^g" \ Is this a bug in autotools? Perhaps there is a reason for using PATCH_WRKSRC and not WRKSRC here ... Cheers, Fernan