Advertisement
sebbu

make_alternatives.sh

Jul 17th, 2017
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #!/bin/bash
  2. CD=$PWD
  3. NAME1=x86_64-pc-cygwin
  4. NAME2=x86_64-w64-mingw32
  5. NAME3=i686-pc-cygwin
  6. NAME4=i686-w64-mingw32
  7. DIR1=/usr/$NAME1/bin/
  8. DIR2=/usr/$NAME2/bin/
  9. DIR3=/usr/$NAME3/bin/
  10. DIR4=/usr/$NAME4/bin/
  11. BINUTILS="addr2line.exe ar.exe as.exe c++filt.exe dlltool.exe dllwrap.exe elfedit.exe gprof.exe ld.bfd.exe ld.exe nm.exe objcopy.exe objdump.exe ranlib.exe readelf.exe size.exe strings.exe strip.exe windmc.exe windres.exe"
  12. GCC="cc c89 c99 cpp.exe gcc.exe gcc-ar.exe gcc-nm.exe gcc-ranlib.exe gcov.exe gcov-tool.exe c++ g++"
  13. #if false; then
  14.     #binutils gcc g++
  15.     for fic in $BINUTILS $GCC
  16.     do
  17.         echo "$fic"
  18.         if [[ -f $NAME1-$fic ]]
  19.         then
  20.             if [ -f "/usr/bin/$fic" -a ! -L "/usr/bin/$fic" ]
  21.             then
  22.                 rm -i /usr/bin/$fic
  23.             else
  24.                 continue;
  25.             fi;
  26.         fi;
  27.         ln /usr/bin/$fic /usr/bin/$NAME1-$fic
  28.         rm -i /usr/bin/$fic
  29.     done
  30. #fi;
  31. #binutils gcc g++
  32. for fic in $BINUTILS $GCC
  33. do
  34.     name=${fic/.exe}
  35.     echo $name
  36.     alternatives --install /usr/bin/$fic $name /usr/bin/$NAME1-$fic 20
  37.     alternatives --install /usr/bin/$fic $name /usr/bin/$NAME2-$fic 10
  38.     alternatives --install /usr/bin/$fic $name /usr/bin/$NAME3-$fic 10
  39.     alternatives --install /usr/bin/$fic $name /usr/bin/$NAME4-$fic 10
  40. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement