home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / FLEX / FLEX-2.4 / FLEX-2 / flex-2.4.7 / MISC / VMS / VMS.more-stuff / install.vms < prev    next >
Encoding:
Text File  |  1990-11-26  |  7.8 KB  |  167 lines

  1.  
  2. ----------------------
  3. Installing flex on VMS   (flex version 2.3.6)
  4. ----------------------
  5.  
  6. 1.  Get the flex distribution and unpack it into a directory.  
  7.  
  8. 2.  The [.vms] subdirectory contains all the files for VMS.  Copy (or 
  9.     rename) them to the main flex directory [-].  (Actually, if you
  10.     want the unix command line interface (see below), you don't need
  11.     any of these files other than makefile.vms or dclmake.com.  The
  12.     rest are documentation or for the VMS command line interface.)
  13.  
  14. 3.  To build flex you need bison (the GNU project's yacc replacement)
  15.     to generate parse.y and parse.h.  If you don't have bison you may be
  16.     able to get these two files from someone else.  Rename them to
  17.     initparse.y and initparse.h since the makefile clean procedure will
  18.     delete them if you leave the names unchanged.  Otherwise, you'll just
  19.     have to get bison.  (But if you need flex, you probably need bison
  20.     as well!)
  21.  
  22. 4.  To build flex you need access to an alloca() routine.  There are
  23.     several available ones.  If you have the bison sources easily acces-
  24.     sible you may want to use the assembler alloca in vmshlp.c.  Please
  25.     note that this is a somewhat dangerous thing to do since the routine
  26.     diddles with the runtime stack and may break if the C compiler or C
  27.     source code changes.  If this happens try compiling without optimization
  28.     the routines that call alloca().  Slower but safer is the public-
  29.     domain "semi-portable" version (which works fine on VMS) written by
  30.     Doug Gwyn and distributed with GNU emacs (also available in the usenet
  31.     comp.sources archives and many other public-domain source code repos-
  32.     itories).  In any event you need to have an object module on your
  33.     system somewhere that contains a working alloca() routine. 
  34.  
  35. 5.  Flex documentation is in two files, flex.1 and flexdoc.1.  These are
  36.     unformatted nroff source for the unix man pages.  flex.1 describes
  37.     the flex command and a condensed version of the material in flexdoc.1.
  38.     flexdoc.1 contains a fuller description of flex input files and
  39.     flex use.  The VMS help file was derived from flex.1.  
  40.     If you have access to a unix system, you can format these two files
  41.     with the commands:
  42.  
  43.         % nroff -man <flex.1 | col -b >flex.man
  44.         % nroff -man <flexdoc.1 | col -b >flexdoc.man 
  45.  
  46.     Otherwise, you'll have to get them via ftp or some other way, or
  47.     rely on the information in flex.hlp.
  48.  
  49. 6.  You can build flex with either of two interfaces.  One (the default)
  50.     is a VMS-style interface and is run like other native VMS commands:
  51.  
  52.         $ flex/tables=equiv/stat=(perf,sum) foo.lex
  53.  
  54.     It includes a VMS help file entry.  The other is a unix-like interface.
  55.     Flex is defined as a foreign command and is run with a unix-style
  56.     command:
  57.  
  58.     $ flex -vpCe foo.lex
  59.  
  60.     Decide which interface you want.  If you change your mind later, just
  61.     recompile main.c and relink.
  62.  
  63. 7.  If you have DEC's MMS or one of the MAKE programs that aren't too
  64.     different from it, you can use makefile.vms to build flex.  You may
  65.     have to make some minor syntactical adjustments for your variant of
  66.     MAKE.  If you don't have a make program, you can use dclmake.com to
  67.     build flex.  It does the same things that the makefile does but you'll
  68.     have to tell it what you want.  The term makefile is used to refer to
  69.     either makefile.vms or dclmake.com from here on.
  70.  
  71.     There are two steps involved: build a local copy of flex and test it,
  72.     and then, if you want to make it available for public use, the makefile
  73.     will install it by copying the needed files to a public directory.
  74.  
  75. 8.  Read whichever makefile you're going to use (makefile.vms or dclmake.com),
  76.     read it and make any changes you need to.  As distributed, they make
  77.     the following assumptions: 
  78.  
  79.     The makefile is configured to build flex with a VMS-style command
  80.     line interface by default.  You can change this to the unix-style
  81.     interface.
  82.  
  83.     That you have copied into the flex directory an alloc.obj object
  84.     module that contains a working alloca() routine.  If you want to
  85.     refer to an alloca module that lives elsewhere you can specify the
  86.     location in the makefile.
  87.  
  88.     That the bison command is available in the system DCL tables.  If 
  89.     not, you'll have to put a "set command dev:[dir]bison" command in
  90.     the makefile just before the bison command.
  91.  
  92.     If you'll be installing flex for public use, the makefile assumes
  93.     that the executable will go in directory pointed to by the logical
  94.     name "flex_exe", the flex skeleton template into the logical directory
  95.     "flex_library", and the flex documentation files into "flex_manual".
  96.     (The latter will only occur if you have the formatted documentation 
  97.     files flex.man and flexdoc.man in the flex directory.)
  98.     In addition, if you're building the VMS-style interface, the make-
  99.     file will put the flex help module into the system help library,
  100.     and the flex command definition file into the "flex_library".
  101.     You'll have to define these lolgical names before doing an install
  102.     or running the installed version, or change the definitions in the
  103.     makefile.
  104.  
  105. 9.  Compile, link and test the executable. If you're using MAKE or MMS,
  106.     rename makefile.vms to whatever your make program looks for and
  107.     do:
  108.         $ MAKE TEST 
  109.  
  110.     (use MMS for MAKE if that's what you have).  If you are using
  111.     dclmake.com, do:
  112.  
  113.         $ @DCLMAKE  BUILD
  114.  
  115.     Both procedures will compile all the sources, link them, then test
  116.     them by using flex to generate what should by an exact copy of the
  117.     flex lexer routine.  They will then run DIFFERENCES to confirm that
  118.     the generated lexer source is identical to the distributed one and
  119.     and print a "Test successful" message.
  120.  
  121. 10. You can now run your new flex.  For the VMS version, do:
  122.  
  123.         SET COMMAND disk:[dir]XFLEX.CLD
  124.  
  125.     (note the X) where 'disk' and 'dir' is the full specification for the
  126.     flex directory if you are not in that directory.  For the unix inter-
  127.     face version define a foreign command with:
  128.  
  129.         FLEX :== $disk:[dir]FLEX.EXE
  130.  
  131.     'disk' and 'dir' are required in this case whatever your current direc-
  132.     tory.  Since flex was built with a default skeleton file name that points
  133.     to a possibly non-existant file (since it hasn't been installed yet), you
  134.     should explicitly specify a skeleton file with /SKELETON or -S options
  135.     each time you run this local version of flex.  Alternatively, if flex was
  136.     built with LIB=flex_library (the default), you can define the logical name
  137.     flex_library to point to the flex directory.
  138.  
  139. 11. When your satisfied it's working you're ready to install it.  Make
  140.     sure the logical names "flex_exe", flex_library", and "flex_manual"
  141.     are defined correctly.  Then do either:
  142.  
  143.         MAKE ALL
  144.     or
  145.  
  146.         @DCLMAKE INSTALL_TEST
  147.  
  148.     The makefile will copy flex.exe to flex_exe:, flex.skel to flex_lib:,
  149.     flex.man and flexdoc.man to flex_manual: (if those two files are present),
  150.     and if you've selected the VMS version, flex.cld to flex_library: and
  151.     flex.hlp into the system help library, sys$common:[syshlp]helplib.hlb.
  152.     It will then run the same test that was done before but on the newly
  153.     installed flex.
  154.  
  155. 12. Finally, you want to make sure the flex logical names are available
  156.     to whoever is going to be using flex.  You can do this by having the
  157.     system startup procedure define them system wide at boot time, defining
  158.     them in sylogin.com, or making a command procedure available to define
  159.     them when needed.  For the unix-interface version you also want to
  160.     assign the flex foreign command symbol.  For the VMS-interface version,
  161.     you can install the flex command definition in the system DCL tables,
  162.     or do a "SET COMMAND FLEX_LIBRARY:FLEX.CLD" in sylogin.com or tell
  163.     users to do it in their login.com files.
  164.  
  165. -------------------------------------------------
  166. 11/17/90 - Stuart McGraw, GTE Labs (sjm0@gte.com)
  167.