From: Mark Wooding Date: Fri, 10 Mar 2006 00:33:30 +0000 (+0000) Subject: mdw-setup: Fix for constructing Makefile.am from m4 source. X-Git-Tag: 1.3.0~1 X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/commitdiff_plain/3dc9c14b343e27b17e149dd6c474d613c337bbd9?hp=3d69a2786bcc132232304d1d220735f086abfc53 mdw-setup: Fix for constructing Makefile.am from m4 source. Change into the containing directory before running m4. The Makefile machinery may want to use some other files lying around to do its thing, and it makes life easier if it doesn't have to do stupid games with relative-to-the-project-root file names. --- diff --git a/mdw-setup b/mdw-setup index d18a49a..276b6da 100755 --- a/mdw-setup +++ b/mdw-setup @@ -44,9 +44,10 @@ done if [ "$configure" ]; then grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize find . -name Makefile.m4 -print | while read m4; do - am=$(echo $m4 | sed 's:.m4:.am:') - m4 $m4 >$am.new - mv $am.new $am + dir=$(echo $m4 | sed 's:/[^/]*$::') + (cd $dir && + m4 Makefile.m4 >Makefile.am.new && + mv Makefile.am.new Makefile.am) done mkaclocal autoconf