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.

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