#!/bin/bash # # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/scripts/parse-config # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at https://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- # # This script sets environment settings and parses the # configuration file config/$config/config # # [BEGIN] of version section rockver=TRUNK # [END] of version section crossnative=native ; stagelevel=${stagelevel:-1} ; arch=any arch_sizeof_long_long=undef ; arch_sizeof_int=undef ; arch_machine=undef arch_sizeof_char_p=undef ; arch_sizeof_long=undef ; arch_bigendian=undef arch_sizeof_short=undef ; arch_target=any-unknown-linux arch_target32= ; arch_target64= if [ -f config/$config/config ] then . config/$config/config else echo echo "ERROR: No configuration '$config' found!" echo echo "Please create a configuration using ./scripts/Config." echo exit 1 fi if [ "${!ROCK_DEBUG_*}" ]; then echo "WARNING: Found ROCK_DEBUG_* in environment!" >&2 fi . misc/output/parse-config [ "$ROCKCFG_CROSSBUILD" = 1 ] && crossnative=cross arch="${ROCKCFG_ARCH:-none}" ; target="${ROCKCFG_TARGET:-none}" if [ -f "architecture/$arch/archtest.out" ] then . "architecture/$arch/archtest.out" ; fi if [ -f "architecture/$arch/archtest.sh" ] then . "architecture/$arch/archtest.sh" ; fi if [ "$stagelevel" -ge 3 ] then if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi arch_build="$arch_target" ; archprefix="" else arch_build="`uname -m`-nocross-linux-gnu" if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi if [ $stagelevel -eq 2 ]; then archprefix="${arch_target}-" fi fi base=$(pwd -P) if [ "$ROCK_THIS_IS_CHROOT" = 1 ] then toolsdir=tools.chroot else if [ "$ROCKCFG_CROSSBUILD" == 1 ] then toolsdir=tools.cross else toolsdir=tools.native fi fi [ $stagelevel -ge 3 ] && . /etc/profile new_path="" for x in ${PATH//:/ }; do if [ -d "$x" -a -z "${x##/*}" -a -n "${x##$base/*}" -a \ "$x" != "$CMD_WRAPPER_MYPATH" -a "$x" != "." ]; then new_path="$new_path:$x" fi done export PATH="${new_path#:}" unset new_path if [ $stagelevel -le 2 ] ; then export LFS="$base/build/$ROCKCFG_ID" else export LFS="" fi export CLFS="$LFS" if [ "$ROCKCFG_CROSSBUILD" == 0 ] ; then tools=ROCK/tools.native else tools=ROCK/tools.cross fi cross_tools="$tools" if [ $stagelevel -le 2 ] ; then export PATH="$LFS/$tools/bin:/bin:/usr/bin:/sbin:/usr/sbin" fi export CLFS_HOST="$arch_build" export CLFS_TARGET="$arch_target" CLFS_TARGET32="$arch_target32" export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/bin:$PATH" export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper:$PATH" export LC_ALL=C; umask 022 # export BUILDCC="cc" BUILD_CC="cc" HOSTCC="cc" HOST_CC="cc" # export BUILDCXX="c++" BUILD_CXX="c++" HOSTCXX="c++" HOST_CXX="c++" export BUILDCC="gcc" BUILD_CC="gcc" HOSTCC="gcc" HOST_CC="gcc" export BUILDCXX="g++" BUILD_CXX="g++" HOSTCXX="g++" HOST_CXX="g++" export BUILD32="-m32" BUILD64="-m64" if [ "$ROCKCFG_LINGUAS" == "all" ] ; then unset LINGUAS elif [ "$ROCKCFG_LINGUAS" == "none" ] ; then export LINGUAS= else export LINGUAS="$ROCKCFG_LINGUAS" fi IFS=$' \t\n' set +o posix set +h export STRIP_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper" export STRIP_WRAPPER_NOLOOP=0 export INSTALL_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper" export INSTALL_WRAPPER_LOGFILE="/dev/null" export INSTALL_WRAPPER_FILTER="" export INSTALL_WRAPPER_NOLOOP=0 export CMD_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper" export CMD_WRAPPER_LOGFILE="" CMD_WRAPPER_DEBUG=0 CMD_WRAPPER_BYPASS=0 export CMD_WRAPPER_NOLOOP=0 ; unset CMD_WRAPPER_OTHERS_TMP if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ] then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ; fi # export CC="${archprefix}cc" CXX="${archprefix}c++" export CC="${archprefix}gcc" CXX="${archprefix}g++" export AS="${archprefix}as" STRIP="${archprefix}strip" export LD="${archprefix}ld" GASP="${archprefix}gasp" export AR="${archprefix}ar" RANLIB="${archprefix}ranlib" export NM="${archprefix}nm" KCC="${archprefix}kcc" export F77="${archprefix}f77" MAKE="make" export AWK="gawk" SED="sed" if [ $stagelevel -le 2 -a "$ROCKCFG_PSEUDONATIVE" = 1 ]; then export BUILDCC="$BUILDCC -static" BUILDLD="$BUILDLD -static" fi if [ -f /etc/ROCK-PROFILE ]; then # this is the right place for e.g. build process ulimits . /etc/ROCK-PROFILE fi