[PATCH] Allow "make compare" to use "make gnucompare" automatically

Phil Edwards phil@jaj.com
Mon Apr 28 15:26:00 GMT 2003

On Mon, Apr 28, 2003 at 02:00:32PM +0100, Joseph S. Myers wrote:
> On Mon, 28 Apr 2003, Phil Edwards wrote:
> > On Mon, Apr 28, 2003 at 10:07:23AM +0100, Joseph S. Myers wrote:
> > > 
> > > We should be using a feature test here - version tests are for when a
> > > combination of different features in a particular version are wanted, or
> > > where the features or bug fixes that are needed are difficult to test for,
> > 
> > The latter is the situation here.
> What is the problem with (untested)
> echo abfoo >t1
> echo cdfoo >t2
> if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2; then
>   make_compare_target=gnucompare
> else
>   make_compare_target=slowcompare
> fi
> rm t1 t2
> ?

Ah.  Still limited to GNU cmp.  That changes things for the easier.

Another thought:  --ignore-initial was added in mid-1993, first available in
version 2.4 a few weeks later.  I am completely certain that if GNU cmp is
in use at all during the build, we can assume it is less than ten years old
and go with gnucompare without testing for version nor feature.


If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams

More information about the Gcc-patches mailing list