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.

110 lines
3.5 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/dietlibc.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2005 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. dietlibc_stage0() {
  23. rm -rf $toolsinc
  24. cp -rv include $toolsinc
  25. }
  26. dietlibc_main() {
  27. if [ $toolsdir = tools.cross ] ; then
  28. rm -rf $toolsbin; mkdir -p $toolsbin
  29. for x in gcc as ld ar ranlib nm ; do
  30. cat > $toolsbin/${arch_target}-$x << EOT
  31. #!/bin/sh
  32. PATH=\${PATH/\$(dirname \$( type -p \$0 ))/}; PATH=\${PATH/::/:}
  33. exec ${pkg_dietlibc_orig_target}-$x
  34. EOT
  35. chmod +x $toolsbin/${arch_target}-$x
  36. done
  37. fi
  38. # special features
  39. if ! [ "$ROCKCFG_DIETWANT_SYSENTER" = "1" ]; then
  40. sed -i "s,^#define WANT_SYSENTER$,/*\0*/," dietfeatures.h
  41. fi
  42. if [ $arch = "powerpc" ] ; then
  43. ln -s bin-ppc bin-powerpc
  44. fi
  45. # build package
  46. if [ "$crossnative" = native ] ; then
  47. # dietlibc uses uname - so we always need to set MYARCH
  48. eval "$MAKE MYARCH=$cpu $makeopt CC='$CC --specs=specs'"
  49. if [ $toolsdir = tools.cross ] ; then
  50. cp -v `ls bin-*/diet-i | head -n 1` $toolsbin/diet || true
  51. cp -v `ls bin-*/diet-dyn-i | head -n 1` $toolsbin/diet-dyn || true
  52. fi
  53. eval "$MAKE MYARCH=$cpu $makeinstopt CC='$CC --specs=specs'"
  54. else
  55. mkdir bin-$cpu ; ln -s bin-$cpu "bin-${CC%%-*}"
  56. eval "$MAKE $makeopt CC=$HOSTCC"
  57. if [ $toolsdir = tools.cross ] ; then
  58. cp -v `ls bin-*/diet-i | head -n 1` $toolsbin/diet || true
  59. cp -v `ls bin-*/diet-dyn-i | head -n 1` $toolsbin/diet-dyn || true
  60. fi
  61. # in the dietlibc Makefile, $CROSS is prepended to $CC
  62. eval "$MAKE ARCH=$cpu $makeopt CROSS=$archprefix CC='gcc --specs=specs'"
  63. eval "$MAKE ARCH=$cpu $makeinstopt"
  64. fi
  65. if [ -d $root/$prefix/dietlibc/lib-ppc ] ; then
  66. rm -vf $root/$prefix/dietlibc/lib-powerpc
  67. ln -vs lib-ppc $root/$prefix/dietlibc/lib-powerpc
  68. fi
  69. if [ -d $root/$prefix/bin/lib-ppc ] ; then
  70. rmdir $root/$prefix/bin/lib-ppc
  71. fi
  72. }
  73. if [ "$prefix" = "usr" -o "$prefix" = "usr/local" ] ; then
  74. makeinstopt="$makeinstopt prefix=/$prefix/dietlibc"
  75. makeinstopt="$makeinstopt BINDIR=/$prefix/bin"
  76. makeinstopt="$makeinstopt MAN1DIR=/$prefix/man/man1"
  77. makeopt="$makeopt prefix=/$prefix/dietlibc all"
  78. else
  79. makeinstopt="$makeinstopt prefix=/$prefix"
  80. makeopt="$makeopt prefix=/$prefix all"
  81. fi
  82. cpu="`echo "$arch_machine" | sed -e s/i.86/i386/ -e s/powerpc/ppc/`"
  83. var_append makeinstopt " " "DESTDIR=$root"
  84. var_insert patchfiles ' ' "$archdir/sparc64-softfpu-dietlibc0.25-1.0.diff.bz2"
  85. toolsbin=$base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-bin
  86. toolsinc=$base/build/$ROCKCFG_ID/ROCK/$toolsdir/diet-include
  87. if [ "$cpu" = arm -o "$cpu" = i386 ] ; then
  88. var_append makeopt " " "dyn"
  89. fi
  90. if [ "$stagelevel" -eq 0 ]; then
  91. custmain="dietlibc_stage0"
  92. else
  93. custmain="dietlibc_main"
  94. fi