home *** CD-ROM | disk | FTP | other *** search
-
- ----------------------
- Installing flex on VMS (flex version 2.3.6)
- ----------------------
-
- 1. Get the flex distribution and unpack it into a directory.
-
- 2. The [.vms] subdirectory contains all the files for VMS. Copy (or
- rename) them to the main flex directory [-]. (Actually, if you
- want the unix command line interface (see below), you don't need
- any of these files other than makefile.vms or dclmake.com. The
- rest are documentation or for the VMS command line interface.)
-
- 3. To build flex you need bison (the GNU project's yacc replacement)
- to generate parse.y and parse.h. If you don't have bison you may be
- able to get these two files from someone else. Rename them to
- initparse.y and initparse.h since the makefile clean procedure will
- delete them if you leave the names unchanged. Otherwise, you'll just
- have to get bison. (But if you need flex, you probably need bison
- as well!)
-
- 4. To build flex you need access to an alloca() routine. There are
- several available ones. If you have the bison sources easily acces-
- sible you may want to use the assembler alloca in vmshlp.c. Please
- note that this is a somewhat dangerous thing to do since the routine
- diddles with the runtime stack and may break if the C compiler or C
- source code changes. If this happens try compiling without optimization
- the routines that call alloca(). Slower but safer is the public-
- domain "semi-portable" version (which works fine on VMS) written by
- Doug Gwyn and distributed with GNU emacs (also available in the usenet
- comp.sources archives and many other public-domain source code repos-
- itories). In any event you need to have an object module on your
- system somewhere that contains a working alloca() routine.
-
- 5. Flex documentation is in two files, flex.1 and flexdoc.1. These are
- unformatted nroff source for the unix man pages. flex.1 describes
- the flex command and a condensed version of the material in flexdoc.1.
- flexdoc.1 contains a fuller description of flex input files and
- flex use. The VMS help file was derived from flex.1.
- If you have access to a unix system, you can format these two files
- with the commands:
-
- % nroff -man <flex.1 | col -b >flex.man
- % nroff -man <flexdoc.1 | col -b >flexdoc.man
-
- Otherwise, you'll have to get them via ftp or some other way, or
- rely on the information in flex.hlp.
-
- 6. You can build flex with either of two interfaces. One (the default)
- is a VMS-style interface and is run like other native VMS commands:
-
- $ flex/tables=equiv/stat=(perf,sum) foo.lex
-
- It includes a VMS help file entry. The other is a unix-like interface.
- Flex is defined as a foreign command and is run with a unix-style
- command:
-
- $ flex -vpCe foo.lex
-
- Decide which interface you want. If you change your mind later, just
- recompile main.c and relink.
-
- 7. If you have DEC's MMS or one of the MAKE programs that aren't too
- different from it, you can use makefile.vms to build flex. You may
- have to make some minor syntactical adjustments for your variant of
- MAKE. If you don't have a make program, you can use dclmake.com to
- build flex. It does the same things that the makefile does but you'll
- have to tell it what you want. The term makefile is used to refer to
- either makefile.vms or dclmake.com from here on.
-
- There are two steps involved: build a local copy of flex and test it,
- and then, if you want to make it available for public use, the makefile
- will install it by copying the needed files to a public directory.
-
- 8. Read whichever makefile you're going to use (makefile.vms or dclmake.com),
- read it and make any changes you need to. As distributed, they make
- the following assumptions:
-
- The makefile is configured to build flex with a VMS-style command
- line interface by default. You can change this to the unix-style
- interface.
-
- That you have copied into the flex directory an alloc.obj object
- module that contains a working alloca() routine. If you want to
- refer to an alloca module that lives elsewhere you can specify the
- location in the makefile.
-
- That the bison command is available in the system DCL tables. If
- not, you'll have to put a "set command dev:[dir]bison" command in
- the makefile just before the bison command.
-
- If you'll be installing flex for public use, the makefile assumes
- that the executable will go in directory pointed to by the logical
- name "flex_exe", the flex skeleton template into the logical directory
- "flex_library", and the flex documentation files into "flex_manual".
- (The latter will only occur if you have the formatted documentation
- files flex.man and flexdoc.man in the flex directory.)
- In addition, if you're building the VMS-style interface, the make-
- file will put the flex help module into the system help library,
- and the flex command definition file into the "flex_library".
- You'll have to define these lolgical names before doing an install
- or running the installed version, or change the definitions in the
- makefile.
-
- 9. Compile, link and test the executable. If you're using MAKE or MMS,
- rename makefile.vms to whatever your make program looks for and
- do:
- $ MAKE TEST
-
- (use MMS for MAKE if that's what you have). If you are using
- dclmake.com, do:
-
- $ @DCLMAKE BUILD
-
- Both procedures will compile all the sources, link them, then test
- them by using flex to generate what should by an exact copy of the
- flex lexer routine. They will then run DIFFERENCES to confirm that
- the generated lexer source is identical to the distributed one and
- and print a "Test successful" message.
-
- 10. You can now run your new flex. For the VMS version, do:
-
- SET COMMAND disk:[dir]XFLEX.CLD
-
- (note the X) where 'disk' and 'dir' is the full specification for the
- flex directory if you are not in that directory. For the unix inter-
- face version define a foreign command with:
-
- FLEX :== $disk:[dir]FLEX.EXE
-
- 'disk' and 'dir' are required in this case whatever your current direc-
- tory. Since flex was built with a default skeleton file name that points
- to a possibly non-existant file (since it hasn't been installed yet), you
- should explicitly specify a skeleton file with /SKELETON or -S options
- each time you run this local version of flex. Alternatively, if flex was
- built with LIB=flex_library (the default), you can define the logical name
- flex_library to point to the flex directory.
-
- 11. When your satisfied it's working you're ready to install it. Make
- sure the logical names "flex_exe", flex_library", and "flex_manual"
- are defined correctly. Then do either:
-
- MAKE ALL
- or
-
- @DCLMAKE INSTALL_TEST
-
- The makefile will copy flex.exe to flex_exe:, flex.skel to flex_lib:,
- flex.man and flexdoc.man to flex_manual: (if those two files are present),
- and if you've selected the VMS version, flex.cld to flex_library: and
- flex.hlp into the system help library, sys$common:[syshlp]helplib.hlb.
- It will then run the same test that was done before but on the newly
- installed flex.
-
- 12. Finally, you want to make sure the flex logical names are available
- to whoever is going to be using flex. You can do this by having the
- system startup procedure define them system wide at boot time, defining
- them in sylogin.com, or making a command procedure available to define
- them when needed. For the unix-interface version you also want to
- assign the flex foreign command symbol. For the VMS-interface version,
- you can install the flex command definition in the system DCL tables,
- or do a "SET COMMAND FLEX_LIBRARY:FLEX.CLD" in sylogin.com or tell
- users to do it in their login.com files.
-
- -------------------------------------------------
- 11/17/90 - Stuart McGraw, GTE Labs (sjm0@gte.com)
-