Changeset a42be38 in mainline for configure.sh


Ignore:
Timestamp:
2019-08-18T15:36:21Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08c851ce
Parents:
521669d
Message:

Don't require the cross toolchain to be in $PATH

The toolchain in $PATH is still used when present, otherwise $CROSS_PREFIX, and finally /usr/local/cross are tried.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.sh

    r521669d ra42be38  
    106106fi
    107107
    108 meson "${SOURCE_DIR}" '.' --cross-file "${SOURCE_DIR}/meson/cross/${cross_target}" || exit 1
     108cross_def="${SOURCE_DIR}/meson/cross/${cross_target}"
     109cc_arch=`sed -n "s:cc_arch = '\(.*\)':\1:p" "$cross_def"`
     110
     111compname="$cc_arch-helenos-gcc"
     112
     113if which "$compname"; then
     114        # Compiler is in PATH
     115        compprefix="$cc_arch-helenos-"
     116
     117elif [ -n "$CROSS_PREFIX" ]; then
     118        if ! which "$CROSS_PREFIX/bin/$compname"; then
     119                echo "ERROR: \$CROSS_PREFIX defined but $compname is not present in $CROSS_PREFIX/bin."
     120                echo "Run tools/toolchain.sh to build cross-compiling toolchain."
     121                exit 1
     122        fi
     123
     124        compprefix="$CROSS_PREFIX/bin/$cc_arch-helenos-"
     125else
     126        if ! which "/usr/local/cross/bin/$compname"; then
     127                echo "ERROR: \$CROSS_PREFIX is not defined and $compname is not present in /usr/local/cross/bin."
     128                echo "Run tools/toolchain.sh to build cross-compiling toolchain."
     129                exit 1
     130        fi
     131
     132        compprefix="/usr/local/cross/bin/$cc_arch-helenos-"
     133fi
     134
     135sed "s:@COMPPREFIX@:$compprefix:g" "$cross_def" > crossfile || exit 1
     136
     137meson "${SOURCE_DIR}" '.' --cross-file crossfile || exit 1
    109138
    110139echo
Note: See TracChangeset for help on using the changeset viewer.