* Alexandre Duret-Lutz wrote on Tue, Jun 06, 2006 at 09:41:55PM CEST: > >>> "RW" == Ralf Wildenhues <[EMAIL PROTECTED]> writes: > > RW> `diff /dev/null file' fails on Tru64, as noted in autoconf.texi. > RW> `aclocal --diff' invokes this. acloca18.test exposes this failure.
> RW> Before I venture into either one of those options, I'd appreciate a > RW> reality check that this isn't over-engineering, esp. since the user may > RW> override the diff command anyway. What do you think? (Since we don't > RW> show the file name in the output, we could easily use a more obscure or > RW> "unique" one, say, including `$$', if that is the only concern.) > > The empty file sounds simple enough. How about installing this > empty file during automake's "make install"? This way we don't > need to worry about naming and cleaning in aclocal. Like this? (A diff for `lib/empty-file' is not shown, because, well, it's an empty file. I first thought about substituting the file-to- compare-against from config.status/Makefile, but that causes ugly quotation issues again (don't want ${libdir} expanded at substitution time, and such), so the yes/no helper seemed easiest). Cheers, Ralf * configure.ac (am_cv_prog_diff_dev_null): New variable: whether `diff' works on `/dev/null'; substitute it. Test from Autotest. * Makefile.am (do_subst): Substitute it here as well. * aclocal.in (diff_dev_null): New global. (install_file): If `diff' loses, use `$libdir/empty-file' instead to compare against. For this, we need... (parse_arguments): New option `--libdir'. (usage): Document it. * doc/automake.texi (aclocal options): Likewise. * tests/aclocal.in: Point to build tree with `--libdir'. * lib/empty-file: New file, empty (as the name indicates :-). ? lib/empty-file Index: Makefile.am =================================================================== RCS file: /cvs/automake/automake/Makefile.am,v retrieving revision 1.243 diff -u -r1.243 Makefile.am --- Makefile.am 11 May 2006 17:33:31 -0000 1.243 +++ Makefile.am 7 Jun 2006 18:34:29 -0000 @@ -73,7 +73,8 @@ -e 's,[EMAIL PROTECTED]@],$(SHELL),g' \ -e 's,[EMAIL PROTECTED]@],$(VERSION),g' \ -e 's,[EMAIL PROTECTED]@],Generated from [EMAIL PROTECTED]; do not edit by hand.,g' \ - -e 's,[EMAIL PROTECTED]@],$(datadir),g' + -e 's,[EMAIL PROTECTED]@],$(datadir),g' \ + -e 's,[EMAIL PROTECTED]@],$(am_cv_prog_diff_dev_null),g' ## These files depend on Makefile so they are rebuilt if $(VERSION), ## $(datadir) or other do_subst'ituted variables change. Index: aclocal.in =================================================================== RCS file: /cvs/automake/automake/aclocal.in,v retrieving revision 1.138 diff -u -r1.138 aclocal.in --- aclocal.in 21 Apr 2006 19:02:29 -0000 1.138 +++ aclocal.in 7 Jun 2006 18:34:29 -0000 @@ -65,6 +65,9 @@ # --diff my @diff_command; +# whether diff works on /dev/null +my $diff_dev_null = ('@am_cv_prog_diff_dev_null@'); + # --dry-run my $dry_run = 0; @@ -193,7 +196,14 @@ else { msg 'note', "installing `$dest' from `$src'"; - $diff_dest = '/dev/null'; + if ($diff_dev_null eq 'yes') + { + $diff_dest = '/dev/null'; + } + else + { + $diff_dest = "$libdir/empty-file"; + } } if (@diff_command) @@ -819,6 +831,7 @@ --help print this help, then exit -I DIR add directory to search list for .m4 files --install copy third-party files to the first -I directory + --libdir directory storing library files --output=FILE put output in FILE (default aclocal.m4) --print-ac-dir print name of directory holding m4 files, then exit --verbose don't be silent @@ -872,6 +885,7 @@ 'force' => \$force_output, 'I=s' => [EMAIL PROTECTED], 'install' => \$install, + 'libdir=s' => \$libdir, 'output=s' => \$output_file, 'print-ac-dir' => \$print_and_exit, 'verbose' => sub { setup_channel 'verb', silent => 0; }, Index: configure.ac =================================================================== RCS file: /cvs/automake/automake/configure.ac,v retrieving revision 1.28 diff -u -r1.28 configure.ac --- configure.ac 6 Jun 2006 20:54:18 -0000 1.28 +++ configure.ac 7 Jun 2006 18:34:29 -0000 @@ -130,6 +130,16 @@ test "x$am_cv_prog_ln" = xln && result=yes AC_MSG_RESULT([$result]) +AC_MSG_CHECKING([whether diff likes /dev/null]) +AC_CACHE_VAL([am_cv_prog_diff_dev_null], +[if diff /dev/null /dev/null >/dev/null 2>&1; then + am_cv_prog_diff_dev_null=yes +else + am_cv_prog_diff_dev_null=no +fi]) +AC_SUBST([am_cv_prog_diff_dev_null]) +AC_MSG_RESULT([$am_cv_prog_diff_dev_null]) + # The amount we should wait after modifying files depends on the platform. # On Windows '95, '98 and ME, files modifications have 2-seconds # granularity and can be up to 3 seconds in the future w.r.t. the --- doc/automake.texi 2006-06-07 19:49:54.000000000 +0200 +++ doc/automake.texi 2006-06-07 18:39:55.000000000 +0200 @@ -1747,6 +1747,11 @@ absolutely no influence on files that may need to be installed by @option{--install}. [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] --libdir +Look for Automake data files in directory @var{dir} instead of in the +installation directory. This is typically used for debugging. + @item [EMAIL PROTECTED] @opindex --output Cause the output to be put into @var{file} instead of @file{aclocal.m4}. Index: lib/Makefile.am =================================================================== RCS file: /cvs/automake/automake/lib/Makefile.am,v retrieving revision 1.9 diff -u -r1.9 Makefile.am --- lib/Makefile.am 14 May 2005 20:28:50 -0000 1.9 +++ lib/Makefile.am 7 Jun 2006 18:34:30 -0000 @@ -22,7 +22,7 @@ SUBDIRS = Automake am dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ - config-ml.in + config-ml.in empty-file ## These must all be executable when installed. However, if we use ## _SCRIPTS, then the program transform will be applied, which is not Index: tests/aclocal.in =================================================================== RCS file: /cvs/automake/automake/tests/aclocal.in,v retrieving revision 1.4 diff -u -r1.4 aclocal.in --- tests/aclocal.in 30 Jan 2005 17:47:39 -0000 1.4 +++ tests/aclocal.in 7 Jun 2006 18:34:30 -0000 @@ -15,4 +15,5 @@ # Most of the files are in $srcdir/../m4. However amversion.m4 is # generated in ../m4, so we include that directory in the search path too. exec @abs_top_builddir@/aclocal $ACLOCAL_TESTSUITE_FLAGS \ - -I @abs_top_builddir@/m4 [EMAIL PROTECTED]@/m4 ${1+"$@"} + -I @abs_top_builddir@/m4 [EMAIL PROTECTED]@/m4 \ + [EMAIL PROTECTED]@/lib ${1+"$@"}