Why not GNU cmp?

Unga unga888 at yahoo.com
Thu Sep 25 03:24:04 UTC 2008

--- On Thu, 9/25/08, Chad Perrin <perrin at apotheon.com> wrote:

> From: Chad Perrin <perrin at apotheon.com>
> Subject: Re: Why not GNU cmp?
> To: freebsd-questions at freebsd.org
> Date: Thursday, September 25, 2008, 7:07 AM
> On Wed, Sep 24, 2008 at 11:05:19AM -0400, matt donovan
> wrote:
> > On Wed, Sep 24, 2008 at 10:31 AM, Bill Moran
> <wmoran at potentialtech.com>wrote:
> > > Unga <unga888 at yahoo.com> wrote:
> > > >
> > > > I have noted FreeBSD uses GNU diff, GNU
> diff3 and GNU sdiff. Why FreeBSD
> > > uses its own version of cmp? why not use GNU cmp?
> Is the GNU cmp not
> > > compatible with FreeBSD?
> > >
> > > The GNU version of cmp is not licensed under the
> BSD license.
> > >
> > > Given enough time/manpower, all the GNU tools in
> FreeBSD will eventually
> > > be replaced with BSD-licensed versions.
> > 
> > and it's not GNU diff it's BSD diff
> Are you sure about that?  I thought FreeBSD was using GNU
> diff as its
> standard diff, and that a BSD diff was only available
> through ports
> (thanks in part to the efforts of someone working on
> BSD-licensed text
> tools during this year's Google SOC).

FreeBSD diff direcotry is /usr/src/gnu/usr.bin/diff . It refers to /usr/src/contrib/diff for diff sources. It seems FreeBSD apply a patch to GNU diff to get an option 'o' to get a old-style output. Applying a patch on a GNU app does not become BSD unless you write it from scratch.

In my past experience, the GNU ncurses and Flex (http://flex.sourceforge.net/) are simple not compatible with FreeBSD even though Flex is licensed under BSD. I wanted to know whether the GNU cmp is also the same fate other than the license because all these GNU tools comes in one package, Diffutils.

I was wondering why FreeBSD wrote their own version of cmp. If it just the license, then that's fine. I prefer the BSD versions of diff, etc. when available. 



More information about the freebsd-questions mailing list