From efa6e683ee14bcb3a08535952f8bd461bf94d8f2 Mon Sep 17 00:00:00 2001 From: Adam Murdoch Date: Mon, 3 Sep 2012 13:59:11 +1000 Subject: [PATCH] Tweaked build for linux machines where multi-arch support is not available. --- build.gradle | 16 ++++++++++------ readme.md | 14 +++++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 894132e..dfab76f 100755 --- a/build.gradle +++ b/build.gradle @@ -48,13 +48,17 @@ libraries { args("-lcurses") } } - i386.spec { - baseName = 'native-linux-i386' - args("-m32") + if (System.getProperty('os.arch') == 'i386' || project.hasProperty('multiarch')) { + i386.spec { + baseName = 'native-linux-i386' + args("-m32") + } } - amd64.spec { - baseName = 'native-linux-amd64' - args("-m64") + if (System.getProperty('os.arch') == 'amd64' || project.hasProperty('multiarch')) { + amd64.spec { + baseName = 'native-linux-amd64' + args("-m64") + } } } else { baseName = "native-solaris" diff --git a/readme.md b/readme.md index b5ba2e8..3b5c32c 100755 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ These bindings work for both the UNIX terminal and the Windows console: Currently ported to OS X, Linux, Solaris and Windows. Tested on: * OS X 10.7.4, 10.8 (x86_64), 10.6.7 (i386) -* Ubunutu 12.04 (amd64) +* Ubunutu 12.04 (amd64), 8.04.4 (i386, amd64) * Solaris 11 (x86) * Windows 7 (amd64) @@ -69,11 +69,19 @@ You will need a very recent snapshot of [Gradle](http://www.gradle.org/). ### Ubuntu -The g++ compiler is required to build the native library. You will need to `g++` package for this. Generally this is already installed. +The g++ compiler is required to build the native library. You will need the `g++` package for this. Generally this is already installed. + +You need to install the `libncurses5-dev` package to pick up the ncurses header files. Also worth installing the `ncurses-doc` package too. + +#### 64bit machines with multi-arch support + +Where multi-arch support is available (newer Ubuntu releases), you can build the i386 and amd64 versions of the library. You need to install the `gcc-multilib` and `g++-multilib` packages to pick up i386 support. -You need to install the `libncurses5-dev` and `lib32ncurses5-dev` package to pick up the ncurses header files and i386 version. Also worth installing the `ncurses-doc` package too. +You need to install the `lib32ncurses5-dev` package to pick up the ncurses i386 version. + +To build, include `-Pmultiarch` on the command-line. ### Windows