Making and Installing Lynx

This guide is primarily intended for users/administrators who want to install Lynx on their systems. It may be of use to the average user who wishes to build Lynx for their own use. Even experienced admins may find this document useful, I've worked on systems where the lynx.cfg file was left unchanged by a unix whiz. The step by step instructions ensure you make the changes necessary for your local environment. This guide is Unix centric, for VMS users the build script should be used to compile the binary

This document is based on Larry Virden <lvirden@cas.org>'s *Newbie(installing) post on Lynx-Dev

Directions

Check out from interlibrary loan the book "The UNIX Programming Environment" and read it. This will give you an intro to Unix from a programming perspective.

Check out from interlibrary loan the book "Porting UNIX Software" and read it. This will discuss using zip, make, etc.

You will need the following tools: unzip, editor of some sort, make, cc, /bin/sh, ranlib (possibly), cp, install (possibly), compress, gunzip, uudecode, gzcat, gzip, zip, mkdir, mv, rm, tar, touch, cp, and chmod. Also, you may need the slang, ncurses, and/or SOCKS library. Also, you will need the helper applications tn3270 and xloadimage.

Create a directory where you have space to build the softare. You will need approximately 15-30 meg of disk. Most systems make /tmp available to users who need a large amount of space for a short period of time. Decide where you are going to install lynx. You will likely need up to 4 meg or so for this (depends on the compile options, options chosen, etc.) If you can get permission to install in the /usr/local set of directories, your job will become _MUCH_ easier...

You will need a structure that looks like this:

  PREFIX = /usr/local

  PREFIX/bin/		<- lynx gets installed here
  PREFIX/lib/		<- lynx.cfg gets installed here
  PREFIX/man/man1/	<- lynx.1 man page

  PREFIX/lib/lynx_help/	<- lynx help files should be installed here
  PREFIX/lib/mosaic/	<- mime.types and mailcap should be installed here

put the .zip file in this directory. unzip it. You now have 2 files in your directory - the .zip file, and a directory called lynx2-7 (or something like that).

cd lynx2-7

Read the README file. Read it again.

Read the INSTALLATION file. Read it again.

Read the PROBLEMS file. See if your Operating System/Hardware matches any of the environments mentioned.

Make a copy of the userdefs.h (call it userdefs.h.orig).

Make a copy of the Makefile (call it Makefile.orig perhaps).

Make a copy of the lynx.cfg file (call it lynx.cfg.orig).

Read, and then edit, the userdefs.h file. Decide what, if any, of the options you would like, or need, to change. userdefs.h is evaluated while Lynx is compiling and the options specified are hard-coded into the binary (most of these can be over-ridden in lynx.cfg or from the command-line, but we want to get things right). If you are NOT installing into /usr/local, there are various directory names you will need to change. Also, you should specify a default STARTFILE url where users will start if they do not have a web home page, your LOCAL_DOMAIN needs to be set, and at the bottom of the file, check the pathnames to ensure that your utilities are all where you expect them to be.

Read, and then edit, the lynx.cfg file. This file is used by Lynx to set various environment variables. Your users will thank you a great deal if you get this right.

Read, and then edit, the Makefile. The primary lines you might have to edit are the exec, doc and cfg lines. For certain systems, or options, you will have to uncomment some of the Makefile comments - there are comments to let you know which ones to uncomment. The tricky part is to determine which ones you will eventually want to mess with.

At this step, I recommend trying the compile. From the lynx2-7 directory, type

  nohup make _target_ > make.out 2>&1

if you are using a Bourne/Korn shell. This captures all of the output from the make into a file. This will come in handy since you will want to look for warnings, errors, etc. after the make completes. For tcsh, you may want to use 'make _target_ >& make.out &' to start a background job that makes the binary.

If there are problems read the PROBLEMS file. The most likely places they occur are:

  1. You need some directory in your PATH variable so that you can find make, cc, or some other piece during the process.
  2. You have a typo in userdefs.h or the Makefile.
  3. You tried to turn on an option but the accompanying library is not present.
  4. Your version of the OS is different from the ones currently supported.

If you have case 4, drop a line to lynx-dev to see if anyone else has the fixes for this.

When the compilation succeeds, type

  ./lynx http://lynx.browser.org/

If you can see the Lynx homepage, then the lynx binary can open HTTP connections and parse/render a basic html document. To install Lynx in the directories you specified (in the Makefile), issue the command:

  make install

You'll have to copy the help files over manually. Alternatively, you can copy the lynx binary, the lynx.cfg and lynx_help directory over manually. You'll want to save userdefs.h, Makefile and make.out for troubleshooting in case problems arise later.

Remember to clean up after yourself since space is always scarce. You can do this easily from the parent directory by issuing the command 'rm -rf lynx2-7' which will recursively remove the lynx2-7 directory overriding file permissions if necessary.


Lynx links | *Subir Grewal | lynx-@trill-home.com.