diff on sysv

Mark H. Colburn mark at jhereg.Jhereg.MN.ORG
Sat May 13 00:41:41 AEST 1989


In article <14468 at duke.cs.duke.edu> pusateri at romeo.cs.duke.edu (Thomas J. Pusateri) writes:
>I am trying to bring up RCS (the Revision Control System from Purdue) on
>a unix-pc and realize that the diff -n option that RCS requires is not 
>standard on system V machines. I then tried to bring up GNU diff but it
>depends on the directory(3) library of subroutines (opendir,closedir,etc)
>that is strictly BSD. I looked at the Public Domain versions of diff on
>simtel20 but they do not include the -n option either. Has anyone writtten
>a version of diff that includes the -n option but will compile under sys V R2?
>Or has anyone provided the directory(3) BSD routines for sysv so that I
>can use GNU diff? RCS is a wonderful tool that I would prefer not to do 
>without.

I have brought up the Revision Control System (RCS) on a 3b1 (SysVr2) and a
Convergent S/80 (SysVr3).  For the 3b1, I used Doug Gwyn's dirent library,
which is in the public domain, Sys5r3 includes the new style directory
stuff anyways.  It required a bit of fiddling with both the RCS and 
GNU-DIFF sources to make it work, but the changes were minimal.

I cannot say enough about Doug's dirent package.  If you don't have it, get
it!  It works great, and make porting things to or from POSIX, BSD, SysVr3,
etc., painless.  The package is available on uunet and other
comp.sources.unix archives.

Anyways, once the dirent package is installed, bringing put GNU-DIFF is a
piece of cake.  Make sure that the two files that use the directory stuff
#include <dirent.h> and add the line "#define direct dirent" (this fixes
BSD to Sys5r3/POSIX namespace mapping), and it should all just work.  I 
don't have the sources on line any more, but I beleive that the GNU-DIFF 
code has this stuff enclosed in "#ifdef SYSVR3".  I just changed this to 
be "#if defined(SYSVR3) || defined(DIRENT)" and added "-DDIRENT" to my 
cflags...

I also changed the RCS code to use the POSIX style dirent libraries to make
porting easier.  This was relatively straight forward and made the code run
a bit faster, but is not important if you alread got the stuff to compile
and work.

-- 
Mark H. Colburn                          mark at jhereg.mn.org
Minnetech Consulting, Inc.



More information about the Comp.sys.att mailing list