bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generated configure script doesn't work when "diff" isn't available


From: Ralf Wildenhues
Subject: Re: generated configure script doesn't work when "diff" isn't available
Date: Fri, 14 Mar 2008 00:30:51 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

Hello Vincent,

* Vincent Lefevre wrote on Sun, Mar 09, 2008 at 03:28:22AM CET:
> 
> The generated configure script doesn't work on platforms where the
> "diff" utility isn't available, such as Nokia's N810 Internet tablet
> (with Maemo/OS2008, using BusyBox v1.6.1).
> 
> In fact, there are two problems:
> 
> 1. The first test that uses diff fails with an obscure error message.
> In my case, in "checking for grep that handles long lines and -e",
> I got an error saying that a working grep could not be found. So,
> I first thought the problem came from grep, until I remembered that
> "diff" wasn't available.

The error message is difficult to understand because the command line is
something like
  diff ... >/dev/null 2>&1

which means the "command not found" error will be hidden by most (but
not all) shells.

I wondered why we redirect stderr in the diff invocations of
AC_CACHE_SAVE and _AC_FEATURE_CHECK_LENGTH.  For the cache instance, I
could not find a good reason except that we do not test whether
$cache_file exists beforehand, for the line length test I think we try
to avoid errors from length-limited native diff implementations.

> 2. The failure itself.
> 
> Even though the GNU standards require "diff" to be present, fixing
> the problem would be useful in practice, and the fix is easy: use
> "cmp" instead of "diff" ("cmp" is available on the N810). I don't
> know about the other platforms. So, I'd say that one of the two
> commands should be tested, and if it doesn't work, test the other
> one. If both fail, then output an error message.

diff helps to avoid some spurious differences due to line endings
(that's at least what the manual says), and at one point AC_PROG_SED
was specifically changed from using cmp to diff.  Relevant ChangeLog
entries:

    (AC_PROG_SED): Use diff, not sed; otherwise "make check" fails because
    it forbids cmp (I guess because cmp treats files as binary on DOS-like
    systems).

    * lib/autoconf/general.m4 (AC_CACHE_SAVE): Don't use cmp.
    Fixes the `AC_ARG_VAR' test failures.
    * lib/autoconf/status.m4 (_AC_OUTPUT_FILES): Don't use cmp.
    * lib/freeze.mk (check-forbidden-patterns): New.
    * lib/autoconf/Makefile.am, lib/autotest/Makefile.am
    * lib/m4sugar/Makefile.am (check-local): Use it to catch `cmp'.
    * doc/autoconf.texi (Limitations of Usual Tools): HP-UX' cmp and
    /dev/null.
    Reported months ago by H. Merijn Brand.

I'm not quite sure how to proceed from here.  Testing presence of all
tools listed in the GNU Coding Standards is certainly not efficient.
OTOH if certain tools are not present on important porting targets,
then maybe the GCS needs further discussion on.

Cheers, and thanks for the report,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]