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.

111 lines
3.4 KiB

  1. #!/bin/bash
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/package/base/dietlibc/dietlibc.conf
  10. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  23. dietlibc_stage0() {
  24. rm -rf $toolsinc
  25. cp -rv include $toolsinc
  26. }
  27. dietlibc_main() {
  28. if [ $toolsdir = tools.cross ] ; then
  29. rm -rf $toolsbin; mkdir -p $toolsbin
  30. for x in gcc as ld ar ranlib nm ; do
  31. cat > $toolsbin/${arch_target}-$x << EOT
  32. #!/bin/sh
  33. PATH=\${PATH/\$(dirname \$( type -p \$0 ))/}; PATH=\${PATH/::/:}
  34. exec ${pkg_dietlibc_orig_target}-$x
  35. EOT
  36. chmod +x $toolsbin/${arch_target}-$x
  37. done
  38. fi
  39. # special features
  40. if ! [ "$ROCKCFG_DIETWANT_SYSENTER" = "1" ]; then
  41. sed -i "s,^#define WANT_SYSENTER$,/*\0*/," dietfeatures.h
  42. fi
  43. if [ $arch = "powerpc" ] ; then
  44. ln -s bin-ppc bin-powerpc
  45. fi
  46. # build package
  47. if [ "$crossnative" = native ] ; then
  48. # dietlibc uses uname - so we always need to set MYARCH
  49. eval "$MAKE MYARCH=$cpu $makeopt CC='$CC'"
  50. if [ $toolsdir = tools.cross ] ; then
  51. cp -v `ls bin-*/diet-i | head -n 1` $toolsbin/diet || true
  52. cp -v `ls bin-*/diet-dyn-i | head -n 1` $toolsbin/diet-dyn || true
  53. fi
  54. eval "$MAKE MYARCH=$cpu $makeinstopt CC='$CC'"
  55. else
  56. mkdir bin-$cpu ; ln -s bin-$cpu "bin-${CC%%-*}"
  57. eval "$MAKE $makeopt CC=$HOSTCC"
  58. if [ $toolsdir = tools.cross ] ; then
  59. cp -v `ls bin-*/diet-i | head -n 1` $toolsbin/diet || true
  60. cp -v `ls bin-*/diet-dyn-i | head -n 1` $toolsbin/diet-dyn || true
  61. fi
  62. # in the dietlibc Makefile, $CROSS is prepended to $CC
  63. eval "$MAKE ARCH=$cpu $makeopt CROSS=$archprefix CC='gcc'"
  64. eval "$MAKE ARCH=$cpu $makeinstopt"
  65. fi
  66. if [ -d $root/$prefix/dietlibc/lib-ppc ] ; then
  67. rm -vf $root/$prefix/dietlibc/lib-powerpc
  68. ln -vs lib-ppc $root/$prefix/dietlibc/lib-powerpc
  69. fi
  70. if [ -d $root/$prefix/bin/lib-ppc ] ; then
  71. rmdir $root/$prefix/bin/lib-ppc
  72. fi
  73. }
  74. if [ "$prefix" = "usr" -o "$prefix" = "usr/local" ] ; then
  75. makeinstopt="$makeinstopt prefix=/$prefix/dietlibc"
  76. makeinstopt="$makeinstopt BINDIR=/$prefix/bin"
  77. makeinstopt="$makeinstopt MAN1DIR=/$prefix/man/man1"
  78. makeopt="$makeopt prefix=/$prefix/dietlibc all"
  79. else
  80. makeinstopt="$makeinstopt prefix=/$prefix"
  81. makeopt="$makeopt prefix=/$prefix all"
  82. fi
  83. cpu="`echo "$arch_machine" | sed -e s/i.86/i386/ -e s/powerpc/ppc/`"
  84. var_append makeinstopt " " "DESTDIR=$root"
  85. var_insert patchfiles ' ' "$archdir/sparc64-softfpu-dietlibc0.25-1.0.diff.bz2"
  86. toolsbin=$base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-bin
  87. toolsinc=$base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-include
  88. if [ "$cpu" = arm -o "$cpu" = i386 ] ; then
  89. var_append makeopt " " "dyn"
  90. fi
  91. if [ "$stagelevel" -eq 0 ]; then
  92. custmain="dietlibc_stage0"
  93. else
  94. custmain="dietlibc_main"
  95. fi