android-arm: Update toolchain and provide Toolchain.cmake.

This commit is contained in:
Matt McCormick 2015-05-16 13:36:10 -04:00
parent 8876244731
commit f3b2cbb199
3 changed files with 36 additions and 18 deletions

View File

@ -1,8 +1,8 @@
DOCKER = docker
IMAGE = thewtex/cross-compiler
android-arm:
$(DOCKER) build -t $(IMAGE)-android-arm linux-arm
android-arm: base android-arm/Dockerfile
$(DOCKER) build -t $(IMAGE)-android-arm android-arm
darwin-x64:
$(DOCKER) build -t $(IMAGE)-darwin-x64 darwin-x64

View File

@ -1,26 +1,29 @@
FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com"
FROM thewtex/cross-compiler-base
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
RUN apt-get update && apt-get -y --force-yes install \
bash \
curl \
pkg-config \
build-essential \
file \
tar xz-utils bzip2 gzip sed
# The cross-compiling emulator
RUN apt-get update && apt-get install -y \
qemu-user \
qemu-user-static
ENV CROSS_TRIPLE arm-linux-androideabi
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH}
ENV ANDROID_NDK_REVISION 10e
RUN mkdir -p /build && \
cd /build && \
curl -L http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86_64.tar.bz2 | tar xvj && \
cd /build/android-ndk-r10b && \
/bin/bash ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=${CROSS_ROOT} && \
curl -O http://dl.google.com/android/ndk/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.bin && \
chmod +x ./android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.bin && \
./android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.bin && \
cd /build/android-ndk-r${ANDROID_NDK_REVISION} && \
/bin/bash ./build/tools/make-standalone-toolchain.sh \
--arch=arm \
--system=linux-x86_64 \
--ndk-dir=/build/android-ndk-r${ANDROID_NDK_REVISION} \
--platform=android-14 \
--install-dir=${CROSS_ROOT} && \
cd / && \
rm -rf /build
RUN cd ${CROSS_ROOT}/bin && \
ln -s ${CROSS_TRIPLE}-gcc ${CROSS_TRIPLE}-cc
COPY Toolchain.cmake /${CROSS_ROOT}/
ENV CMAKE_TOOLCHAIN_FILE /${CROSS_ROOT}/Toolchain.cmake

View File

@ -0,0 +1,15 @@
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 1)
set(cross_triple arm-linux-androideabi)
set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc)
set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++)
set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_SYSROOT /usr/${cross_triple}/sysroot)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm)