Bladeren bron

Add switch-to-latest-gcc

master
Ray Burgemeestre 1 jaar geleden
bovenliggende
commit
5d97c67e05
3 gewijzigde bestanden met toevoegingen van 19 en 0 verwijderingen
  1. +2
    -0
      Dockerfile-ubuntu2004
  2. +2
    -0
      Dockerfile-ubuntu2204
  3. +15
    -0
      switch-to-latest-gcc

+ 2
- 0
Dockerfile-ubuntu2004 Bestand weergeven

RUN cp -prv /usr/lib/llvm-12/lib/libunwind.so.1.0 /usr/lib/llvm-12/lib/libunwind.so RUN cp -prv /usr/lib/llvm-12/lib/libunwind.so.1.0 /usr/lib/llvm-12/lib/libunwind.so


COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc


RUN chmod +x /usr/local/bin/switch-to-latest-clang RUN chmod +x /usr/local/bin/switch-to-latest-clang
RUN chmod +x /usr/local/bin/switch-to-latest-gcc


RUN apt clean RUN apt clean



+ 2
- 0
Dockerfile-ubuntu2204 Bestand weergeven

RUN apt install -y mold RUN apt install -y mold


COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc


RUN chmod +x /usr/local/bin/switch-to-latest-clang RUN chmod +x /usr/local/bin/switch-to-latest-clang
RUN chmod +x /usr/local/bin/switch-to-latest-gcc


RUN apt clean RUN apt clean



+ 15
- 0
switch-to-latest-gcc Bestand weergeven

#!/bin/bash

set +e
set -o pipefail

# Assuming g++ and gcc are located in /usr/bin/
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 50 > /tmp/.switch-to-g++.stdout
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 50 >> /tmp/.switch-to-g++.stdout
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++ 50 >> /tmp/.switch-to-g++.stdout
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc 50 >> /tmp/.switch-to-g++.stdout
# You might also want to update ld, depending on your requirements
# update-alternatives --install /usr/bin/ld ld /path/to/your/ld 50 >> /tmp/.switch-to-g++.stdout

echo "Compiler set to: $(readlink /etc/alternatives/c++)"


Laden…
Annuleren
Opslaan