lxr-0.3.1 源码阅读 How To.
下载 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.相关推荐
- 转-OpenJDK源码阅读导航跟编译
OpenJDK源码阅读导航 OpenJDK源码阅读导航 博客分类: Virtual Machine HotSpot VM Java OpenJDK openjdk 这是链接帖.主体内容都在各链接中. ...
- WSL下源码阅读工具LXR(Linux Cross-Referencer)的配置
题外话:不知道是不是太久没有配置/部署软件的原因,上手配置LXR给我的体感比较不好,因此写下此博客记录该工具配置的过程 项目官网:zh/LXR 项目 参考教程1:史上最详细的LXR安装介绍_mosen ...
- Linux内核基础——Linux源码阅读工具Source Insight4.0
Linux内核源码阅读工具--source insight4.0 Source insight4.0工具的使用入门 一.Souce insight建立工程.导入源码 二.遍历所有源码文件建立符号索引 ...
- Spring Boot 2.0系列文章(四):Spring Boot 2.0 源码阅读环境搭建
前提 前几天面试的时候,被问过 Spring Boot 的自动配置源码怎么实现的,没看过源码的我只能投降��了. 这不,赶紧来补补了,所以才有了这篇文章的出现,Spring Boot 2. 0 源码阅 ...
- Ubuntu 22.04环境下安装lxr源码阅读器详细过程
Ubuntu 22.04环境下安装lxr源码阅读器详细过程 一.lxr介绍 二.依赖关系 三.安装过程 1.下载源码 2.执行检查 3.安装依赖 4.安装数据库和服务器 四.配置过程 1.主配置 2. ...
- linux内核源码lxr,配置glimpse与LXR读取linux内核源码
配置glimpse与LXR读取linux内核源码 1.安装 源代码编译glimpse sudo apt-get install flex sudo apt-get install lxr 2.设置Ap ...
- 应用监控CAT之cat-client源码阅读(一)
CAT 由大众点评开发的,基于 Java 的实时应用监控平台,包括实时应用监控,业务监控.对于及时发现线上问题非常有用.(不知道大家有没有在用) 应用自然是最初级的,用完之后,还想了解下其背后的原理, ...
- centos下将vim配置为强大的源码阅读器
每日杂事缠身,让自己在不断得烦扰之后终于有了自己的清静时光来熟悉一下我的工具,每次熟悉源码都需要先在windows端改好,拖到linux端,再编译.出现问题,还得重新回到windows端,这个过程太耗 ...
- 源码阅读:AFNetworking(十六)——UIWebView+AFNetworking
该文章阅读的AFNetworking的版本为3.2.0. 这个分类提供了对请求周期进行控制的方法,包括进度监控.成功和失败的回调. 1.接口文件 1.1.属性 /**网络会话管理者对象*/ @prop ...
- 源码阅读:SDWebImage(六)——SDWebImageCoderHelper
该文章阅读的SDWebImage的版本为4.3.3. 这个类提供了四个方法,这四个方法可分为两类,一类是动图处理,一类是图像方向处理. 1.私有函数 先来看一下这个类里的两个函数 /**这个函数是计算 ...
最新文章
- PhpStorm中绘画UML
- Winform中实现简单的登录成功后跳转到主页面的逻辑
- 学Java编程选择Java面授教学最有效
- 有没有一段代码,让你觉得人类的智慧也可以璀璨无比?【转】
- android 蒙层广告1,subnvue安卓机打开只显示蒙层,没有任何内容【报Bug】
- 【转载】基于rasa的对话系统搭建(上)
- 网易2018校园招聘编程题真题 合唱
- [asp.net]自定义控件(数据绑定)
- java+mysql实现图书管理系统
- ANSYS or Abaqus? 一个过来人的工作感悟
- Lombok之@Cleanup使用
- Exp9 Web安全基础 ————20164316张子遥
- 聊聊 Python 代码覆盖率工具 - 大咖爱爬虫
- android 工程模式mtk,Android L版本上user版本工程模式中gsensor校准失败
- 在线流程图和思维导图开发技术详解(六)
- 夜神模拟器之burp抓包
- Anolis OS 8.2 RC2 发行,支持飞腾、海光、兆芯、鲲鹏等芯片
- studio 热重载应用_热重载 (Hot reload)
- 2011年影响中国通信行业发展的十件大事
- python调用google翻译_python调用百度翻译、谷歌翻译