Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

16 lines
678B

  1. #!/bin/bash
  2. set +e
  3. set -o pipefail
  4. # Assuming g++ and gcc are located in /usr/bin/
  5. update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 50 > /tmp/.switch-to-g++.stdout
  6. update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 50 >> /tmp/.switch-to-g++.stdout
  7. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++ 50 >> /tmp/.switch-to-g++.stdout
  8. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc 50 >> /tmp/.switch-to-g++.stdout
  9. # You might also want to update ld, depending on your requirements
  10. # update-alternatives --install /usr/bin/ld ld /path/to/your/ld 50 >> /tmp/.switch-to-g++.stdout
  11. echo "Compiler set to: $(readlink /etc/alternatives/c++)"