GithubHelp home page GithubHelp logo

markoschuetz / dxr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/dxr

1.0 2.0 0.0 5.16 MB

An intelligent source code browser

License: MIT License

ActionScript 0.38% PHP 1.71% C++ 0.16% Shell 0.32% Perl 0.13% JavaScript 95.79% Python 1.51%

dxr's Introduction

DXR
---

Introduction:
-------------

DXR is a source code cross-reference tool that uses static analysis data collected by Dehydra (https://developer.mozilla.org/en/Dehydra).  DXR was created in order to build on tools like LXR and MXR.  DXR only runs on Linux for the moment, and is heavily customized for the Mozilla project's source code.


Setup:
------

DXR is primarily a database of source code information.  You need a lot of
space to do this, and a fast computer helps a lot.

1) In order to build the database you need a working Mozilla and Dehydra build environemnt.  If you have this already, take note of the paths for your g++ and dehydra plugin, so you can alter paths in the scripts.  If you do not have one, you can follow the instructions here:

* Mozilla Build Environment for Linux (https://developer.mozilla.org/en/Linux_Build_Prerequisites)
* Dehydra Build Environment for Linux (https://developer.mozilla.org/En/Dehydra/Installing_Dehydra)

Note that Dehydra is only supported for gcc-4.5; any earlier version of gcc uses
a different plugin architecture, which is not supported.

If you are using a Fedora-like Linux, you can also do the following to have an environment setup locally:

./build-tools.sh

NOTE: this will not alter your system in any way, or replace any default tools.  It builds everything in a ./tools directory.  See build-tools.sh for necessary build dependencies.

You also need to make sure that you have python and python-sqlite installed on
your computer, as well as sqlite3

2) DXR uses config info from an INI style config file. Alter the variables in
dxrsrc/www/dxr.config for your environment.

3) For the moment you also need to alter dxrsrc/xref-scripts/dxr.js (i.e., the dehydra script) to point to your srcdir:

// NOTE the trailing slash
var srcroot = "/home/dave/dxr/mozilla-central/";

4) Create the wwwdir (e.g., /var/www/html/dxr) you specified in your dxr.config

5) Copy (or symlink) the contents of dxrsrc/www to your web dir. You also need
to copy (or symlink) the xref-scripts directory.

6) Configure and build your program. Note that you need to have:
CXXFLAGS="-fplugin=/path/to/gcc_dehyra.so -fplugin-arg-gcc_dehydra-script=/path/to/dxrsrc/xref-scripts/dxr.js"
CFLAGS="-fplugin=/path/to/gcc_dehyra.so -fplugin-arg-gcc_dehydra-script=/path/to/dxrsrc/xref-scripts/dxr.js"

7) Run the cross-reference generator:
dxrsrc/xref-scripts/run-dxr.py -f /path/to/web/dir/dxr.config

8) Download and install (or at least build somewhere the web app can access) Glimpse:

http://webglimpse.net/trial/glimpse-latest.tar.gz

9) You can optionally install sqlite 3 if it is not already installed on your system.  You don't strictly need it, but it makes accessing the database manually eaiser.

Running:
-------

You can build your source, create the xref database, and create the static HTML content as follows:

dxrsrc/xref-scripts/run-dxr.py -f /path/to/web/dir/dxr.config

This will post-process the data into dxr.sqlite.  It will also build the static
html and create a glimpse full-text search index.  All these files will be
created in the wwwdir using the name of the tree you provided in dxr.config
(e.g., mozilla-central).  You will end up with the following structure:

/var/www/html/dxr (or whereever your wwwdir is located)
		 /index.html (auto-generated during run-dxr.py)
                 /mozilla-central (symnlink to mozilla-central-current)
                 /mozilla-central-current
		                         /.dxr_xref
                                                   /mozilla-central.sqlite
                                                   /.glimpse*  (glimpse index files)
                                         /accessible (and all other source files copied from your src dir)

dxr's People

Contributors

jcranmer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.