configure breaks if PATCH_WRKSRC != WRKSRC (culprit: AUTOTOOLS)

Fernan Aguero fernan at iib.unsam.edu.ar
Wed Feb 7 19:31:52 UTC 2007


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 at 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


More information about the freebsd-ports mailing list