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.

161 lines
5.1 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. 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//+/_}"
  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. if [ "$stagelevel" -gt 1 ]; then
  70. var_remove CC_WRAPPER_INSERT " " "-pipe" ;
  71. var_append CC_WRAPPER_REMOVE " " "-pipe" ;
  72. var_remove GCC_WRAPPER_INSERT " " "-pipe" ;
  73. var_append GCC_WRAPPER_REMOVE " " "-pipe" ;
  74. var_remove KCC_WRAPPER_INSERT " " "-pipe" ;
  75. var_append KCC_WRAPPER_REMOVE " " "-pipe" ;
  76. fi
  77. # patch has problems with Plan A patching so we switch with -x 16 to Plan B
  78. [ "$stagelevel" -ge 9 ] && patchopt="-bfp1 -x 16 -z .orig"
  79. case "$pkg" in
  80. dietlibc)
  81. echo_status "This package does not utilize a C library ..."
  82. ;;
  83. linux*)
  84. echo_status "This package is currently blacklisted and not build using dietlibc!"
  85. [ "$stagelevel" -gt 1 -a "$diet_dynamic_static" == "static" ] && \
  86. var_append GCC_WRAPPER_INSERT " " "-static"
  87. ;;
  88. e2fsprogs|util-linux|net-tools)
  89. # the packets that have BSD problems and/or GNU problems
  90. echo_status "Setting dietlibc special GNU/BSD settings!"
  91. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  92. var_append CC_WRAPPER_INSERT " " "-D_GNU_SOURCE"
  93. set_wrapper_and_misc
  94. ;;
  95. sed|lilo)
  96. echo_status "Setting dietlibc special lcompat settings!"
  97. add_lib "-lcompat"
  98. set_wrapper_and_misc
  99. ;;
  100. coreutils|findutils)
  101. echo_status "Setting dietlibc special lcompat+BSD settings!"
  102. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  103. add_lib "-lcompat"
  104. set_wrapper_and_misc
  105. ;;
  106. *)
  107. echo_status "Using default dietlibc compiler options!"
  108. set_wrapper_and_misc
  109. ;;
  110. esac
  111. case "$pkg" in
  112. coreutils)
  113. var_remove patchfiles " " "*acl-xattr.patch"
  114. ;;
  115. curl)
  116. [ "$diet_dynamic_static" == "static" ] && \
  117. var_append extraconfopt " " "--disable-shared"
  118. ;;
  119. ncurses)
  120. var_append extraconfopt " " \
  121. "--without-cxx-binding --without-cxx"
  122. ;;
  123. util-linux)
  124. add_lib "-lrpc"
  125. add_lib "-lcompat"
  126. ;;
  127. dump)
  128. var_append extraconfopt " " "--disable-rmt"
  129. ;;
  130. perl5)
  131. add_lib "-lm -lcompat"
  132. ;;
  133. esac
  134. var_append patchfiles " " \
  135. `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.patch 2>/dev/null`
  136. [ "$stagelevel" -ge 1 -a "$ROCKCFG_DIETLIBC_ALL" = "1" ] && \
  137. var_append patchfiles " " \
  138. `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.chroot.patch 2>/dev/null`
  139. fi