OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../gcc/wrappers.in
  6. # Copyright (C) 2009 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. gcc_build_wrapper() {
  18. local x="$1" y z ; shift
  19. local p="$1" ; shift
  20. for y ; do
  21. local ver=`$y -dumpversion 2> /dev/null`
  22. [ $? != 0 ] && continue
  23. [ "$x" != "$p" ] && z="$x,$p" || z="$x"
  24. case "$ver" in
  25. 2.*) z="$z,${p}2" ;;
  26. 3.*) z="$z,${p}3" ;;
  27. 4.*) z="$z,${p}4" ;;
  28. *) continue ;;
  29. esac
  30. if [ $x = KCC ] ; then
  31. build_wrapper $x $y
  32. else
  33. build_wrapper $z $y
  34. fi
  35. done
  36. }
  37. gcc_build_wrapper CC GCC ${arch_target}-cc ${arch_target}-gcc{-2,-3,-33,-x,}
  38. gcc_build_wrapper CPP CPP ${arch_target}-cpp
  39. gcc_build_wrapper CXX GCC ${arch_target}-c++ ${arch_target}-g++
  40. gcc_build_wrapper KCC GCC ${arch_target}-kcc{-2,-3,-33,-x,}
  41. if atstage native || [ "$SDECFG_USE_CROSSCC" = 0 ] ; then
  42. gcc_build_wrapper CC GCC cc gcc{-2,-3,-33,-x,}
  43. gcc_build_wrapper CXX GCC {c,g}++{-2,-3,-33,-x,}
  44. gcc_build_wrapper F77 GCC {g,f}77{-2,-3,-33,-x,}
  45. gcc_build_wrapper KCC GCC kcc{-2,-3,-33,-x,}
  46. gcc_build_wrapper CPP CPP cpp{-2,-3,-33,-x,}
  47. else
  48. # system compiler used in stage 0 - mostly for ccache
  49. gcc_build_wrapper SYSCC SYSGCC {,g}cc
  50. gcc_build_wrapper SYSCXX SYSGCC {c,g}++
  51. gcc_build_wrapper SYSCPP SYSCPP cpp
  52. fi