# Build instructions #

## Regular build ##
To be able to build the library on a Raspberry Pi itself, you need to do the following:

- Install the packages tcl8.5-dev, libi2c-dev, and autoconf, if necessary: `sudo apt-get install tcl8.5-dev libi2c-dev autoconf`
- Go to the source directory: `cd piio`
- Get the standard tclconfig files: `wget -qO- | tar xzv`
- Create the configure script from configure.in: `autoconf`
- I prefer to build in a separate directory: `mkdir build;cd build`
- Run configure: `../configure
- Build the library: `make`
- Optionally install it: `sudo make install`

## Cross compiling ##
Compiling on the Raspberry Pi itself is slow. Since the code of the piio library isn't very big, it's not a big problem. But of course, it's also possible to cross compile the library on a more powerful linux system. To do that, you need a cross compile environment. One way to create that is using [the build-cc Make sure you have installed all necessary development packages before running the script.

You'll also need a stubs library compiled for a Raspberry Pi. You can generate that by cross compiling Tcl first.

Next, run the following commands:

    wget -qO- | tar xzv
    autoconf
    mkdir build
    cd build
    eval armv6-hardfloat-linux-gnueabi)
    ../configure -host=armv6-hardfloat-linux-gnueabi
    make


------
*On 2017-06-07 00:00:48 UTC anonymous (claiming to be Mike) added:*

How do I download all the files for this package, don't seem find anything that lets me do it, or gives me some instructions, on what to do  :/


------
*On 2017-06-07 15:23:39 UTC added:*

You can download the files the same way as all chiselapp projects (if enabled). The direct link for piio trunk is:

If you want a specific version, click on the desired check-in on the timeline tab and then click the preferred download format (Tarball or ZIP archive).