下载 lxr-0.3.1

一、安装

读INSTALL

需要glimpse:

http://webglimpse.net/download.php

修改Makefile:

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

make install

二、配置

cat > /var/www/lxr/http/.htaccess << EOF
<Files ~ (search|source|ident|diff)$>
SetHandler cgi-script
</Files>
EOF

cat >> /etc/apache2/apache2.conf << EOF
Alias /lxr /var/www/lxr
<Directory /var/www/lxr>Options AllAllowOverride    All
</Directory>
EOF

cat > /var/www/lxr/http/lxr.conf  <<EOF
# Configuration file.# Define typed variable "v", read valueset from file.
variable: v, Version, [/var/www/lxr/source/versions], [/var/www/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://localhost/lxr/http/# These are the templates for the HTML heading, directory listing and
# footer, respectively.
htmlhead: /var/www/lxr/http/template-head
htmltail: /var/www/lxr/http/template-tail
htmldir:  /var/www/lxr/http/template-dir# The source is here.
sourceroot: /var/www/lxr/source/$v/
srcrootname:$v# "#include <foo.h>" is mapped to this directory (in the LXR source
# tree)
incprefix: /include# The database files go here.
dbdir: /var/www/lxr/My-Db/$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/EOF

三、添加代码

写了个脚本 lxr-add-source.sh 如下:

#/bin/bash
###
#Need root....
u_id=`id -u`
r_id=`id -u root`
if [ $u_id -ne $r_id ]then echo "Need root..." ;  exit 1
fi#Only accept one tarfile:
if [ $# -ne 1 ]then echo "USage: $0   File.tar.gz[bz2]" ; exit 1
fi#Get the FileName:
echo "$1" | grep -q ".tar.bz2"
if [ $? -eq 0 ] then FileName=`basename "$1" .tar.bz2`
elseecho "$1" | grep -q ".tar.gz"if [ $? -eq 0 ]then FileName=`basename "$1" .tar.gz`elseecho "USage: $0   File.tar.gz[bz2]" ; exit 1fi
fi#The base variable:
Base_lxr="/var/www/lxr"
Source_base="$Base_lxr/source"
Dbdir_base="$Base_lxr/My-Db"#Untar the source:
echo '###Untar the source......'
tar -C "$Source_base" -x -f "$1"#Generate the identifier database:
echo '###Generating the identifier database......'
mkdir -pv "$Dbdir_base/$FileName"
cd "$Dbdir_base/$FileName"
$Base_lxr/bin/genxref "$Source_base/$FileName"
/usr/local/bin/glimpseindex -H . "$Source_base/$FileName"
#Chmod o=r:
chmod o=r -v "$Dbdir_base/$FileName/fileidx"
chmod g=rx,o=rx -v "$Source_base/$FileName"
chmod g=rx,o=rx -v `find "$Source_base/$FileName" -type d`
chmod g=r,o=r -v `find "$Source_base/$FileName" -type f`#Add a item to versions.
echo '###Adding a item to versions......'
echo "$FileName" >> "$Base_lxr/source/versions"
if [ ! -e "$Base_lxr/source/defversion" ]
then    cp -v versions defversion
fi#Over.
echo ok! 

运行:

lxr-add-source.sh  foo.tar.gz 

四、阅读

重启apache:

service apache2 restart

浏览:http://localhost/lxr/http/blurb.html

转载于:https://www.cnblogs.com/qydw000/p/4440273.html

lxr-0.3.1 源码阅读 How To.相关推荐

  1. 转-OpenJDK源码阅读导航跟编译

    OpenJDK源码阅读导航 OpenJDK源码阅读导航 博客分类: Virtual Machine HotSpot VM Java OpenJDK openjdk 这是链接帖.主体内容都在各链接中.  ...

  2. WSL下源码阅读工具LXR(Linux Cross-Referencer)的配置

    题外话:不知道是不是太久没有配置/部署软件的原因,上手配置LXR给我的体感比较不好,因此写下此博客记录该工具配置的过程 项目官网:zh/LXR 项目 参考教程1:史上最详细的LXR安装介绍_mosen ...

  3. Linux内核基础——Linux源码阅读工具Source Insight4.0

    Linux内核源码阅读工具--source insight4.0 Source insight4.0工具的使用入门 一.Souce insight建立工程.导入源码 二.遍历所有源码文件建立符号索引 ...

  4. Spring Boot 2.0系列文章(四):Spring Boot 2.0 源码阅读环境搭建

    前提 前几天面试的时候,被问过 Spring Boot 的自动配置源码怎么实现的,没看过源码的我只能投降��了. 这不,赶紧来补补了,所以才有了这篇文章的出现,Spring Boot 2. 0 源码阅 ...

  5. Ubuntu 22.04环境下安装lxr源码阅读器详细过程

    Ubuntu 22.04环境下安装lxr源码阅读器详细过程 一.lxr介绍 二.依赖关系 三.安装过程 1.下载源码 2.执行检查 3.安装依赖 4.安装数据库和服务器 四.配置过程 1.主配置 2. ...

  6. linux内核源码lxr,配置glimpse与LXR读取linux内核源码

    配置glimpse与LXR读取linux内核源码 1.安装 源代码编译glimpse sudo apt-get install flex sudo apt-get install lxr 2.设置Ap ...

  7. 应用监控CAT之cat-client源码阅读(一)

    CAT 由大众点评开发的,基于 Java 的实时应用监控平台,包括实时应用监控,业务监控.对于及时发现线上问题非常有用.(不知道大家有没有在用) 应用自然是最初级的,用完之后,还想了解下其背后的原理, ...

  8. centos下将vim配置为强大的源码阅读器

    每日杂事缠身,让自己在不断得烦扰之后终于有了自己的清静时光来熟悉一下我的工具,每次熟悉源码都需要先在windows端改好,拖到linux端,再编译.出现问题,还得重新回到windows端,这个过程太耗 ...

  9. 源码阅读:AFNetworking(十六)——UIWebView+AFNetworking

    该文章阅读的AFNetworking的版本为3.2.0. 这个分类提供了对请求周期进行控制的方法,包括进度监控.成功和失败的回调. 1.接口文件 1.1.属性 /**网络会话管理者对象*/ @prop ...

  10. 源码阅读:SDWebImage(六)——SDWebImageCoderHelper

    该文章阅读的SDWebImage的版本为4.3.3. 这个类提供了四个方法,这四个方法可分为两类,一类是动图处理,一类是图像方向处理. 1.私有函数 先来看一下这个类里的两个函数 /**这个函数是计算 ...

最新文章

  1. PhpStorm中绘画UML
  2. Winform中实现简单的登录成功后跳转到主页面的逻辑
  3. 学Java编程选择Java面授教学最有效
  4. 有没有一段代码,让你觉得人类的智慧也可以璀璨无比?【转】
  5. android 蒙层广告1,subnvue安卓机打开只显示蒙层,没有任何内容【报Bug】
  6. 【转载】基于rasa的对话系统搭建(上)
  7. 网易2018校园招聘编程题真题 合唱
  8. [asp.net]自定义控件(数据绑定)
  9. java+mysql实现图书管理系统
  10. ANSYS or Abaqus? 一个过来人的工作感悟
  11. Lombok之@Cleanup使用
  12. Exp9 Web安全基础 ————20164316张子遥
  13. 聊聊 Python 代码覆盖率工具 - 大咖爱爬虫
  14. android 工程模式mtk,Android L版本上user版本工程模式中gsensor校准失败
  15. 在线流程图和思维导图开发技术详解(六)
  16. 夜神模拟器之burp抓包
  17. Anolis OS 8.2 RC2 发行,支持飞腾、海光、兆芯、鲲鹏等芯片
  18. studio 热重载应用_热重载 (Hot reload)
  19. 2011年影响中国通信行业发展的十件大事
  20. python调用google翻译_python调用百度翻译、谷歌翻译

热门文章

  1. 前端---antd中的日期选择组件
  2. 尝鲜体验win11,附赠win11镜像下载地址
  3. 计算机综合布线实验报告,综合布线设计实验报告.doc
  4. 想方便快捷的分享/收藏图片?试试免费好用的微博/b站图床
  5. [工作记事] Ubuntu 编译安装PHP以及gd库使得支持jepg
  6. RCF—用于C++的进程间通讯(4)
  7. 文件夹的使用、常见术语缩写
  8. ubuntu 安装视频下载器Annie
  9. Teams Tab App 分析
  10. 数字化转型进行时 | 区块链赋能政务数字化研讨会在零数科技举办