From c274a6254cd39fc98b4b0041dbb54411dc221013 Mon Sep 17 00:00:00 2001 From: doyle Date: Tue, 19 Jul 2022 15:40:33 +1000 Subject: [PATCH] linux stuff --- Installer/unix_gcc_build.sh | 4 ++-- Installer/unix_gcc_dockerfile | 1 + linux_install.sh | 15 ++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Installer/unix_gcc_build.sh b/Installer/unix_gcc_build.sh index 4746e1f..9638b93 100755 --- a/Installer/unix_gcc_build.sh +++ b/Installer/unix_gcc_build.sh @@ -10,11 +10,11 @@ do docker create --name ${container_name} ${image_name} || exit mkdir --parent build || exit - docker cp ${container_name}:/usr/local/docker/gcc-mostlyportable-${gcc_version} . || exit + docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/gcc-mostlyportable-${gcc_version} . || exit docker container rm ${container_name} || exit done if [[ $EUID == 0 ]]; then - chown --recursive ${USER} build + chown --recursive ${USER} gcc-mostlyportable-* fi diff --git a/Installer/unix_gcc_dockerfile b/Installer/unix_gcc_dockerfile index 62895b4..0a71a9f 100644 --- a/Installer/unix_gcc_dockerfile +++ b/Installer/unix_gcc_dockerfile @@ -27,6 +27,7 @@ WORKDIR /usr/local/docker ARG MOSTLY_PORTABLE_GCC_GIT_BRANCH=master RUN set -ex \ && git clone https://github.com/Frogging-Family/mostlyportable-gcc \ + && cd mostlyportable-gcc \ && git checkout $MOSTLY_PORTABLE_GIT_BRANCH ARG GCC_VERSION=11.3.0 diff --git a/linux_install.sh b/linux_install.sh index d132536..6b4b1f4 100755 --- a/linux_install.sh +++ b/linux_install.sh @@ -53,6 +53,11 @@ mkdir --parents ${bin_dir} # Tools # ------------------------------------------------------------------------------ +if ! command -v docker &> /dev/null +then + curl -fsSL https://get.docker.com -o get-docker.sh + sudo sh get-docker.sh +fi # CMake # ---------------------------------------------------------------------------- @@ -112,15 +117,15 @@ cp "${installer_dir}/unix_gcc_dockerfile" "${gcc_dir}/Dockerfile" cd "${gcc_dir}" || exit for gcc_version in ${gcc_version_list[@]}; do - gcc_bin_dir=${gcc_dir} + gcc_bin_dir=${gcc_dir}/gcc-mostlyportable-${gcc_version}/bin if [[ ! -f "${gcc_bin_dir}/g++" ]]; then ./build.sh ${gcc_version} || exit - ln -s ${gcc_bin_dir}/g++ ${bin_dir}/g++-${gcc_version} || exit - ln -s ${gcc_bin_dir}/gcc ${bin_dir}/gcc-${gcc_version} || exit fi + ln --symbolic --force --relative ${gcc_bin_dir}/g++ ${bin_dir}/g++-${gcc_version} || exit + ln --symbolic --force --relative ${gcc_bin_dir}/gcc ${bin_dir}/gcc-${gcc_version} || exit done - ln -s ${gcc_bin_dir}/g++ ${bin_dir}/g++ || exit - ln -s ${gcc_bin_dir}/gcc ${bin_dir}/gcc || exit + ln --symbolic --force --relative "${gcc_bin_dir}/g++" "${bin_dir}/g++" || exit + ln --symbolic --force --relative "${gcc_bin_dir}/gcc" "${bin_dir}/gcc" || exit cd "${root_dir}" || exit # LLVM/Clang