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.

111 lines
3.4 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/gcc3/parse-config
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # Use the GCC-[23] stack protector patch
  23. #
  24. if [ $pkg != glibc23 -a $pkg != glibc22 -a \
  25. $pkg != grub -a $pkg != dietlibc ]
  26. then
  27. if [ "$ROCKCFG_PKG_GCC2_STACKPRO" = 1 ] ; then
  28. var_append GCC2_WRAPPER_INSERT " " "-fstack-protector"
  29. fi
  30. if [ "$ROCKCFG_DEFAULT_CC" = "gcc3" -a "$ROCKCFG_PKG_GCC3_STACKPRO" = 1 ] ; then
  31. var_append GCC3_WRAPPER_INSERT " " "-fstack-protector"
  32. fi
  33. if [ "$ROCKCFG_DEFAULT_CC" = "gcc33" -a "$ROCKCFG_PKG_GCC33_STACKPRO" = 1 ] ; then
  34. var_append GCC3_WRAPPER_INSERT " " "-fstack-protector"
  35. fi
  36. fi
  37. # maybe we add something more later. But imo it's better to
  38. # let the options of KCC unmodified for gcc[23]. (Clifford)
  39. #
  40. if [[ $ROCKCFG_DEFAULT_KCC = gcc* ]] ; then
  41. export KCC="${archprefix}kcc-${ROCKCFG_DEFAULT_KCC#gcc}"
  42. if [ "$ROCKCFG_OPTSIZE" = 1 ] ; then
  43. var_insert KCC_WRAPPER_REMOVE " " "-O -O[0-9]"
  44. var_insert KCC_WRAPPER_INSERT " " "-Os"
  45. fi
  46. fi
  47. # set CC, CXX and F77 environment variables
  48. #
  49. for x in CC CXX F77 ; do
  50. eval "y=\$ROCKCFG_DEFAULT_$x"
  51. if [[ $y = gcc* ]] ; then
  52. case "$x-$stagelevel" in
  53. CC-*)
  54. z="${archprefix}gcc ${archprefix}gcc-${y#gcc}" ;;
  55. CXX-[2-9])
  56. z="${archprefix}g++ ${archprefix}g++-${y#gcc}" ;;
  57. F77-[2-9])
  58. z="${archprefix}g77 ${archprefix}g77-${y#gcc}" ;;
  59. *)
  60. export $x=${x}_not_available_in_stage_${stagelevel}
  61. continue ;;
  62. esac
  63. for y in $z ; do
  64. [ "`type -p $y`" ] && export $x=$y
  65. done
  66. fi
  67. done
  68. # Add the usual gcc optimazation options
  69. #
  70. if [ "$ROCKCFG_OPTSIZE" = 1 ] ; then
  71. var_insert GCC_WRAPPER_REMOVE " " "-O -O[0-9] -m*"
  72. var_insert GCC_WRAPPER_INSERT " " "-Os -pipe"
  73. else
  74. var_insert GCC_WRAPPER_REMOVE " " "-O -O[01s] -m*"
  75. var_insert GCC_WRAPPER_INSERT " " "-O2 -pipe"
  76. fi
  77. # Strip or add debug information
  78. #
  79. if [ "$ROCKCFG_STRIP" != 0 ] ; then
  80. var_append GCC_WRAPPER_APPEND " " "-s"
  81. var_insert GCC_WRAPPER_REMOVE " " "-g*"
  82. else
  83. if [[ $pkg != glibc* ]] ; then
  84. var_append GCC_WRAPPER_APPEND " " "-ggdb"
  85. var_insert GCC_WRAPPER_REMOVE " " "-s -g*"
  86. fi
  87. fi
  88. # Compile with no exceptions or rtti; gcc itself must support both
  89. #
  90. if [ "$ROCKCFG_LIMITCXX" = 1 ] && [[ $pkg != gcc* ]] ; then
  91. var_append CXX_WRAPPER_APPEND " " "-fno-exceptions -fno-rtti"
  92. fi
  93. # Passing -I/usr{/local/}include creates a warning in gcc3 which is confusing
  94. # some of the configure scripts and Makefiles.
  95. #
  96. var_insert GCC3_WRAPPER_REMOVE " " "-I/usr/include"
  97. var_insert GCC3_WRAPPER_REMOVE " " "-I/usr/local/include"
  98. # Add the architecture gcc optimazation options
  99. #
  100. if [ -f architecture/$arch/gcc-options ] ; then
  101. . architecture/$arch/gcc-options
  102. fi