mirror of the now-defunct rocklinux.org
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.

75 lines
2.2 KiB

  1. #!/bin/bash
  2. if [ "$ROCKCFG_X86_BITS" = 32 ]
  3. then
  4. case "$ROCKCFG_X86_OPT" in
  5. generic)
  6. # Append options so the gcc -V option always comes first.
  7. var_append GCC_WRAPPER_APPEND " " "-march=i486"
  8. ;;
  9. via-c3)
  10. var_append GCC2_WRAPPER_APPEND " " "-march=k6"
  11. var_append GCC3_WRAPPER_APPEND " " "-march=k62"
  12. var_append GCC4_WRAPPER_APPEND " " "-march=k62"
  13. ;;
  14. via-c3-improved)
  15. var_append GCC_WRAPPER_APPEND " " "-march=i686"
  16. ;;
  17. via-c3-2)
  18. var_append GCC2_WRAPPER_APPEND " " "-march=pentiumpro"
  19. var_append GCC3_WRAPPER_APPEND " " "-march=pentium-mmx"
  20. var_append GCC4_WRAPPER_APPEND " " "-march=pentium-mmx"
  21. ;;
  22. k6*)
  23. var_append GCC2_WRAPPER_APPEND " " "-march=k6"
  24. var_append GCC3_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT"
  25. # workaround and should be removed when gcc 3.x got fixed ...
  26. var_append GCC3_WRAPPER_APPEND " " "-fno-branch-count-reg"
  27. var_append GCC4_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT"
  28. ;;
  29. *)
  30. var_append GCC3_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT"
  31. var_append GCC4_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT"
  32. ;;
  33. esac
  34. case "$ROCKCFG_X86_OPT" in
  35. i486)
  36. var_append GCC2_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" ;;
  37. pentium|pentium-mmx)
  38. var_append GCC2_WRAPPER_APPEND " " "-march=pentium" ;;
  39. pentium*)
  40. var_append GCC2_WRAPPER_APPEND " " "-march=pentiumpro" ;;
  41. athlon*)
  42. var_append GCC2_WRAPPER_APPEND " " "-march=k6" ;;
  43. esac
  44. else
  45. case "$ROCKCFG_X86_OPT" in
  46. generic)
  47. # Other values like i686 or pentiumpro cause a build error in e.g.
  48. # glibc 2.6.1 when building with gcc 4.2.1.
  49. if [[ "$xpkg" = *-32bit ]] ; then
  50. var_append GCC_WRAPPER_APPEND " " "-march=pentium4"
  51. fi
  52. ;;
  53. intel)
  54. var_append GCC2_WRAPPER_APPEND " " "-march=x86_64"
  55. var_append GCC3_WRAPPER_APPEND " " "-march=nocona"
  56. var_append GCC4_WRAPPER_APPEND " " "-march=nocona"
  57. ;;
  58. athlon)
  59. var_append GCC2_WRAPPER_APPEND " " "-march=x86_64"
  60. var_append GCC3_WRAPPER_APPEND " " "-march=k8"
  61. var_append GCC4_WRAPPER_APPEND " " "-march=k8"
  62. ;;
  63. esac
  64. fi
  65. # remove other -march and -mtune options from the argument list
  66. var_insert GCC_WRAPPER_REMOVE " " "-march=* -mtune=*"
  67. # Remove deprecated options:
  68. var_insert GCC_WRAPPER_REMOVE " " "-mcpu=* -m386 -m486 -mpentium -mpentiumpro"