1#!/usr/bin/bash
2
3# Determine whether we have the versioned ICU 4.0 or the unversioned ICU 4.4
4UNVERSIONED_ICU_LIB_PATH=$(cygpath -u "${WEBKITLIBRARIESDIR}/lib/libicuuc.lib")
5ICUVERSION_H_PATH=$(cygpath -u "${CONFIGURATIONBUILDDIR}/include/private/ICUVersion.h")
6if test \( ! -f "${ICUVERSION_H_PATH}" \) -o \( -f "${UNVERSIONED_ICU_LIB_PATH}" -a \( "${UNVERSIONED_ICU_LIB_PATH}" -nt "${ICUVERSION_H_PATH}" \) \)
7then
8    mkdir -p "$(dirname "${ICUVERSION_H_PATH}")"
9    test ! -f "${UNVERSIONED_ICU_LIB_PATH}"
10    echo "#define U_DISABLE_RENAMING $?" > "${ICUVERSION_H_PATH}"
11fi
12
13NUMCPUS=`../../../../Tools/Scripts/num-cpus`
14
15XSRCROOT="`pwd`/../.."
16XSRCROOT=`realpath "$XSRCROOT"`
17# Do a little dance to get the path into 8.3 form to make it safe for gnu make
18# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
19XSRCROOT=`cygpath -m -s "$XSRCROOT"`
20XSRCROOT=`cygpath -u "$XSRCROOT"`
21export XSRCROOT
22export SOURCE_ROOT=$XSRCROOT
23
24XDSTROOT="$1"
25export XDSTROOT
26# Do a little dance to get the path into 8.3 form to make it safe for gnu make
27# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
28XDSTROOT=`cygpath -m -s "$XDSTROOT"`
29XDSTROOT=`cygpath -u "$XDSTROOT"`
30export XDSTROOT
31
32SDKROOT="$2"
33export SDKROOT
34# Do a little dance to get the path into 8.3 form to make it safe for gnu make
35# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
36SDKROOT=`cygpath -m -s "$SDKROOT"`
37SDKROOT=`cygpath -u "$SDKROOT"`
38export SDKROOT
39
40export BUILT_PRODUCTS_DIR="$XDSTROOT/obj/JavaScriptCore"
41
42mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/docs"
43cd "${BUILT_PRODUCTS_DIR}/DerivedSources"
44
45export JavaScriptCore="${XSRCROOT}"
46export DFTABLES_EXTENSION=".exe"
47make -f "$JavaScriptCore/DerivedSources.make" -j ${NUMCPUS} || exit 1
48