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.

119 lines
4.0 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 - 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. if [ "$ROCKCFG_DIETLIBC_ALL" = 1 -o "$pkg" = "dietlibc" ]; then
  23. pkg_dietlibc_useit=1
  24. else
  25. x="${pkg//-/_}" ; x="${x//+/_}"
  26. eval "pkg_dietlibc_useit=\$ROCKCFG_DIETLIBC_${x}"
  27. fi
  28. [ "$pkg_dietlibc_useit" != 1 ] && pkg_dietlibc_useit=0
  29. [ "$stagelevel" -eq 0 ] && pkg_dietlibc_useit=0
  30. if [ "$pkg_dietlibc_useit" = 1 ]; then
  31. # If we use something like 'i386-pc-linux-gnu' as architecture name,
  32. # some programs start using gnu extensions. So we use ..-gnulibc1
  33. # instead.
  34. #
  35. pkg_dietlibc_orig_target="$arch_target"
  36. arch_target="${arch_target}libc1"
  37. [ $ROCKCFG_CROSSBUILD = 0 ] && arch_build="${arch_target}"
  38. if [ -d $base/build/$ROCKCFG_ID/$toolsdir/diet-bin ] ; then
  39. PATH="$base/build/$ROCKCFG_ID/$toolsdir/diet-bin:$PATH"
  40. fi
  41. if [ "$ROCKCFG_DIETLIBC_DYN" = "1" ]
  42. then dietbin="diet-dyn" ; x="dynamically"
  43. else dietbin="diet" ; x="statically" ; fi
  44. echo_status "Preparing configuration to build this package with dietlibc ($x)."
  45. if [ "$stagelevel" -le 1 ]; then
  46. # all dietlibc pathes are redirected into the build system
  47. var_insert CC_WRAPPER_FILTER "|" "sed -e 's,/usr/dietlibc/,$root&,'"
  48. # else
  49. # var_remove CC_WRAPPER_INSERT " " "-pipe" ;
  50. # var_append CC_WRAPPER_REMOVE " " "-pipe" ;
  51. # var_remove GCC_WRAPPER_INSERT " " "-pipe" ;
  52. # var_append GCC_WRAPPER_REMOVE " " "-pipe" ;
  53. # patchopt="-bf -p1 -x 16 -z .orig" ;
  54. # var_append CC_WRAPPER_INSERT " " "-L/usr/i386-pc-linux-gnulibc1/lib"
  55. fi
  56. # use dietlibc headers instead of system defaults
  57. var_append CC_WRAPPER_INSERT " " "-nostdinc"
  58. case "$pkg" in
  59. dietlibc|linux*)
  60. echo_status "This package is currently blacklisted and not build using dietlibc!"
  61. ;;
  62. util-linux|e2fsprogs|net-tools) # the packets that have BSD problems and/or GNU problems
  63. echo_status "Setting dietlibc special GNU/BSD settings!"
  64. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  65. var_append CC_WRAPPER_INSERT " " "-D_GNU_SOURCE"
  66. var_append CC_WRAPPER_OTHERS ":" $dietbin
  67. ;;
  68. sed)
  69. echo_status "Setting dietlibc special lcompat settings!"
  70. var_append CC_WRAPPER_APPEND_PO " " "-lcompat"
  71. var_append CC_WRAPPER_OTHERS ":" $dietbin
  72. ;;
  73. coreutils)
  74. echo_status "Setting dietlibc special lcompat+BSD settings!"
  75. var_append CC_WRAPPER_APPEND_PO " " "-lcompat"
  76. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  77. var_append CC_WRAPPER_OTHERS ":" $dietbin
  78. ;;
  79. iproute2)
  80. echo_status "Allowing default headers from /usr/include!"
  81. var_append CC_WRAPPER_OTHERS ":" $dietbin
  82. # needs to be last since otherwise the (g)libc headers
  83. # in /usr/include would be used instead of the dietlibc
  84. # ones ... - so append instead insert.
  85. var_append CC_WRAPPER_APPEND " " "-I$root/usr/include"
  86. var_append CC_WRAPPER_INSERT " " "-I/usr/dietlibc/include"
  87. ;;
  88. *)
  89. echo_status "Using default dietlibc compiler options!"
  90. var_append CC_WRAPPER_OTHERS ":" $dietbin
  91. ;;
  92. esac
  93. case "$pkg" in
  94. coreutils)
  95. var_remove patchfiles " " "*acl-xattr.patch"
  96. ;;
  97. esac
  98. var_append patchfiles " " `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.patch 2>/dev/null`
  99. fi