autoconf
[Top][All Lists]
Advanced

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

Re: configure scripts rely on "diff"; could use "cmp" instead if availab


From: Eric Blake
Subject: Re: configure scripts rely on "diff"; could use "cmp" instead if available
Date: Wed, 25 May 2011 07:57:49 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/24/2011 08:41 PM, Josh Triplett wrote:
>> That's in conflict with the current GNU Coding Standards, which states
>> that a program can blindly assume the existence of diff on $PATH.
>>
>> http://www.gnu.org/prep/standards/standards.html#Utilities-in-Makefiles
> 
> 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.

Autoconf can still be patched to support diff-less systems, but since
such systems don't comply with the GCS, there's no guarantee that some
other part of the build system will crop up as the next culprit.  I
think your efforts may be better directed to fixing busybox first.

> 
> On a related note, I just checked the configure script for GNU diffutils
> 3.0, and it depends on having a working diff program. :)

And that's fine, according to the GCS.  If GCS changes, then we'll fix
diffutils to build without requiring pre-installed diff.

>> 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
>> script.
> 
> Does it seem reasonable to modify existing macros that use diff to
> depend on a check for an appropriate program?

It seems like you'd want to add a new macro at the autoshell level, maybe:

AS_COMPARE_IFELSE([file1], [file2], [action-if-same], [action-if-different])

and make all existing clients of diff be reworked to call
AS_COMPARE_IFELSE, and put the smarts of deciding between diff and cmp
in the setup for AS_COMPARE_IFELSE.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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