2017-04-26 21:21:27 +02:00
|
|
|
# crosstool.common
|
|
|
|
#
|
|
|
|
# Common Docker instructions to install "crosstool-ng" and build a full
|
|
|
|
# cross-compiler suite from a crosstool-ng configuration, CROSSTOOL_CONFIG.
|
|
|
|
#
|
|
|
|
# This import complements the "dockcross/base" image, adding:
|
|
|
|
# - "ct-ng", a cross-compiler building utilty.
|
|
|
|
# - A cross-compiler suite configured in "crosstool-ng.config".
|
|
|
|
#
|
|
|
|
# The generated cross-compiler will have a CROSS_ROOT of:
|
|
|
|
# ${XCC_PREFIX}/${CROSS_TRIPLE}
|
|
|
|
#
|
|
|
|
# A given platform will need to supply the appropriate "crosstool-ng.config" to
|
|
|
|
# generate its cross-compiler. This can be built using "ct-ng menuconfig" to
|
|
|
|
# generate a configuration.
|
|
|
|
|
|
|
|
# Install Debian packages required for `ct-ng`.
|
|
|
|
RUN apt-get update --yes && apt-get install --no-install-recommends --yes \
|
2021-06-24 22:57:41 +02:00
|
|
|
gawk \
|
|
|
|
gperf \
|
|
|
|
help2man \
|
|
|
|
python3-dev \
|
|
|
|
texinfo \
|
2021-06-26 15:32:45 +02:00
|
|
|
# Packages needed for crosstool-ng 1.24 or higher
|
|
|
|
unzip \
|
|
|
|
libtool \
|
|
|
|
libtool-bin \
|
2021-06-24 22:57:41 +02:00
|
|
|
&& apt-get clean autoclean --yes \
|
|
|
|
&& apt-get autoremove --yes \
|
|
|
|
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
|
2017-04-26 21:21:27 +02:00
|
|
|
|
|
|
|
ENV XCC_PREFIX=/usr/xcc
|
|
|
|
|
|
|
|
# Add the crosstool-ng script and image-specific toolchain configuration into
|
|
|
|
# /dockcross/.
|
|
|
|
#
|
|
|
|
# Afterwards, we will leave the "ct-ng" config in the image as a reference
|
|
|
|
# for users.
|
|
|
|
COPY \
|
|
|
|
imagefiles/install-crosstool-ng-toolchain.sh \
|
2023-01-30 08:26:57 +01:00
|
|
|
imagefiles/patch/crosstool-ng/crosstool-ng-zlib-target.patch \
|
2017-04-26 21:21:27 +02:00
|
|
|
crosstool-ng.config \
|
|
|
|
/dockcross/
|
|
|
|
|
|
|
|
# Build and install the toolchain, cleaning up artifacts afterwards.
|
|
|
|
RUN mkdir /dockcross/crosstool \
|
|
|
|
&& cd /dockcross/crosstool \
|
|
|
|
&& /dockcross/install-crosstool-ng-toolchain.sh \
|
|
|
|
-p "${XCC_PREFIX}" \
|
2021-08-08 22:09:24 +02:00
|
|
|
-c "/dockcross/crosstool-ng.config" \
|
2021-06-23 14:53:33 +02:00
|
|
|
-v "${CT_VERSION}" \
|
2017-04-26 21:21:27 +02:00
|
|
|
&& rm -rf /dockcross/crosstool /dockcross/install-crosstool-ng-toolchain.sh
|
|
|
|
|
|
|
|
# Restore our default workdir (from "dockcross/base").
|
|
|
|
WORKDIR /work
|