]> git.saurik.com Git - apple/system_cmds.git/blame - zic.tproj/build_zichost.sh
system_cmds-550.6.tar.gz
[apple/system_cmds.git] / zic.tproj / build_zichost.sh
CommitLineData
aaff5f01
A
1#!/bin/sh
2set -e
3set -x
4
5if [ $# -ne 1 ]; then
6 echo "Usage: $0 BUILT_PRODUCTS_DIR" 1>&2
7 exit 1
8fi
9
10BUILT_PRODUCTS_DIR="$1"
11
12# We may not be building for a platform we can natively
13# run on the build machine. Build a dedicate copy of zic
14# for processing zoneinfo files
15
16ZICHOST_SYMROOT="${BUILT_PRODUCTS_DIR}/zic_host-sym"
17ZICHOST_DSTROOT="${BUILT_PRODUCTS_DIR}/zic_host-dst"
18ZICHOST="${ZICHOST_DSTROOT}/zic_host"
19
20# A full environment causes build settings from a cross
21# build (like PLATFORM_NAME) to leak into a native
22# host tool build
23
24EXTRA_ARGS=""
25if [ -n "${XCODE_DEVELOPER_USR_PATH}" ]; then
26 EXTRA_ARGS="XCODE_DEVELOPER_USR_PATH=${XCODE_DEVELOPER_USR_PATH}"
27fi
28
29env -i \
30 TMPDIR="${TMPDIR}" \
31 PATH="${PATH}" \
32 SCDontUseServer="${SCDontUseServer}" \
33 __CFPREFERENCES_AVOID_DAEMON="${__CFPREFERENCES_AVOID_DAEMON}" \
34 __CF_USER_TEXT_ENCODING="${__CF_USER_TEXT_ENCODING}" \
35 LANG="${LANG}" \
36 HOME="${HOME}" \
37 $EXTRA_ARGS \
38 xcrun -sdk "${SDKROOT}" xcodebuild install \
39 -target zic \
40 -sdk "macosx" \
41 SRCROOT="${SRCROOT}" \
42 OBJROOT="${OBJROOT}" \
43 SYMROOT="${ZICHOST_SYMROOT}" \
44 DSTROOT="${ZICHOST_DSTROOT}" \
45 ARCHS='$(NATIVE_ARCH_ACTUAL)' \
46 PRODUCT_NAME=zic_host \
47 INSTALL_PATH="/"