configure scripts rely on "diff"; could use "cmp" instead if available

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

 



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.

This issue manifested as configure complaining that it could not find a
usable grep, due to the test for grep using diff.

As far as I can tell, configure scripts never actually need the output
of diff; they just need a program that can detect whether files differ
and provide an appropriate exit status for use in conditionals.

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.)

- Josh Triplett

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux