# Compiling LiveCode for Linux

![LiveCode Community Logo](http://livecode.com/wp-content/uploads/2015/02/livecode-logo.png)

Copyright © 2015 LiveCode Ltd., Edinburgh, UK

## Dependencies

LiveCode has several dependencies that are needed in order to build it on Linux.  In general, it is enough to install the tools and libraries that would be typically used to compile a GNOME application written in C++.

Obviously, the exact packages required vary depending on which Linux distribution you use, and how recent it is.  For examples of the packages you may need, please see the "Standard build environments" section later in this document.

## Build environment

The LiveCode build obeys all of the standard make environment variables, including:

* `CC`: C compiler command
* `CXX`: C++ compiler command

There are some additional environment variables that it understands:

* `CXX_STD`: which version of the C++ standard to use (`gnu++98` is recommended)

## Configuring LiveCode

To configure LiveCode, simply run:

    make config-linux

This will generate make control files in the `build-linux-<arch>` directory.  For example, if you are compiling on an x86-64 system, this will create a `build-linux-x86_64` directory.

To provide detailed configuration options, you can use the `config.sh` script.  For more information, run:

    ./config.sh --help

## Compiling LiveCode

Usually, you can just run:

    make -k

However, if you wish to compile something more specific than "everything", you'll need to run the top level Makefile generated by gyp.  For example:

    make -C build-linux-x86_64/livecode development

## Standard build environments

**Note:** The following information is provided for reference purposes.  It should be possible to build and run LiveCode on any modern Linux desktop distribution.

### Linux x86-64

The x86-64 Linux build environment used for compiling LiveCode is based on Debian Wheezy.

The following additional packages are installed:

* build-essential
* automake
* libtool
* git
* curl
* flex
* bison
* libx11-dev
* libxext-dev
* libxrender-dev
* libxft-dev
* libxinerama-dev
* libxv-dev
* libxcursor-dev
* libfreetype6-dev
* libpopt-dev
* libesd0-dev
* liblcms-dev
* pkg-config
* libgtk2.0-dev

### Linux x86

The x86 Linux build environment used for compiling LiveCode is based on Debian Squeeze.

The following additional packages are installed:

* build-essential
* automake
* libtool
* zlib1g-dev
* gettext
* pkg-config
* libtiff-dev
* libpng-dev
* libatk1.0-dev
* libpango1.0-dev
* libcairo2-dev
* libxext-dev
* libffi-dev
* curl
* flex
* bison
* libx11-dev
* libxext-dev
* libxrender-dev
* libxft-dev
* libxinerama-dev
* libxv-dev
* libxcursor-dev
* libfreetype6-dev
* libpopt-dev
* libesd0-dev
* liblcms-dev
* pkgconfig

In addition, LiveCode requires a more modern version of GTK+ than is available in the Debian Squeeze repositories.  The following packages are compiled and installed from source:

* [GLib 2.34.3](http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xz)
* [GDK-PixBuf 2.26.5](http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.26/gdk-pixbuf-2.26.5.tar.xz)
* [GTK+ 2.24.23](http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.23.tar.xz)
