# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: scripts/parse-config # Copyright (C) 2004 - 2024 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # # This script sets environment settings and parses the # configuration file config/$config/config # # [BEGIN] of version section sdever=24-svn # [END] of version section crossnative=native arch=any stagelevel=${stagelevel:-1} arch_target=any-unknown-linux arch_sizeof_long_long=undef arch_sizeof_int=undef arch_sizeof_short=undef arch_sizeof_char_p=undef arch_sizeof_long=undef arch_bigendian=undef export arch_machine=undef 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 [ "${!SDEDEBUG_*}" ]; then echo "WARNING: Found SDEDEBUG_* in environment!" >&2 fi . misc/output/parse-config # enable bash getconf plugin, if possible, in case system does not have a getconf enable getconf 2>/dev/null [ "$SDECFG_PARALLEL" = "auto" ] && SDECFG_PARALLEL="$(getconf _NPROCESSORS_ONLN)" [ "$SDECFG_CROSSBUILD" = 1 ] && crossnative=cross arch="${SDECFG_ARCH:-none}" target="${SDECFG_TARGET:-none}" # detect target chain targetchain="$target" x="$target" while [ -f "target/$x/extends" ]; do x="$(< target/$x/extends)" targetchain="$targetchain $x" done if [ -f "architecture/$arch/archtest.out" ] then . "architecture/$arch/archtest.out"; fi if [ -f "architecture/$arch/archtest.sh" ] then . "architecture/$arch/archtest.sh"; fi base=$(pwd -P) if [ "$SDE_THIS_IS_CHROOT" = 1 ] then toolsdir=tools.chroot else if [ $stagelevel -le 2 -a "$SDECFG_USE_CROSSCC" = 1 ] then toolsdir=cross else toolsdir=native fi fi 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 export PATH="$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/bin:$PATH" export PATH="$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/wrapper:$PATH" export LC_ALL=C; unset LANG; umask 022 export BUILDCC="cc" BUILD_CC="cc" HOSTCC="cc" HOST_CC="cc" export BUILDCXX="c++" BUILD_CXX="c++" HOSTCXX="c++" HOST_CXX="c++" unset CPP ARFLAGS ASFLAGS CFLAGS CXXFLAGS CPPFLAGS FFLAGS LDFLAGS unset LD_LIBRARY_PATH LD_PRELOAD FLWRAPPER C_INCLUDE_PATH CONFIG_SITE unset DESTDIR DISPLAY export HOME='/root' export STRIP_WRAPPER_MYPATH="$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/wrapper" export STRIP_WRAPPER_NOLOOP=0 export INSTALL_WRAPPER_MYPATH="$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/wrapper" export INSTALL_WRAPPER_LOGFILE="/dev/null" export INSTALL_WRAPPER_FILTER="" export INSTALL_WRAPPER_NOLOOP=0 export CMD_WRAPPER_MYPATH="$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/wrapper" export CMD_WRAPPER_LOGFILE="" CMD_WRAPPER_DEBUG=0 CMD_WRAPPER_BYPASS=0 export CMD_WRAPPER_NOLOOP=0; unset CMD_WRAPPER_OTHERS_TMP export LDCONFIG=$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/wrapper/ldconfig if [ -f $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/wrapper-config ] then . $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/wrapper-config; fi if [ "$stagelevel" -gt 2 -o "$SDECFG_USE_CROSSCC" = 0 ] then if [ -f $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/parse-config-fixarch ] then . $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/parse-config-fixarch; fi arch_build="$arch_target" archprefix="" else # remove wrapper path to run system uname arch_build="`PATH="${PATH/$CMD_WRAPPER_MYPATH:/}" uname -m | sed 's/ppc/powerpc/'`-nocross-linux-gnu" if [ -f $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/parse-config-fixarch ] then . $base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/lib/parse-config-fixarch; fi if [ $stagelevel -eq 1 -o $stagelevel -eq 2 ]; then archprefix="${arch_target}-" if [ ! -f "$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/bin/${archprefix}cc" ] then archprefix="Cross_CC_not_built_so_far_"; fi fi fi export CC="${archprefix}cc" CXX="${archprefix}c++" CPP="${archprefix}cpp" export AS="${archprefix}as" STRIP="${archprefix}strip" OBJCOPY="${archprefix}objcopy" export LD="${archprefix}ld" GASP="${archprefix}gasp" OBJDUMP="${archprefix}objdump" 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" # silently ignore tail / head and co related errors due to obsolete argument # usage (fixes a lot of stuff) export _POSIX2_VERSION=199209