spy.test and HP-UX/Tru64 make

2006-05-08 Thread Ralf Wildenhues
spy.test fails for me on a hppa2.0w-hp-hpux11.11 and on the testdrive
alphaev68-dec-osf5.1b (both with native make).  I believe both failures
not to be related to double-colon rules.

The failure on HP-UX can be treated with some $sleep before another
touch, the Tru64 failure (over that seemingly broken NFS) by updating
an empty file with echo instead of with touch.

OK to apply?  Do you think these issues need more thorough investigation
instead?

Cheers,
Ralf

* tests/spy.test: Add some $sleep.
Update empty file with `echo' instead of `touch'.

Index: tests/spy.test
===
RCS file: /cvs/automake/automake/tests/spy.test,v
retrieving revision 1.4
diff -u -r1.4 spy.test
--- tests/spy.test  14 May 2005 20:28:56 -  1.4
+++ tests/spy.test  8 May 2006 19:10:19 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -91,8 +91,9 @@
 touch b
 $MAKE
 test "`cat a`" = rule1
+$sleep
 : > a
 $sleep
-touch c
+echo > c
 $MAKE
 test "`cat a`" = rule2




missing*.test failures on Tru64; 'required=' lines

2006-05-08 Thread Ralf Wildenhues
On the testdrive alphaev68-dec-osf5.1b, missing{,2,4}.test were failing
(with native make).  Again, this was fixable by adding some $sleep.
But also it uncovered a buglet in the missing.test: 
  required=GNUmake

was set only after `./defs' was sourced.  I don't know for sure why
missing.test and missing2.test should need GNU make -- but I haven't
encountered any make implementations that genuinely fail those tests,
so I assume they don't.

OK to apply the following patch to add the sleep, remove the
requirements, and make sure such misordering won't happen again?
(The maintainer-check part isn't portable sed, but that isn't necessary
AFAICS.)

FWIW, I did not encounter this on a different Tru64 host.

Cheers,
Ralf

* tests/missing.test, tests/missing2.test, tests/missing4.test:
Add some $sleep, for Tru64 make on NFS.
* tests/missing.test, tests/missing2.test: Do not require
GNUmake.
* Makefile.am (maintainer-check): Make sure `required=' does not
follow `. ./defs' in the tests.

Index: Makefile.am
===
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.242
diff -u -r1.242 Makefile.am
--- Makefile.am 12 Jan 2006 20:11:48 -  1.242
+++ Makefile.am 8 May 2006 17:31:19 -
@@ -225,6 +225,13 @@
  echo 'Do not run "perl" in the above tests.  Use "$$PERL" instead.' 
1>&2; \
  exit 1; \
fi
+## Setting `required' after sourcing `./defs' is a bug.
+   @for file in $(srcdir)/tests/*.test; do \
+ if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; 
then \
+   echo 'Do not set "required" after sourcing "defs" in '"$$file: 
$$out" 1>&2; \
+   exit 1; \
+ fi; \
+   done
 ## Overriding a Makefile macro on the command line is not portable when
 ## recursive targets are used.  Better use an envvar.  SHELL is an exception,
 ## POSIX says it can't come from the environment.
Index: tests/missing.test
===
RCS file: /cvs/automake/automake/tests/missing.test,v
retrieving revision 1.3
diff -u -r1.3 missing.test
--- tests/missing.test  14 May 2005 20:28:55 -  1.3
+++ tests/missing.test  8 May 2006 17:34:25 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -22,7 +22,6 @@
 
 . ./defs || exit 1
 
-required=GNUmake
 set -e
 
 cat >>configure.in <<'EOF'
@@ -46,6 +45,7 @@
 $sleep
 # Hopefully the install version of Autoconf cannot compete with this one...
 echo 'AC_PREREQ()' >> aclocal.m4
+$sleep
 $MAKE distdir
 
 # Run again, but without missing, to ensure that timestamps were updated.
Index: tests/missing2.test
===
RCS file: /cvs/automake/automake/tests/missing2.test,v
retrieving revision 1.3
diff -u -r1.3 missing2.test
--- tests/missing2.test 14 May 2005 20:28:55 -  1.3
+++ tests/missing2.test 8 May 2006 17:31:20 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -22,7 +22,6 @@
 
 . ./defs || exit 1
 
-required=GNUmake
 set -e
 
 cat >>configure.in <<'EOF'
@@ -48,6 +47,7 @@
 $sleep
 # Hopefully the install version of Autoconf cannot compete with this one...
 echo 'AC_PREREQ()' > v.m4
+$sleep
 $MAKE distdir
 
 # Run again, but without missing, to ensure that timestamps were updated.
Index: tests/missing4.test
===
RCS file: /cvs/automake/automake/tests/missing4.test,v
retrieving revision 1.1
diff -u -r1.1 missing4.test
--- tests/missing4.test 21 Apr 2006 19:02:29 -  1.1
+++ tests/missing4.test 8 May 2006 17:31:20 -
@@ -39,6 +39,7 @@
 cmp aclocal.m4 aclocal.tmp && exit 1
 
 mv aclocal.tmp aclocal.m4
+$sleep
 
 $MAKE 2>stderr
 cat stderr




distdir.test failures: VPATH and subdirs

2006-05-08 Thread Ralf Wildenhues
On all HP-UX and Tru64 boxen I have access to, distdir.test fails like
this:

$ make dist # in VPATH build, which is part of the distcheck stage
| No suffix list.
| Make: Don't know how to make ./joe.  Stop.

Removing the leading `./' from
  EXTRA_DIST = ./joe [...]

fixes that on these hosts, so IMHO that should be considered necessary
for portable Makefiles.

The only remaining problem child I know about is Solaris 2.6 `make',
which has more problems with VPATH for files in subdirs:

(distdir.test)
| make  check-local
| test -f ../foo/bar
| test -f ../woo/doo
| test -f ../joe
| test -f ../dada
| make: Fatal error: Don't know how to make target `foo/bar'
| Current working directory
| /tmp/build-sparc-sun-solaris2.6/tests/testSubDir/distdir-1.0/_build
| *** Error code 1
| make: Fatal error: Command failed for target `distcheck'
| FAIL: ../../automake-1.9a/tests/distdir.test

(similar failure in extra6.test)
| + mkdir foo2
| + mkdir foo2/bar2
| + touch foo2/bar2/baz2
| + mkdir baz2
| + touch baz2/foo2
| + make check
| make: Fatal error: Don't know how to make target `foo/bar'
| FAIL: ../../automake-1.9a/tests/extra6.test

(and pr9.test)
|   && make  distcleancheck
| checking for a BSD-compatible install... ../support/install-sh -c
| checking whether build environment is sane... yes
| checking for gawk... no
| checking for mawk... no
| checking for nawk... nawk
| checking whether make sets $(MAKE)... yes
| configure: creating ./config.status
| config.status: creating Makefile
| make: Fatal error: Don't know how to make target `support/install-sh'
| Current working directory 
/tmp/build-sparc-sun-solaris2.6/tests/testSubDir/pr9-0/_build
| *** Error code 1
| make: Fatal error: Command failed for target `distcheck'
| + exit 1
| FAIL: ../../automake-1.9a/tests/pr9.test

(and subpkg3.test)
| Making uninstall in subpkg
| make: Fatal error: Don't know how to make target `subpkg/foobar'
| Current working directory 
/tmp/build-sparc-sun-solaris2.6/tests/testSubDir/subpkg3-1.0/_build
| *** Error code 1
| make: Fatal error: Command failed for target `distcheck'
| FAIL: ../../automake-1.9a/tests/subpkg3.test


Luckily all of these are fixed in Solaris >=2.7.  Yay!

So I'm bound to think we should ignore Solaris 2.6 issues here -- after
all, GNU make compiles and runs fine on this system -- and just go with
the patch below to fix the remaining failures.

Do you think it's ok to require that `./file' should not be used?
Should it be documented in automake.texi?  Alternatively, should
EXTRA_DIST be rewritten by Automake to kill leading "./"?

Cheers,
Ralf

* tests/distdir.test: Do not use leading `./' in EXTRA_DIST for
files in the source tree.  Fixes failures with HP-UX and Tru64
make.

Index: tests/distdir.test
===
RCS file: /cvs/automake/automake/tests/distdir.test,v
retrieving revision 1.9
diff -u -r1.9 distdir.test
--- tests/distdir.test  5 Jan 2006 23:32:35 -   1.9
+++ tests/distdir.test  8 May 2006 20:08:34 -
@@ -19,7 +19,9 @@
 # Boston, MA 02110-1301, USA.
 
 # Test to make sure subdirs in EXTRA_DIST work.  Also tests to make
-# sure "./" is ignored and *srcdir properly handled.
+# sure *srcdir is properly handled.  Note that using `./', as in
+#   EXTRA_DIST = ./joe
+# does not work portably: it fails with HP-UX and Tru64 make.
 
 . ./defs || exit 1
 
@@ -28,7 +30,7 @@
 echo AC_OUTPUT >>configure.in
 
 cat > Makefile.am << 'END'
-EXTRA_DIST = foo/bar ./joe $(top_srcdir)/woo/doo $(srcdir)/dada
+EXTRA_DIST = foo/bar joe $(top_srcdir)/woo/doo $(srcdir)/dada
 check-local:
test -f $(srcdir)/foo/bar
test -f $(srcdir)/woo/doo




Re: fix mkinst3.test

2006-05-08 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Wed, Apr 26, 2006 at 06:51:27PM CEST:
> OK to apply?  The build path contained the string `build-power',
> and thus the test failed spuriously.  I figured fiddling with
> " $* " and *\ -p\ * was ugly as well (and error-prone if you
> allow spaces in directory names!), so I chose to rather do it
> The Right Way[tm].

There's an even worse glitch in mkinst3 (but luckily only in that test).
If PATH contains '.' before the directory where the real mkdir is, this
test loops forever (we can reasonably assume that `pwd`/bin is not in
the PATH).  Updated patch to fix both issues below.

OK?

Cheers,
Ralf

* tests/mkinst3.test: Fix `mkdir' wrapper to not be confused
if ``pwd`' contains the string `-p'.  Create the wrapper in a
subdirectory so that `.' in $PATH does not lead to an endless
loop.

Index: tests/mkinst3.test
===
RCS file: /cvs/automake/automake/tests/mkinst3.test,v
retrieving revision 1.1
diff -u -r1.1 mkinst3.test
--- tests/mkinst3.test  29 Jun 2005 21:08:19 -  1.1
+++ tests/mkinst3.test  9 May 2006 06:26:49 -
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -39,20 +39,24 @@
 
 # Trick mkinstalldirs into thinking mkdir does not support -p.
 
-cat >mkdir <<'EOF'
+mkdir bin
+cat >bin/mkdir <<'EOF'
 #!/bin/sh
-case "$*" in
-  *-p*) exit 1;;
-esac
+for arg
+do
+  case $arg in
+  -p) exit 1;;
+  esac
+done
 PATH=$AM_PATH
 export PATH
 exec mkdir "$@"
 EOF
 
-chmod +x mkdir
+chmod +x bin/mkdir
 AM_PATH=$PATH
 export AM_PATH
-PATH=`pwd`:$PATH
+PATH=`pwd`/bin:$PATH
 export PATH
 
 # Test mkinstalldirs without mkdir -p.