[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: configure scripts rely on "diff"; could use "cmp" instead if availab
Re: configure scripts rely on "diff"; could use "cmp" instead if available
Tue, 24 May 2011 19:41:06 -0700
On Tue, May 24, 2011 at 12:43:58PM -0600, Eric Blake wrote:
> On 05/24/2011 11:41 AM, Josh Triplett wrote:
> > In trying to bootstrap a minimal environment, I ended up trying to run a
> > configure script using just busybox (specifically, Debian's
> > busybox-static). This almost worked, except that the configure script
> > used diff several times. configure just uses diff for its exit code, to
> > check for identical files. The version of busybox-static in Debian
> > doesn't provide diff, but does provide cmp.
> That's in conflict with the current GNU Coding Standards, which states
> that a program can blindly assume the existence of diff on $PATH.
> Either we need to tighten GCS to forbid unqualified use of diff, or
> improve the busybox setup to start providing diff as expected by GCS, or
I would propose both: busybox can support diff if compiled for it, but
at the same time I'd like to support systems without a diff program, as
long as they have *something* to compare two files.
On a related note, I just checked the configure script for GNU diffutils
3.0, and it depends on having a working diff program. :)
> > Rather than unconditionally using diff, please consider detecting and
> > using an appropriate $ac_files_identical program; either diff or cmp
> > would work. For that matter, such detection would also provide a good
> > opportunity to check for a working diff -q or cmp -s, which run faster
> > since they can stop at the first difference and don't have to generate
> > output.
> > Does this seem like a reasonable addition to autoconf? (If it falls
> > under "OK, if someone provides a patch", I can do so.)
> Certainly okay if someone provides a patch. It's not my highest
> priority, but I like the idea if it improves portability of a configure
Does it seem reasonable to modify existing macros that use diff to
depend on a check for an appropriate program?
- Josh Triplett