Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 14:54:19 -0300
From:      Fernan Aguero <fernan@iib.unsam.edu.ar>
To:        FreeBSD Ports <ports@FreeBSD.ORG>
Cc:        ade@FreeBSD.ORG
Subject:   configure breaks if PATCH_WRKSRC != WRKSRC (culprit: AUTOTOOLS)
Message-ID:  <20070207175419.GA59592@iib.unsam.edu.ar>

next in thread | raw e-mail | index | archive | help
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



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