From 6ba441eeb321d61d578d3ce9a5729db5fff83dfc Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 7 Apr 2014 18:26:38 +0100 Subject: [PATCH] Added documentation for building under Linux. --- docs/GettingStarted.md | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 427cc45c..87319ed7 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -42,6 +42,80 @@ Last updated to LLVM/Clang revision: `r202563` - 32-bit builds: `config=release_x32 make` - 64-bit builds: `config=release_x64 make` +## Compiling on Linux (experimental) + +### Build dependencies: + +If you do not have native build tools you can install them first with: + +```shell +sudo apt-get install build-essential gcc-multilib g++-multilib +sudo apt-get install ninja-build cmake +``` + +Additionaly we depent on a somewhat recent version of Mono (.NET 4.5). If you're using an Ubuntu-based distribution you can install an up-to-date version from: https://launchpad.net/~directhex/+archive/monoxide + +```shell +sudo add-apt-repository ppa:directhex/monoxide +sudo apt-get update +sudo apt-get install mono-devel +``` + +### Getting Premake: + +Download a recent Premake version from: http://sourceforge.net/projects/premake/files/Premake/nightlies/premake-dev-linux.zip/download + +Extract the binary inside `premake5` to `/build`. + +### Cloning CppSharp: + +```shell +git clone https://github.com/mono/CppSharp.git +``` + +### Cloning and building LLVM/Clang: + +```shell +pushd && cd CppSharp/deps + +git clone https://github.com/llvm-mirror/llvm.git +git clone https://github.com/llvm-mirror/clang.git llvm/tools + +cd llvm && mkdir build && cd build + +cmake -G Ninja -DCLANG_BUILD_EXAMPLES=false -DCLANG_ENABLE_ARCMT=false \ + -DCLANG_ENABLE_REWRITER=false -DCLANG_ENABLE_STATIC_ANALYZER=false \ + -DCLANG_INCLUDE_DOCS=false -DCLANG_INCLUDE_TESTS=false \ + -DLLVM_BUILD_32_BITS=false -DCLANG_BUILD_DOCS=false \ + -DCLANG_BUILD_EXAMPLES=false -DLLVM_TARGETS_TO_BUILD="X86" .. + +ninja +popd +``` + +### Building CppSharp: + +```shell +cd CppSharp/build +./premake5 gmake +cd gmake +make +``` + +This will compile the default target for the architecture, for instance, the `debug_x32` target for 32-bits X86. + +You can change the target by invoking `make` as: + +```shell +config=release_x32 make +``` + +Additionaly if you need more verbosity from the builds invoke `make` as: + +```shell +verbose=true make +``` + ## Generating bindings Suppose we have the following declarations in a file named `Sample.h` and we