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.

166 lines
5.3 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/dietlibc/parse-config-9
  9. # ROCK Linux is Copyright (C) 1998 - 2005 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. # --- FUNCTIONS-BEGIN ---
  23. function set_wrapper_and_misc () {
  24. var_append CC_WRAPPER_INSERT " " "-idirafter $root/usr/include"
  25. hook_add preconf 8 'echo ac_cv_header_wchar_h=no >> config.cache'
  26. hook_add preconf 8 'echo ac_cv_header_wctype_h=no >> config.cache'
  27. hook_add preconf 8 'echo ac_cv_func_clock_gettime=no >> config.cache'
  28. if [ "$stagelevel" -le 1 -o "$ROCKCFG_DIETLIBC_ALL" -ne 1 ] ; then
  29. var_append CC_WRAPPER_INSERT " " "-nostdinc"
  30. # all dietlibc pathes are redirected into the build system
  31. var_insert CC_WRAPPER_FILTER "|" "sed -e 's,/usr/dietlibc/,$root&,'"
  32. var_append CC_WRAPPER_OTHERS ":" $dietbin
  33. else
  34. if [ "$diet_dynamic_static" == "static" ] ; then
  35. var_append GCC_WRAPPER_INSERT " " "-static"
  36. fi
  37. var_append GCC_WRAPPER_INSERT " " "-D__dietlibc__"
  38. fi
  39. }
  40. function add_lib () {
  41. if [ "$stagelevel" -le 1 ] ; then var_append CC_WRAPPER_APPEND_PO " " "$1"
  42. else var_append CC_WRAPPER_APPEND " " "$1"; fi
  43. }
  44. # --- FUNCTIONS-END --
  45. # decide wether to compile the packet with dietlibc or not
  46. if [ "$ROCKCFG_DIETLIBC_ALL" = 1 -o "$pkg" = "dietlibc" ]; then
  47. pkg_dietlibc_useit=1
  48. else
  49. x="${pkg//-/_}" ; x="${x//+/_}" ; x="${x#*=}"
  50. eval "pkg_dietlibc_useit=\$ROCKCFG_DIETLIBC_${x}"
  51. fi
  52. [ "$pkg_dietlibc_useit" != 1 ] && pkg_dietlibc_useit=0
  53. [ "$stagelevel" -eq 0 ] && pkg_dietlibc_useit=0 # never use dietlibc in stage 0
  54. if [ "$pkg_dietlibc_useit" = 1 ]; then
  55. # If we use something like 'i386-pc-linux-gnu' as architecture name,
  56. # some programs start using gnu extensions. So we use ..-gnulibc1
  57. # instead.
  58. #
  59. pkg_dietlibc_orig_target="$arch_target"
  60. arch_target="${arch_target}libc1"
  61. [ $ROCKCFG_CROSSBUILD = 0 ] && arch_build="${arch_target}"
  62. if [ -d $base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-bin ] ; then
  63. PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-bin:$PATH"
  64. fi
  65. if [ "$ROCKCFG_DIETLIBC_DYN" = "1" ]
  66. then dietbin="diet-dyn" ; diet_dynamic_static="dynamic"
  67. else dietbin="diet" ; diet_dynamic_static="static" ; fi
  68. echo_status "Preparing configuration to build this package with dietlibc ("${diet_dynamic_static}"ally)."
  69. # dietlibc-sparc32 depends on -msupersparc output
  70. if [ "$arch" = "sparc" -a "$ROCKCFG_SPARC_BITS" = "32" ] ; then
  71. var_append GCC_WRAPPER_INSERT " " "-mcpu=supersparc" ;
  72. fi ;
  73. if [ "$stagelevel" -gt 1 ]; then
  74. var_remove CC_WRAPPER_INSERT " " "-pipe" ;
  75. var_append CC_WRAPPER_REMOVE " " "-pipe" ;
  76. var_remove GCC_WRAPPER_INSERT " " "-pipe" ;
  77. var_append GCC_WRAPPER_REMOVE " " "-pipe" ;
  78. var_remove KCC_WRAPPER_INSERT " " "-pipe" ;
  79. var_append KCC_WRAPPER_REMOVE " " "-pipe" ;
  80. fi
  81. # patch has problems with Plan A patching so we switch with -x 16 to Plan B
  82. [ "$stagelevel" -ge 9 ] && patchopt="-bfp1 -x 16 -z .orig"
  83. case "$pkg" in
  84. dietlibc)
  85. echo_status "This package does not utilize a C library ..."
  86. ;;
  87. linux*)
  88. echo_status "This package is currently blacklisted and not build using dietlibc!"
  89. [ "$stagelevel" -gt 1 -a "$diet_dynamic_static" == "static" ] && \
  90. var_append GCC_WRAPPER_INSERT " " "-static"
  91. ;;
  92. e2fsprogs|util-linux|net-tools)
  93. # the packets that have BSD problems and/or GNU problems
  94. echo_status "Setting dietlibc special GNU/BSD settings!"
  95. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  96. var_append CC_WRAPPER_INSERT " " "-D_GNU_SOURCE"
  97. set_wrapper_and_misc
  98. ;;
  99. sed|lilo)
  100. echo_status "Setting dietlibc special lcompat settings!"
  101. add_lib "-lcompat"
  102. set_wrapper_and_misc
  103. ;;
  104. coreutils|findutils)
  105. echo_status "Setting dietlibc special lcompat+BSD settings!"
  106. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  107. add_lib "-lcompat"
  108. set_wrapper_and_misc
  109. ;;
  110. *)
  111. echo_status "Using default dietlibc compiler options!"
  112. set_wrapper_and_misc
  113. ;;
  114. esac
  115. case "$pkg" in
  116. coreutils)
  117. var_remove patchfiles " " "*acl-xattr.patch"
  118. ;;
  119. curl)
  120. [ "$diet_dynamic_static" == "static" ] && \
  121. var_append extraconfopt " " "--disable-shared"
  122. ;;
  123. ncurses)
  124. var_append extraconfopt " " \
  125. "--without-cxx-binding --without-cxx"
  126. ;;
  127. util-linux)
  128. add_lib "-lrpc"
  129. add_lib "-lcompat"
  130. ;;
  131. dump)
  132. var_append extraconfopt " " "--disable-rmt"
  133. ;;
  134. perl5)
  135. add_lib "-lm -lcompat"
  136. ;;
  137. esac
  138. var_append patchfiles " " \
  139. `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.patch 2>/dev/null`
  140. [ "$stagelevel" -ge 1 -a "$ROCKCFG_DIETLIBC_ALL" = "1" ] && \
  141. var_append patchfiles " " \
  142. `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.chroot.patch 2>/dev/null`
  143. fi