add MXE_TARGET_LINK option to distinguish static and shared windows builds

This commit is contained in:
Stanley F 2018-10-08 14:34:13 +02:00
parent 298f75a608
commit c2d0203a3c
4 changed files with 10 additions and 5 deletions

View File

@ -5,18 +5,20 @@
# WINEARCH environment variable to either "win64" or "win32" # WINEARCH environment variable to either "win64" or "win32"
# MXE_TARGET_ARCH argument to either "x86_64" or "i686". See http://mxe.cc/ # MXE_TARGET_ARCH argument to either "x86_64" or "i686". See http://mxe.cc/
# MXE_TARGET_THREAD argument to either "" or ".posix". Default is win32. See http://mxe.cc/ # MXE_TARGET_THREAD argument to either "" or ".posix". Default is win32. See http://mxe.cc/
# MXE_TARGET_LINK argument to either "static" or "shared"
# #
# For example: # For example:
# #
# ENV WINEARCH win64 # ENV WINEARCH win64
# ARG MXE_TARGET_ARCH=x86_64 # ARG MXE_TARGET_ARCH=x86_64
# ARG MXE_TARGET_THREAD= # ARG MXE_TARGET_THREAD=
# ARG MXE_TARGET_LINK=shared
# #
# mxe master 2019-02-27 # mxe master 2019-02-27
ARG MXE_GIT_TAG=2ce5587c94fc355b2c826c786a3ee018479d88d1 ARG MXE_GIT_TAG=2ce5587c94fc355b2c826c786a3ee018479d88d1
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/${MXE_TARGET_ARCH}-w64-mingw32.static${MXE_TARGET_THREAD}/share/cmake/mxe-conf.cmake ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}/share/cmake/mxe-conf.cmake
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
@ -84,7 +86,7 @@ RUN \
# Configure "settings.mk" required to build MXE # Configure "settings.mk" required to build MXE
# #
cd /usr/src/mxe && \ cd /usr/src/mxe && \
echo "MXE_TARGETS := ${MXE_TARGET_ARCH}-w64-mingw32.static${MXE_TARGET_THREAD}" > settings.mk && \ echo "MXE_TARGETS := ${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}" > settings.mk && \
echo "LOCAL_PKG_LIST := cc cmake" >> settings.mk && \ echo "LOCAL_PKG_LIST := cc cmake" >> settings.mk && \
echo ".DEFAULT local-pkg-list:" >> settings.mk && \ echo ".DEFAULT local-pkg-list:" >> settings.mk && \
echo "local-pkg-list: \$(LOCAL_PKG_LIST)" >> settings.mk && \ echo "local-pkg-list: \$(LOCAL_PKG_LIST)" >> settings.mk && \
@ -107,11 +109,11 @@ RUN \
# #
cd /usr/bin && \ cd /usr/bin && \
rm cmake cpack && \ rm cmake cpack && \
ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.static${MXE_TARGET_THREAD}-cmake cmake && \ ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}-cmake cmake && \
ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.static${MXE_TARGET_THREAD}-cpack cpack ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}-cpack cpack
ENV PATH ${PATH}:/usr/src/mxe/usr/bin ENV PATH ${PATH}:/usr/src/mxe/usr/bin
ENV CROSS_TRIPLE ${MXE_TARGET_ARCH}-w64-mingw32.static${MXE_TARGET_THREAD} ENV CROSS_TRIPLE ${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}
ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \ ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
AR=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ar \ AR=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ar \
CC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gcc \ CC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gcc \

View File

@ -4,6 +4,7 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
ENV WINEARCH win64 ENV WINEARCH win64
ARG MXE_TARGET_ARCH=x86_64 ARG MXE_TARGET_ARCH=x86_64
ARG MXE_TARGET_THREAD=.posix ARG MXE_TARGET_THREAD=.posix
ARG MXE_TARGET_LINK=static
#include "common.windows" #include "common.windows"

View File

@ -4,6 +4,7 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
ENV WINEARCH win64 ENV WINEARCH win64
ARG MXE_TARGET_ARCH=x86_64 ARG MXE_TARGET_ARCH=x86_64
ARG MXE_TARGET_THREAD= ARG MXE_TARGET_THREAD=
ARG MXE_TARGET_LINK=static
#include "common.windows" #include "common.windows"

View File

@ -4,6 +4,7 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
ENV WINEARCH win32 ENV WINEARCH win32
ARG MXE_TARGET_ARCH=i686 ARG MXE_TARGET_ARCH=i686
ARG MXE_TARGET_THREAD= ARG MXE_TARGET_THREAD=
ARG MXE_TARGET_LINK=static
#include "common.windows" #include "common.windows"