Subject: makeinfo in VPATH builds fails

From: Sebastian Freundt <[email-masked]>
Date: Wed, 14 Sep 2011 14:58:28 +0000

Package: automake
Version: 1.11a

VPATH build of a project using makeinfo fails if $(srcdir) isn't writable.

freundt@plutos:~/devel_freundt/datetools/=build> make
/home/freundt/devel/datetools/git-version-gen .version >/dev/null
make  all-recursive
make[1]: Entering directory `/home/guest/devel_freundt/datetools/=build'
Making all in info
make[2]: Entering directory `/home/guest/devel_freundt/datetools/=build/info'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd /home/freundt/devel/datetools/info && \
rm -rf $backupdir && mkdir $backupdir && \
if (/bin/sh /home/freundt/devel/datetools/missing --run makeinfo --version) >/dev/null 2>&1; then \
  for f in /home/freundt/devel/datetools/info/datetools.info /home/freundt/devel/datetools/info/datetools.info-[0-9] /home/freundt/devel/datetools/info/datetools.info-[0-9][0-9] /home/freundt/devel/datetools/info/datetools.i[0-9] /home/freundt/devel/datetools/info/datetools.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if /bin/sh /home/freundt/devel/datetools/missing --run makeinfo   -I /home/freundt/devel/datetools/info \
 -o /home/freundt/devel/datetools/info/datetools.info /home/freundt/devel/datetools/info/datetools.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd /home/freundt/devel/datetools/info; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd /home/freundt/devel/datetools/info && \
  $restore $backupdir/* `echo ".//home/freundt/devel/datetools/info/datetools.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
mkdir: cannot create directory `.am20510': Permission denied
/home/freundt/devel/datetools/info/datetools.info: Permission denied
make[2]: *** [/home/freundt/devel/datetools/info/datetools.info] Error 1
make[2]: Leaving directory `/home/guest/devel_freundt/datetools/=build/info'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/guest/devel_freundt/datetools/=build'
make: *** [all] Error 2

Expected behaviour:
freundt@plutos:~/devel_freundt/datetools/=build> cd info
freundt@plutos:~/devel_freundt/datetools/=build/info> makeinfo /home/freundt/devel/datetools/info/datetools.texi
freundt@plutos:~/devel_freundt/datetools/=build/info> ls
datetools.info  Makefile

Cheers
Sebastian