Abstract
This document will attempt to detail the steps needed to install LXR, Bonsai, and Tinderbox. I wrote these up after needing to configure these tools for the GNOME Project.
Table of Contents
LXR comes with an install file that talks a bit about how to set things up. Make sure that you've read that first, as it's somewhere to start.
The first step is to get LXR from mozilla CVS. Mozilla has some complete instructions, but here's an abbreviated version.
Procedure 1.
Set your CVSROOT variable to :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot. Run cvs login, and leave the password blank.
Run cvs -z3 checkout mozilla/webtools/lxr.
Now you'll want to move the lxr/ directory to somewhere that your webserver can access it. This is usually someplace like /var/www/html/.
This step is only necessary if you're using LXR to cross-reference a single source tree. If you have multiple trees, you can skip this step. As of October 25, 2001, this step is still required. I'll try to let everybody know as soon as this changes.
Visit Bug 41917 and download the third patch. Without this patch, you'll spend a lot of time beating your head against the wall trying to figure out what's going wrong.
TADA! Now you've got the LXR files in place, and are ready to set things up for your local install.
In order for LXR to know where you've put things, you have to set up the lxr.conf file. Most of these parameters are documented in INSTALL, but we'll go over them again here.
This is the ‘root’ of the LXR web tree. For us, this was ‘http://cvs.gnome.org/lxr/’.
This is like the baseurl, except that it's for bonsai instead. Ours was ‘http://cvs.gnome.org/bonsai’.
These are all templates. Open up the examples, and play around with them so that LXR matches the rest of your website nicely. These are all very mozilla specific, so be sure to go over them a couple of times.
There are two possible ways to specify sourceroot. If you're only cross-referencing a single tree, use use
sourceroot: /cvsroot/gnomewhere /cvsroot/gnome is the location of the checked out sources that you want to cross-reference.
If you're cross-referencing multiple trees, you'll need to use the second format.
sourceroot: gnome
/cvsroot/gnome/tree1
sourceroot: othertree /cvsroot/gnome/othertree
See lxr.conf for more details.
This is a name for the project that you're cross-referencing.
This parameter is a little trixy. Supposedly this is prepended to the URL, but the behaviour seems to vary depending on whether or not there is a leading /. For our setup, I found that /lxr was the right thing to use.
This is the prefix to map things like
#include <foo.h>to. I left it set to /include.
This is where lxr will store the database files that it creates. I put them in lxr/data, mirroring the bonsai configuration. You could easily put them most anywhere.
Make this the path to wherever you've installed glimpse.
Glimpse isn't truly free. You can get it, and some details on the license that it falls under from http://webglimpse.org/.
Like any other web application, you have to tell your web server how to handle lxr. The INSTALL file talks about these changes, but I wanted to augment this a little bit.
srm.conf needs to have a line to handle cgi-scripts. It should look something like
AddHander cgi-script .cgiLook around, it make be as simple as un-commenting this line.
You'll want to add a section here for the directory where you've installed LXR. It needs to have at least
Options ExecCGI FileInfo AllowOverride Options
You'll have to make sure that your dbdir is readable by the user that the webserver runs as.
Before LXR can do anything useful, you have to create the on disk indexes for it. This is really straightforward.
Identifier Database. cd to the directory you specified as the dbdir in lxr.conf and run /var/www/html/lxr/genxref /cvsroot/gnome where /cvs/gnomeis the location to the source code that you want to browse with LXR.
Glimpse Database. Go to the same directory as you did for the indentifier database, but this time run /path/to/glimpse -H . /cvs/gnome, where /cvs/gnome is the path to the sources you want to be able to search.