wiki:InstallLindFromSource

Version 22 (modified by gholami, 2 years ago) (diff)

--

Setting up Lind environment

Currently Lind works on Ubuntu 14.04 LTS 64 bit machine. Here are the steps you need to follow to setup Lind environment from scratch.
You need approximately 15GB free disk space for the project.

  1. Install the needed libraries:
    sudo apt-get install git subversion ia32-libs build-essential texinfo texlive gcc-multilib g++ g++-multilib libsdl1.2-dev texinfo libcrypto++-dev libssl-dev lib32ncurses5-dev m4 libelf-dev python-dev indent autoconf flex bison curl
    
  1. Setup Google depot-tools according to Install depot_tools. Make sure gclient is reachable from $PATH.
  1. On your Linux machine, setup two environment variables: $LIND_SRC and $REPY_PATH, each pointing to an empty folder. $LIND_SRC will hold source code of the project, and $REPY_PATH will be holding the final product.
  1. Create another environment variable: NACL_SDK_ROOT, pointing to $REPY_PATH/sdk. It is used when compiling projects from NaCl? Ports.
  1. From your terminal, run
    cd $LIND_SRC
    curl -L -O https://raw.github.com/Lind-Project/Lind-misc/master/build.sh
    chmod +x ./build.sh
    ./build.sh all
    

Other useful build commands

If you made changes to the Lind code, you can use the following build commands.

  • Incremental build of NaCl runtime
    If you have made any changes to the NaCl runtime (like changes in its trusted code base) you need to build it again using the command.
    ./build.sh nacl
    
  • Clean compilation of the entire NaCl toolchain (glibc, gcc, gdb, etc.)
    If this is the first time you are building the NaCl toolchain, you need to use this command.
    ./build.sh buildglibc
    
  • Incremental compilation of Lind glibc
    If you made some code changes in the Lind-Glibc files -- like modifying the existing file contents, you need to build glibc again. This command is not be used if you made changes to the Makefile or the directory structure (like adding or removing files).
    NOTE: Need a full compilation of the entire toolchain beforehand.
    ./build.sh updateglibc
    
  • Clean compilation of Lind glibc
    If you made code changes to the Makefile or added/removed files from the current Lind-Glibc files, you need to build glibc again using the below command. Also, use this command if the above doesn't work.
    NOTE: Need a full compilation of the entire toolchain beforehand.
    ./build.sh updateglibc2
    
  • Install compiled NaCl runtime and toolchain into $REPY_PATH
    Use the below command to install the NaCl runtime and toolchain into the $REPY_PATH after you made modifications to the code and built the source code using the above commands.
    NOTE: This does NOT include Repy.
    ./build.sh install