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.

123 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)
  60. echo_status "This package does not utilize a C library ..."
  61. ;;
  62. linux*)
  63. echo_status "This package is currently blacklisted and not build using dietlibc!"
  64. ;;
  65. util-linux|e2fsprogs|net-tools) # the packets that have BSD problems and/or GNU problems
  66. echo_status "Setting dietlibc special GNU/BSD settings!"
  67. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  68. var_append CC_WRAPPER_INSERT " " "-D_GNU_SOURCE"
  69. var_append CC_WRAPPER_OTHERS ":" $dietbin
  70. ;;
  71. sed)
  72. echo_status "Setting dietlibc special lcompat settings!"
  73. var_append CC_WRAPPER_APPEND_PO " " "-lcompat"
  74. var_append CC_WRAPPER_OTHERS ":" $dietbin
  75. ;;
  76. coreutils)
  77. echo_status "Setting dietlibc special lcompat+BSD settings!"
  78. var_append CC_WRAPPER_APPEND_PO " " "-lcompat"
  79. var_append CC_WRAPPER_INSERT " " "-D_BSD_SOURCE"
  80. var_append CC_WRAPPER_OTHERS ":" $dietbin
  81. ;;
  82. iproute2)
  83. echo_status "Allowing default headers from /usr/include!"
  84. var_append CC_WRAPPER_OTHERS ":" $dietbin
  85. # needs to be last since otherwise the (g)libc headers
  86. # in /usr/include would be used instead of the dietlibc
  87. # ones ... - so append instead insert.
  88. var_append CC_WRAPPER_APPEND " " "-I$root/usr/include"
  89. var_append CC_WRAPPER_INSERT " " "-I/usr/dietlibc/include"
  90. ;;
  91. *)
  92. echo_status "Using default dietlibc compiler options!"
  93. var_append CC_WRAPPER_OTHERS ":" $dietbin
  94. ;;
  95. esac
  96. case "$pkg" in
  97. coreutils)
  98. var_remove patchfiles " " "*acl-xattr.patch"
  99. ;;
  100. esac
  101. var_append patchfiles " " `ls $base/package/base/dietlibc/pkg_patch/pkg_$pkg.patch 2>/dev/null`
  102. fi