From bd41c2520e70ea3ad953a03487201ac488744834 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 18 May 2015 15:21:05 -0400 Subject: [PATCH] linux-ppc64le: Initial addition based off Debian. --- Makefile | 3 +++ linux-ppc64le/Dockerfile | 21 +++++++++++++++++++++ linux-ppc64le/Toolchain.cmake | 15 +++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 linux-ppc64le/Dockerfile create mode 100644 linux-ppc64le/Toolchain.cmake diff --git a/Makefile b/Makefile index 4286cd3..ea0bd72 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ linux-armv6: base linux-armv6/Dockerfile linux-armv6/Toolchain.cmake linux-armv7: base linux-armv7/Dockerfile linux-armv7/Toolchain.cmake $(DOCKER) build -t $(IMAGE)-linux-armv7 linux-armv7 +linux-ppc64le: base linux-ppc64le/Dockerfile linux-ppc64le/Toolchain.cmake + $(DOCKER) build -t $(IMAGE)-linux-ppc64le linux-ppc64le + windows-x86: base windows-x86/Dockerfile windows-x86/settings.mk $(DOCKER) build -t $(IMAGE)-windows-x86 windows-x86 diff --git a/linux-ppc64le/Dockerfile b/linux-ppc64le/Dockerfile new file mode 100644 index 0000000..0b0140e --- /dev/null +++ b/linux-ppc64le/Dockerfile @@ -0,0 +1,21 @@ +FROM thewtex/cross-compiler-base +MAINTAINER Matt McCormick "matt.mccormick@kitware.com" + +# Add the cross compiler sources +RUN echo "deb http://emdebian.org/tools/debian/ jessie main" >> /etc/apt/sources.list && \ + dpkg --add-architecture ppc64el && \ + curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add - + +RUN apt-get update && apt-get install -y \ + crossbuild-essential-ppc64el \ + gfortran-powerpc64le-linux-gnu \ + qemu-user \ + qemu-user-static + +WORKDIR /usr/src + +# Note: Toolchain file support is currently in debian Experimental according to: +# https://wiki.debian.org/CrossToolchains#In_jessie_.28Debian_8.29 +# We can switch to that when it becomes stable. +COPY Toolchain.cmake /usr/lib/powerpc64le-linux-gnu/ +ENV CMAKE_TOOLCHAIN_FILE /usr/lib/powerpc64le-linux-gnu/Toolchain.cmake diff --git a/linux-ppc64le/Toolchain.cmake b/linux-ppc64le/Toolchain.cmake new file mode 100644 index 0000000..a8f9ba9 --- /dev/null +++ b/linux-ppc64le/Toolchain.cmake @@ -0,0 +1,15 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +set(cross_triple "powerpc64le-linux-gnu") + +set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-cc) +set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++) +set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) + +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_CROSSCOMPILING_EMULATOR /usr/bin/qemu-ppc64le)