Changes in configure.sh [d231a54:1c39d33b] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.sh

    rd231a54 r1c39d33b  
    3939CONFIG_RULES="${SOURCE_DIR}/HelenOS.config"
    4040CONFIG_DEFAULTS="${SOURCE_DIR}/defaults"
     41
    4142
    4243test "$#" -eq 1 && { test "$1" = "-h" || test "$1" = "--help"; }
     
    8485fi
    8586
    86 if ! which meson >/dev/null 2>/dev/null; then
     87if ! which meson; then
    8788        echo "Your system does not have Meson installed."
    8889        echo 'Please use `pip3 install meson`'
     
    9091fi
    9192
    92 if ! which ninja >/dev/null 2>/dev/null; then
     93if ! which ninja; then
    9394        echo "Your system does not have ninja installed."
    9495        echo 'Please use `pip3 install ninja`'
     
    9798
    9899# Link tools directory for convenience.
    99 if [ ! -e tools ]; then
    100         ln -s "${SOURCE_DIR}/tools" tools
    101 fi
     100ln -s "${SOURCE_DIR}/tools" tools
    102101
    103102# Run HelenOS config tool.
     
    110109PLATFORM=`sed -n '/^PLATFORM\b/p' Makefile.config | sed 's:[^=]*= ::'`
    111110MACHINE=`sed -n '/^MACHINE\b/p' Makefile.config | sed 's:[^=]*= ::'`
    112 COMPILER=`sed -n '/^COMPILER\b/p' Makefile.config | sed 's:[^=]*= ::'`
    113111
    114112cross_target="$PLATFORM"
     
    120118fi
    121119
    122 if [ "$COMPILER" = 'clang' ]; then
    123     cross_target="${cross_target}_clang"
    124 fi
    125 
    126120cross_def="${SOURCE_DIR}/meson/cross/${cross_target}"
    127121cc_arch=`sed -n "s:cc_arch = '\(.*\)':\1:p" "$cross_def"`
    128122
    129 if [ "$COMPILER" = 'clang' ]; then
    130     compname="$cc_arch-helenos-clang"
    131 else
    132     compname="$cc_arch-helenos-gcc"
    133 fi
    134 unset compprefix
     123compname="$cc_arch-helenos-gcc"
    135124
    136 if which "$compname" >/dev/null 2>/dev/null; then
     125if which "$compname"; then
    137126        # Compiler is in PATH
    138127        compprefix="$cc_arch-helenos-"
    139128
    140129elif [ -n "$CROSS_PREFIX" ]; then
    141         if which "$CROSS_PREFIX/bin/$compname" >/dev/null 2>/dev/null; then
    142                 compprefix="$CROSS_PREFIX/bin/$cc_arch-helenos-"
    143         fi
    144 
    145         if [ -z "$compprefix" ]; then
     130        if ! which "$CROSS_PREFIX/bin/$compname"; then
    146131                echo "ERROR: \$CROSS_PREFIX defined but $compname is not present in $CROSS_PREFIX/bin."
    147132                echo "Run tools/toolchain.sh to build cross-compiling toolchain."
    148133                exit 1
    149134        fi
     135
     136        compprefix="$CROSS_PREFIX/bin/$cc_arch-helenos-"
    150137else
    151         if [ -z "$XDG_DATA_HOME" ]; then
    152                         XDG_DATA_HOME="$HOME/.local/share"
    153         fi
    154 
    155         if which "$XDG_DATA_HOME/HelenOS/cross/bin/$compname" >/dev/null 2>/dev/null; then
    156                 compprefix="$XDG_DATA_HOME/HelenOS/cross/bin/$cc_arch-helenos-"
    157         elif which "/opt/HelenOS/cross/bin/$compname" >/dev/null 2>/dev/null; then
    158                 compprefix="/opt/HelenOS/cross/bin/$cc_arch-helenos-"
    159         elif which "/usr/local/cross/bin/$compname" >/dev/null 2>/dev/null; then
    160                 compprefix="/usr/local/cross/bin/$cc_arch-helenos-"
    161         fi
    162 
    163         if [ -z "$compprefix" ]; then
    164                 echo "ERROR: \$CROSS_PREFIX is not defined and $compname is not present in any of the following standard locations."
    165                 echo " * $XDG_DATA_HOME/HelenOS/cross/bin"
    166                 echo " * /opt/HelenOS/cross/bin"
    167                 echo " * /usr/local/cross/bin"
     138        if ! which "/usr/local/cross/bin/$compname"; then
     139                echo "ERROR: \$CROSS_PREFIX is not defined and $compname is not present in /usr/local/cross/bin."
    168140                echo "Run tools/toolchain.sh to build cross-compiling toolchain."
    169141                exit 1
    170142        fi
     143
     144        compprefix="/usr/local/cross/bin/$cc_arch-helenos-"
    171145fi
    172146
    173147sed "s:@COMPPREFIX@:$compprefix:g" "$cross_def" > crossfile || exit 1
    174148
    175 meson setup "${SOURCE_DIR}" '.' --cross-file crossfile || exit 1
     149meson "${SOURCE_DIR}" '.' --cross-file crossfile || exit 1
    176150
    177151echo
Note: See TracChangeset for help on using the changeset viewer.