                                                8 June 2010.  SMS.

                    GNU Diffutils 3.0 for VMS (3.0a)
                    ================================

------------------------------------------------------------------------

      Disclaimer
      ----------

   No claims of any sort are made herein.  The main GNU Diffutils
developers are probably unaware of this effort.  Any suggestions for
improving the code in the VMS-specific sections are welcome, but low
expectations are more realistic than high ones.

------------------------------------------------------------------------

      Description
      -----------

   This note accompanies a quick VMS port of GNU Diffutils version
3.0, a GNU free file comparison utility collection.  The most obvious
features seem to work, but many have not been tested.

   Built and tested (slightly) in these environments:

OpenVMS Alpha V8.3, HP C V7.3-009

OpenVMS IA64 V8.3-1H1, HP C V7.3-018

OpenVMS VAX V7.3, Compaq C V6.4-005

------------------------------------------------------------------------

      News
      ----

   Version 3.0a 2010-06-05
   -----------------------

- General update to version 3.0.  Moved some VMS specifics from
  [.vms]config.h to various jacket header files in [.vms].

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

   Version 2.8.7b  2009-12-17
   --------------------------

- Added "ctx = stm" (on VMS) to the open() arguments in [.src]cmp.c. 
  This seems to resolve a complaint involving --ignore-initial applied
  to Alpha object files (Record format: Variable length).
  http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1390617

- Added VMS-specific code to work better with redirected output (PIPE,
  DEFINE SYS$OUTPUT).  Now, generic code will use a special,
  RMS-friendly fwrite()-replacement function, [.vmslib]vms.c:
  vms_fwrite(), which switches the order of arguments (ptr, 1, N, file)
  to (ptr, N, 1, file), so that one N-byte record will be produced,
  instead of N 1-byte records.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

   Version 2.8.7a  2008-09-24
   --------------------------

- New.  Between the unreleased status of Diffutils version 2.8.7, and my
  work, bugs are possible, but --ignore-file-name-case seems to work
  better than it did in 2.8.1.

- New VMS-specific code sets the default value for the
  --[no-]ignore-file-name-case option according to the current
  SET PROCESS /CASE_LOOKUP setting.  (Override this default with an
  explicit --[no-]ignore-file-name-case option.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

   Version 2.8.1a  2007-06-23
   --------------------------

- New.  Bugs are possible.

------------------------------------------------------------------------

      Changes to Source Files
      -----------------------

   Files new for VMS:

         [.vms]

      alloca.h            VMS-specific alloca.h.

      COLLECT_DEPS.COM    Dependency collector for descrip_mkdeps.mms.

      config.h            VMS-specific config.h.  "a" version suffix.

      configmake.h        VMS-specific (empty) header file.

      DESCRIP.MMS         Main MMK or MMS description ("make") file.

      DESCRIP_MKDEPS.MMS  Source dependency generator description file.

      DESCRIP_SRC.MMS     Source list description file.

      DESCRIP_SRC_FLAGS.MMS  Compile and link flags description file.

      fcntl.h             Jacket for <fcntl.h>.

      fnmatch.h           Processed [.lib]fnmatch.in.h.

      GDIFF_ED.COM        Template for an editor command procedure
                          ("SYS$LOGIN:GDIFF_ED.COM") to be used for
                          interactive editing in "sdiff".

      getopt.h            Processed [.lib]getopt.in.h.

      inttypes.h          Jacket for <inttypes.h>.

      limits.h            Jacket for <limits.h>.

      paths.h             VMS-specific paths.h.

      stdint.h            VMS-specific stdint.h.

      string.h            Jacket for <string.h>.

      time.h              Jacket for <time.h>.

      VMS_NOTES.TXT       These notes.


         [.vmslib]

      decc_ver.c          Program to show versions: VMS, C compiler, C
                          run-time library.

      vms.c               Various VMS-specific code: DEC C run-time
                          initialization, temporary logical name
                          creation, file specification parsing.

      vms_rms.h           NAM[L]-related macros.


         [.<various>]

      DESCRIP*.MMS        Various MMS description files.


   Files modified for VMS:

         [.lib]

      tempname.c          Changed to accomodate a VMS-style P_tmpdir
                          definition ("SYS$SCRATCH:", in <stdio.h>).


         [.src]

      cmp.c               Added "ctx = stm" (on VMS) to the open()
                          arguments.

      diff.c              Added VMS-specific code to set the default
                          value for the --[no-]ignore-file-name-case
                          option according to the current SET PROCESS
                          /CASE_LOOKUP setting.

      diff3.c             Added VMS-specific code for vfork()-execv()
                          and related I/O redirection.

      ifdef.c             Added a type cast to remove a
                          %CC-I-QUESTCOMPARE1 complaint.

      sdiff.c             Added VMS-specific code for vfork()-execv()
                          and related I/O redirection, and for
                          interactive editing.

------------------------------------------------------------------------

      Home source URL
      ---------------

http://www.gnu.org/software/diffutils/
http://ftp.gnu.org/gnu/diffutils/
ftp://ftp.gnu.org/gnu/diffutils/

------------------------------------------------------------------------

      Instructions
      ------------

   Extract the files from the distribution kit.  The kit includes
objects and executables for Alpha, IA64, and VAX, in the corresponding
host-specific subdirectories.  These builds were done with option
(explained below) "LARGE" (except VAX).

      SET DEFAULT [.DIFFUTILS-3_0A_VMS.VMS]   ! For convenience.

      MMS /MACRO = (LARGE=1)    ! Non-VAX (with large-file support).
      MMS                       ! VAX.

Additional build options are described in the main builder file,
[.vms]descrip.mms.  (Expect a %CC-I-QUESTCOMPARE complaint when
compiling [.lib]strftime.c and [.src]context.c, and a few more on VAX.)

   Set the symbols for the foreign commands.  For example:

      CMP   :== $ actual_device:[actual.directory]CMP.EXE
      GDIFF :== $ actual_device:[actual.directory]DIFF.EXE
      DIFF3 :== $ actual_device:[actual.directory]DIFF3.EXE
      SDIFF :== $ actual_device:[actual.directory]SDIFF.EXE

Because of the VMS "DIFFERENCES" command, "DIFF" would not be a good
choice for DIFF.EXE.

   Note that diff3 and sdiff create (vfork()+execv()) subproceses which
run diff, using "gdiff_exe:diff" to find the diff executable (as
specified in [.vms]paths.h: DEFAULT_DIFF_PROGRAM).  If the logical name
gdiff_exe is not defined, the program will define a user-mode
(temporary) logical name for gdiff_exe which points to the
device:[directory] where the diff3 or sdiff executable resides.  The
--diff-program=PROGRAM option can override this default.

   Similarly, the interactive editing feature in sdiff will use an
editor command procedure, "@ sys$login:gdiff_ed.com" (as specified in
[.vms]config.h: DEFAULT_EDITOR_PROGRAM).  A template procedure (using
EDIT /TPU) is provided as [.vms]gdiff_ed.com.

   These programs generally form file paths the UNIX way, so some care
may be needed for non-trivial cases.  For example, to compare two files
like [.d1.x1]a1.txt and [.d1.x2]a1.txt, either of the following commands
should work:

      gdiff [.d1.x1]a1.txt [.d1.x2]a1.txt       ! VMS-style.
      gdiff d1/x1/a1.txt  d1/x2/a1.txt          ! UNIX-style.

However, for a recursive diff, where diff will be constructing the paths
to the files, the directories must be specified in a UNIX form:

      gdiff -r d1/x1 d1/x2

------------------------------------------------------------------------

   Steven M. Schweda               (+1) 651-699-9818  (voice)
   382 South Warwick Street        sms@antinode.info
   Saint Paul  MN  55105-2547

