  MGv 2.2.1: Installing and Porting
  Eric A. Howe (mu@echo-on.net)
  1997/12/09

  1.  Installing and Porting

  The following are required to compile and use MGv:

  o  GNU Make 3.74 or higher (I haven't tried with older versions) which
     is available from ftp://prep.ai.mit.edu/pub/gnu

  o  ANSI/POSIX compliant C compiler and libraries

  o  X11R5 or X11R6

  o  Motif 1.2 or higher

  o  GNU Ghostscript version 2.6.1 or 3.33 (I haven't tried other
     versions or the Aladdin versions), both versions should be
     available from ftp://prep.ai.mit.edu/pub/gnu

  o  Perl or GNU m4 for patching up the resource file.  If you don't
     have either of these, then don't touch MGv.ad--fiddle with MGv.in
     instead since MGv.in only passes through sed.  Most people won't
     need perl or m4 so ignore the substitutions that will happen in the
     tools/ directory (the perl and m4 scripts will almost never get
     used by anyone but me).

     If you want to hack the documentation, you will need the sgml-tools
     package (I'm using version 0.99.0) which should be available at any
     Linux archive; you may wish to apply my patch (tools/sgml-
     tools-0.99.0.patch) if you want to duplicate the look of my
     documents.  If you want to make the dep or rdep targets, you will
     need an awk that understands the -v switch for setting variables;
     the findawk script in the tools directory will be called by the
     makefiles to attempt to find such an awk.

  If you have the necessary tools in place, you are ready to build MGv:

  1. Go into the make subdirectory and copy or link the appropriate
     sys.*.mk file to sys.mk; if there isn't one for your system, start
     with sys.TEMPLATE.mk and fill in the blanks (sending a copy to
     mu@echo-on.net would be appreciated).  I could have used Imake for
     this but Imake is really disgusting when it works and a complete
     mess when it doesn't; I've had far too many problems with Imake to
     bother with it.  I could have used GNU autoconf to generate a
     configure script but I like to use pretty strict compiler flags and
     I don't think autoconf can do that for me.

  2. Check sys.mk to make sure it is sane for your system.  If you If
     you don't have the Xpm library installed, set mk-xpm to no and
     remove -lXpm from libs.  If you have CDE, set mk-cde to yes;
     otherwise, set it to no (the CDE option doesn't do anything yet but
     it will be used in the future for the help system).  If you have
     libhelp, you can activate libhelp support by setting mk-libhelp to
     yes and fixing up the include and link paths as needed.

  3. If you have an SGI system, rename MGv.ad.sgi to MGv.ad if you want
     to try and use SGI schemes.  Keep in mind that the font changes in
     the page list don't work with SGI schemes yet so you won't be able
     to tell which pages are marked.  If anyone can help me with this, I
     would appreciate it.  If you just use the normal MGv.ad file,
     things should work just fine.

  4. Go back to the main directory and run GNU Make.  If you are hacking
     the sources, you might want to make the rdep target to get
     dependency lists.

  5. Execute the install target to install everything.  There are also
     install-bin, install-man, install-ad, and install-doc targets if
     you only want to install parts of MGv.

     If you have installed any of the 1.0 versions of MGv you should
     delete the old application defaults file (probably
     /usr/X11/lib/app-defaults/MGv or something similar) before running
     MGv; if you don't, MGv will warn you about it and the user
     interface will be really screwed up.  If you have just compiled a
     new version of MGv and you haven't installed it yet, you can set
     the XENVIRONMENT environment variable to temporarily fix the
     version problem:

             XENVIRONMENT=MGv ./mgv

  However, you really should delete the old application defaults file
  anyway (none of the MGv versions need it, they all compile the whole
  thing in as defaults anyway).

  There shouldn't be any problems compiling MGv but if there are, you
  might have to defined _POSIX_SOURCE and/or _XOPEN_SOURCE to get at
  popen(3) (POSIX.2 says it is there (at least HP's man pages claim
  this) and everyone has it but not everyone's headers agree; in
  particular, SCO forced me to use -a xpg4 to get popen()).  You might
  have to fiddle with the FDOPEN_BY_HAND and BUSTED_SYS_TYPES macros as
  well due to the sorry mess that is in some vendor supplied header
  files (all praise exclusive (as opposed to just inclusive) standards
  compliance testing).

  The clean target will remove most intermediate files and the realclean
  target will remove everything that can be generated (note that the
  realclean target is equivalent to the clean target in the doc
  directory in the released versions).

  1.1.  Porting

  Porting to new platforms should be easy if you have the required
  libraries and an ANSI compiler.  If you lack any of these, you'll have
  to get them or abandon MGv.  I have found that popen() and the socket
  stuff in wlib/wlib/dirtysocks.h causes the grief.  You can usually get
  at popen() by using -D_XOPEN_SOURCE (be careful about what this might
  do to POSIX things though).  If you're having trouble with the socket
  code, look at the stuff in the other sys.*.mk files for work arounds.
  Of course, you are welcome to hack the sources for your system and
  send patches to the author.

  I have personally compiled and used MGv on the following platforms:

     aix-gcc, aix-xlc
        AIX 4.1 with gcc-2.7.2/xlc.

     dec-cc, dec-gcc
        OSF/1 4.0 (Digital Unix) on a DEC Alpha with cc/gcc-2.7.2

     dynix
        Dynix/ptx 4.1.2 with cc.

     hpux-c89, hpux-gcc
        HP-UX 9.05 with c89/gcc-2.7.2

     irix62
        Irix 6.2 with cc -32.

     linux
        Linux with gcc 2.7.2, libc 5, Mootif 2.0.1 (ELF).

     mpras-cc, mpras-gcc
        AT&T MP-RAS running NCR unix 3.0 with cc/gcc-2.7.2.

     sco
        SCO 5.0 with cc (ELF).

     sinix
        Siemens Nixdorf Sinix 5.42 with c89.

     solaris-cc, solaris-gcc
        Solaris 2.4/2.5 with SPARCompiler cc/gcc-2.7.2.

  I haven't tried the SCO or Dynix/ptx systems for awhile but I don't
  think there will be any problems.  I have had reports of success on
  the following systems:

  o  AIX 3.2.5

  o  HP-UX 10.20 with c89

  o  Solaris 2.6/Intel with gcc

  o  UnixWare 2.1.2 with cc

  o  Encore UMAXC/m88k with gcc

  o  FreeBSD 3.0

     A makefile for FreeBSD 2.2.2 is in the make directory but I don't
     know how well MGv works on FreeBSD due to LessTif problems.

