LXRインストール

 

http://sourceforge.net/projects/lxrからlxr-0.3.tar.gzをダウンロードする。

 

まず、解凍する。

$ gzip -cd lxr-0.3.tar.gz | tar xvf -

 

解凍すると、lxr-0.3ディレクトリが作られるので、そこに移動する。

$ cd lxr-0.3

 

Makefileを編集する。

$ vi Makefile

# Makefile for installation and configuration of LXR

# The location of your perl5 binary
PERLBIN=/usr/bin/perl
# LXR will be installed here
INSTALLPREFIX=/tmp/lxr

# End of configuration parameters
CGISCRIPTS=find ident search diff source
PERLMODULES=SimpleParse.pm Common.pm Config.pm

config: $(CGISCRIPTS) $(PERLMODULES) genxref

$(CGISCRIPTS) genxref: %: %.in
sed s%@perlbin@%$(PERLBIN)% < $< > $@


install: config genxref
install --directory $(INSTALLPREFIX)/http
install --directory $(INSTALLPREFIX)/http/lib
install --directory $(INSTALLPREFIX)/http/lib/LXR
install --directory $(INSTALLPREFIX)/bin
install --directory $(INSTALLPREFIX)/source
install --mode 755 $(CGISCRIPTS) $(INSTALLPREFIX)/http/
install --mode 750 genxref $(INSTALLPREFIX)/bin/
install --mode 755 Common.pm Config.pm $(INSTALLPREFIX)/http/lib/LXR
install --mode 755 SimpleParse.pm $(INSTALLPREFIX)/http/lib/
install --mode 644 http/* $(INSTALLPREFIX)/http/

clean:
rm -f $(CGISCRIPTS) genxref

# make install


 

INSTALLPREFIX/http/lxr.confの作成・編集

$ vi lxr.conf

# Configuration file.

# Define typed variable "v", read valueset from file.
variable: v, Version, [/usr/local/share/apache/htdocs/lxr/source/versions], [/usr/local/share/apache/htdocs/lxr/source/defversion]

# Define typed variable "a". First value is default.
variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)

# Define the base url for the LXR files.
baseurl: http://www.hogehoge.com/lxr/http/

# These are the templates for the HTML heading, directory listing and
# footer, respectively.
htmlhead: /usr/local/share/apache/htdocs/lxr/http/template-head
htmltail: /usr/local/share/apache/htdocs/lxr/http/template-tail
htmldir: /usr/local/share/apache/htdocs/lxr/http/template-dir

# The source is here.
sourceroot: /usr/local/share/apache/htdocs/lxr/source/$v/
srcrootname: Linux

# "#include <foo.h>" is mapped to this directory (in the LXR source
# tree)
incprefix: /usr/include

# The database files go here.
dbdir: /usr/local/share/apache/htdocs/lxr/source/$v/

# Glimpse can be found here.
glimpsebin: /usr/local/bin/glimpse

# The power of regexps. This is pretty Linux-specific, but quite
# useful. Tinker with it and see what it does. (How's that for
# documentation?)
map: /include/asm[^\/]*/ /include/asm-$a/
map: /arch/[^\/]+/ /arch/$a/


 

INSTALLPREFIX/http/.htaccessの編集

search、source、ident、diffをcgiとして実行できるようにするため

$ vi .htaccess

以下を追記する

<Files ~ (search|source|ident|diff)$>
SetHandler cgi-script
</Files>

 

identifierデータベース作成

lxr.confで編集したdbdirへ移動する

$ cd INSTALLPREFIX/source/kernel-x.x.x
$ INSTALLPREFIX/bin/genxref INSTALLPREFIX/source/kernel-x.x.x

 

Glimpseデータベース作成。Glimpseのインストール

# glimpseindex -H . /export/raid0/apache/htdocs/lxr/source/kernel-x.x.x
# ls -l .glimpse*

-rw------- 1 root other 39284 Jul 7 12:29 .glimpse_filenames
-rw------- 1 root other 1952 Jul 7 12:29 .glimpse_filenames_index
-rw------- 1 root other 0 Jul 7 12:28 .glimpse_filetimes
-rw------- 1 root other 384622 Jul 7 12:29 .glimpse_index
-rw------- 1 root other 298 Jul 7 12:29 .glimpse_messages
-rw------- 1 root other 820 Jul 7 12:29 .glimpse_partitions
-rw------- 1 root other 10952 Jul 7 12:29-.glimpse_statistics

# chmod 644 .gllimpse*


 

 

 

Linux/Solarisへ戻る