1#!/bin/bash -eu 2# Copyright 2017 Google Inc. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17export DEPS_PATH=/src/deps 18mkdir $DEPS_PATH 19 20# build ICU for linking statically. 21cd $SRC/icu/source 22./configure --disable-shared --enable-static --disable-layoutex \ 23 --disable-tests --disable-samples --with-data-packaging=static --prefix=$DEPS_PATH 24make install -j$(nproc) 25 26# Ugly ugly hack to get static linking to work for icu. 27cd $DEPS_PATH/lib 28ls *.a | xargs -n1 ar x 29rm *.a 30ar r libicu.a *.{ao,o} 31ln -s libicu.a libicudata.a 32ln -s libicu.a libicuuc.a 33ln -s libicu.a libicui18n.a 34 35export CFLAGS="$CFLAGS -DU_STATIC_IMPLEMENTATION" 36export CXXFLAGS="$CXXFLAGS -DU_STATIC_IMPLEMENTATION" 37export ICU_ROOT=$DEPS_PATH 38 39cd $SRC/WebKit 40Tools/Scripts/build-jsc \ 41 --debug \ 42 --jsc-only \ 43 --cmakeargs="-DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DWEBKIT_LIBRARIES_DIR=$DEPS_PATH -DWEBKIT_LIBRARIES_INCLUDE_DIR=$DEPS_PATH/include -DWEBKIT_LIBRARIES_LINK_DIR=$DEPS_PATH/lib" \ 44 --makeargs='-v' 45 46cp WebKitBuild/Debug/bin/jsc $OUT 47