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.

182 lines
5.3 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/parse-config
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # This script sets environment settings and parses the
  26. # configuration file config/$config/config
  27. #
  28. # [BEGIN] of version section
  29. rockver=TRUNK
  30. # [END] of version section
  31. crossnative=native ; stagelevel=${stagelevel:-1} ; arch=any
  32. arch_sizeof_long_long=undef ; arch_sizeof_int=undef ; arch_machine=undef
  33. arch_sizeof_char_p=undef ; arch_sizeof_long=undef ; arch_bigendian=undef
  34. arch_sizeof_short=undef ; arch_target=any-unknown-linux
  35. arch_target32= ; arch_target64=
  36. if [ -f config/$config/config ]
  37. then
  38. . config/$config/config
  39. else
  40. echo
  41. echo "ERROR: No configuration '$config' found!"
  42. echo
  43. echo "Please create a configuration using ./scripts/Config."
  44. echo
  45. exit 1
  46. fi
  47. if [ "${!ROCK_DEBUG_*}" ]; then
  48. echo "WARNING: Found ROCK_DEBUG_* in environment!" >&2
  49. fi
  50. . misc/output/parse-config
  51. [ "$ROCKCFG_CROSSBUILD" = 1 ] && crossnative=cross
  52. arch="${ROCKCFG_ARCH:-none}" ; target="${ROCKCFG_TARGET:-none}"
  53. if [ -f "architecture/$arch/archtest.out" ]
  54. then . "architecture/$arch/archtest.out" ; fi
  55. if [ -f "architecture/$arch/archtest.sh" ]
  56. then . "architecture/$arch/archtest.sh" ; fi
  57. if [ "$stagelevel" -ge 3 ]
  58. then
  59. if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ]
  60. then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi
  61. arch_build="$arch_target" ; archprefix=""
  62. else
  63. arch_build="`uname -m`-nocross-linux-gnu"
  64. if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ]
  65. then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi
  66. if [ $stagelevel -eq 2 ]; then
  67. archprefix="${arch_target}-"
  68. fi
  69. fi
  70. base=$(pwd -P)
  71. if [ "$ROCK_THIS_IS_CHROOT" = 1 ]
  72. then
  73. toolsdir=tools.chroot
  74. else
  75. if [ "$ROCKCFG_CROSSBUILD" == 1 ]
  76. then
  77. toolsdir=tools.cross
  78. else
  79. toolsdir=tools.native
  80. fi
  81. fi
  82. [ $stagelevel -ge 3 ] && . /etc/profile
  83. new_path=""
  84. for x in ${PATH//:/ }; do
  85. if [ -d "$x" -a -z "${x##/*}" -a -n "${x##$base/*}" -a \
  86. "$x" != "$CMD_WRAPPER_MYPATH" -a "$x" != "." ]; then
  87. new_path="$new_path:$x"
  88. fi
  89. done
  90. export PATH="${new_path#:}"
  91. unset new_path
  92. if [ $stagelevel -le 2 ] ; then
  93. export LFS="$base/build/$ROCKCFG_ID"
  94. else
  95. export LFS=""
  96. fi
  97. export CLFS="$LFS"
  98. if [ "$ROCKCFG_CROSSBUILD" == 0 ] ; then
  99. tools=ROCK/tools.native
  100. else
  101. tools=ROCK/tools.cross
  102. fi
  103. cross_tools="$tools"
  104. if [ $stagelevel -le 2 ] ; then
  105. export PATH="$LFS/$tools/bin:/bin:/usr/bin:/sbin:/usr/sbin"
  106. fi
  107. export CLFS_HOST="$arch_build"
  108. export CLFS_TARGET="$arch_target" CLFS_TARGET32="$arch_target32"
  109. export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/bin:$PATH"
  110. export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper:$PATH"
  111. export LC_ALL=C; umask 022
  112. # export BUILDCC="cc" BUILD_CC="cc" HOSTCC="cc" HOST_CC="cc"
  113. # export BUILDCXX="c++" BUILD_CXX="c++" HOSTCXX="c++" HOST_CXX="c++"
  114. export BUILDCC="gcc" BUILD_CC="gcc" HOSTCC="gcc" HOST_CC="gcc"
  115. export BUILDCXX="g++" BUILD_CXX="g++" HOSTCXX="g++" HOST_CXX="g++"
  116. export BUILD32="-m32" BUILD64="-m64"
  117. if [ "$ROCKCFG_LINGUAS" == "all" ] ; then
  118. unset LINGUAS
  119. elif [ "$ROCKCFG_LINGUAS" == "none" ] ; then
  120. export LINGUAS=
  121. else
  122. export LINGUAS="$ROCKCFG_LINGUAS"
  123. fi
  124. IFS=$' \t\n'
  125. set +o posix
  126. set +h
  127. export STRIP_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper"
  128. export STRIP_WRAPPER_NOLOOP=0
  129. export INSTALL_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper"
  130. export INSTALL_WRAPPER_LOGFILE="/dev/null"
  131. export INSTALL_WRAPPER_FILTER=""
  132. export INSTALL_WRAPPER_NOLOOP=0
  133. export CMD_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper"
  134. export CMD_WRAPPER_LOGFILE="" CMD_WRAPPER_DEBUG=0 CMD_WRAPPER_BYPASS=0
  135. export CMD_WRAPPER_NOLOOP=0 ; unset CMD_WRAPPER_OTHERS_TMP
  136. if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ]
  137. then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ; fi
  138. # export CC="${archprefix}cc" CXX="${archprefix}c++"
  139. export CC="${archprefix}gcc" CXX="${archprefix}g++"
  140. export AS="${archprefix}as" STRIP="${archprefix}strip"
  141. export LD="${archprefix}ld" GASP="${archprefix}gasp"
  142. export AR="${archprefix}ar" RANLIB="${archprefix}ranlib"
  143. export NM="${archprefix}nm" KCC="${archprefix}kcc"
  144. export F77="${archprefix}f77" MAKE="make"
  145. export AWK="gawk" SED="sed"
  146. if [ $stagelevel -le 2 -a "$ROCKCFG_PSEUDONATIVE" = 1 ]; then
  147. export BUILDCC="$BUILDCC -static" BUILDLD="$BUILDLD -static"
  148. fi
  149. if [ -f /etc/ROCK-PROFILE ]; then
  150. # this is the right place for e.g. build process ulimits
  151. . /etc/ROCK-PROFILE
  152. fi