Changes in configure.sh [d231a54:1c39d33b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.sh
rd231a54 r1c39d33b 39 39 CONFIG_RULES="${SOURCE_DIR}/HelenOS.config" 40 40 CONFIG_DEFAULTS="${SOURCE_DIR}/defaults" 41 41 42 42 43 test "$#" -eq 1 && { test "$1" = "-h" || test "$1" = "--help"; } … … 84 85 fi 85 86 86 if ! which meson >/dev/null 2>/dev/null; then87 if ! which meson; then 87 88 echo "Your system does not have Meson installed." 88 89 echo 'Please use `pip3 install meson`' … … 90 91 fi 91 92 92 if ! which ninja >/dev/null 2>/dev/null; then93 if ! which ninja; then 93 94 echo "Your system does not have ninja installed." 94 95 echo 'Please use `pip3 install ninja`' … … 97 98 98 99 # Link tools directory for convenience. 99 if [ ! -e tools ]; then 100 ln -s "${SOURCE_DIR}/tools" tools 101 fi 100 ln -s "${SOURCE_DIR}/tools" tools 102 101 103 102 # Run HelenOS config tool. … … 110 109 PLATFORM=`sed -n '/^PLATFORM\b/p' Makefile.config | sed 's:[^=]*= ::'` 111 110 MACHINE=`sed -n '/^MACHINE\b/p' Makefile.config | sed 's:[^=]*= ::'` 112 COMPILER=`sed -n '/^COMPILER\b/p' Makefile.config | sed 's:[^=]*= ::'`113 111 114 112 cross_target="$PLATFORM" … … 120 118 fi 121 119 122 if [ "$COMPILER" = 'clang' ]; then123 cross_target="${cross_target}_clang"124 fi125 126 120 cross_def="${SOURCE_DIR}/meson/cross/${cross_target}" 127 121 cc_arch=`sed -n "s:cc_arch = '\(.*\)':\1:p" "$cross_def"` 128 122 129 if [ "$COMPILER" = 'clang' ]; then 130 compname="$cc_arch-helenos-clang" 131 else 132 compname="$cc_arch-helenos-gcc" 133 fi 134 unset compprefix 123 compname="$cc_arch-helenos-gcc" 135 124 136 if which "$compname" >/dev/null 2>/dev/null; then125 if which "$compname"; then 137 126 # Compiler is in PATH 138 127 compprefix="$cc_arch-helenos-" 139 128 140 129 elif [ -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 146 131 echo "ERROR: \$CROSS_PREFIX defined but $compname is not present in $CROSS_PREFIX/bin." 147 132 echo "Run tools/toolchain.sh to build cross-compiling toolchain." 148 133 exit 1 149 134 fi 135 136 compprefix="$CROSS_PREFIX/bin/$cc_arch-helenos-" 150 137 else 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." 168 140 echo "Run tools/toolchain.sh to build cross-compiling toolchain." 169 141 exit 1 170 142 fi 143 144 compprefix="/usr/local/cross/bin/$cc_arch-helenos-" 171 145 fi 172 146 173 147 sed "s:@COMPPREFIX@:$compprefix:g" "$cross_def" > crossfile || exit 1 174 148 175 meson setup"${SOURCE_DIR}" '.' --cross-file crossfile || exit 1149 meson "${SOURCE_DIR}" '.' --cross-file crossfile || exit 1 176 150 177 151 echo
Note:
See TracChangeset
for help on using the changeset viewer.