                                                24 September 2008.  SMS.

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

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

      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
2.8.7, a GNU free file comparison utility collection.  The most obvious
features seem to work, but many have not been tested.  As this is
written, the latest official GNU Diffutils release is version 2.8.1, but
its code for the "--ignore-file-name-case" option was defective, and
that seems to be better in version 2.8.7 (source obtained at
"http://alpha.gnu.org/gnu/diffutils/diffutils-2.8.7.tar.gz").

   Built and tested (slightly) in these environments:

OpenVMS Alpha V7.3-2, HP C V7.3-009, TCPIP V5.4 - ECO 7

OpenVMS IA64 V8.3, HP C V7.3-018 on OpenVMS IA64 V8.3

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

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

      News
      ----

   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]

      collect_deps.com    Dependency collector for descrip_mkdeps.mms.

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

      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.

      fnmatch.h           VMS-specific fnmatch.h.

      gdiff_ed.com        Template for an editor command procedure
                          ("sys$login:gdiff_ed.com") to be used for
                          interactive editing in "sdiff".

      paths.h             VMS-specific paths.h.

      vms_name_fix.sh     UNIX shell script to undo ODS2 file name
                          damage.

      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]

      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-2_8_7A_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 one %CC-I-QUESTCOMPARE complaint when
compiling [.lib]strftime.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

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

   The accompanying source kit may suffer from storage on an ODS2 file
system, which does not preserve case or allow multiple dots in a file
name.  Building this kit should work on VMS, but it may be expected to
fail on other systems.  To use this kit on a non-VMS system, the files
may need to be renamed to restore their original mixed-case and/or
multi-dot names.  The UNIX shell script "vms_name_fix.sh" (or something
like it) should do the job.

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

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

