1#!/bin/bash -xe 2 3BUILD_ARCH_TYPE=$1 4V8_BUILD_OPTIONS=$2 5 6cd deps/v8 7find . -type d -name .git | xargs rm -rf 8tools/node/fetch_deps.py . 9 10ARCH="`arch`" 11if [[ "$ARCH" == "s390x" ]] || [[ "$ARCH" == "ppc64le" ]]; then 12 TARGET_ARCH=$ARCH 13 if [[ "$ARCH" == "ppc64le" ]]; then 14 TARGET_ARCH="ppc64" 15 fi 16 # set paths manually for now to use locally installed gn 17 export BUILD_TOOLS=/home/iojs/build-tools 18 export LD_LIBRARY_PATH=$BUILD_TOOLS:$LD_LIBRARY_PATH 19 # Avoid linking to ccache symbolic links as ccache decides which 20 # binary to run based on the name of the link (we always name them gcc/g++). 21 CC_PATH=`which -a $CC gcc | grep -v ccache | head -n 1` 22 CXX_PATH=`which -a $CXX g++ | grep -v ccache | head -n 1` 23 rm -f "$BUILD_TOOLS/g++" 24 rm -f "$BUILD_TOOLS/gcc" 25 ln -s $CXX_PATH "$BUILD_TOOLS/g++" 26 ln -s $CC_PATH "$BUILD_TOOLS/gcc" 27 export PATH=$BUILD_TOOLS:$PATH 28 29 g++ --version 30 gcc --version 31 export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config 32 gn gen -v out.gn/$BUILD_ARCH_TYPE --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true" 33 ninja -v -C out.gn/$BUILD_ARCH_TYPE d8 cctest inspector-test 34else 35 PATH=~/_depot_tools:$PATH tools/dev/v8gen.py $BUILD_ARCH_TYPE --no-goma $V8_BUILD_OPTIONS 36 PATH=~/_depot_tools:$PATH ninja -C out.gn/$BUILD_ARCH_TYPE/ d8 cctest inspector-test 37fi 38