]> git.cameronkatri.com Git - apple_cmds.git/blob - system_cmds/zic.tproj/build_zichost.sh
file_cmds: Fix BINDIRs again
[apple_cmds.git] / system_cmds / zic.tproj / build_zichost.sh
1 #!/bin/sh
2 set -e
3 set -x
4
5 if [ $# -ne 1 ]; then
6 echo "Usage: $0 BUILT_PRODUCTS_DIR" 1>&2
7 exit 1
8 fi
9
10 BUILT_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
16 ZICHOST_OBJROOT="${BUILT_PRODUCTS_DIR}/zic_host-objroot"
17 ZICHOST_SYMROOT="${BUILT_PRODUCTS_DIR}/zic_host-sym"
18 ZICHOST_DSTROOT="${BUILT_PRODUCTS_DIR}/zic_host-dst"
19 ZICHOST="${ZICHOST_DSTROOT}/zic_host"
20
21 # A full environment causes build settings from a cross
22 # build (like PLATFORM_NAME) to leak into a native
23 # host tool build
24
25 EXTRA_ARGS=""
26 if [ -n "${XCODE_DEVELOPER_USR_PATH}" ]; then
27 EXTRA_ARGS="XCODE_DEVELOPER_USR_PATH=${XCODE_DEVELOPER_USR_PATH}"
28 fi
29
30 env -i \
31 TMPDIR="${TMPDIR}" \
32 PATH="${PATH}" \
33 XBS_IS_CHROOTED="${XBS_IS_CHROOTED}" \
34 SCDontUseServer="${SCDontUseServer}" \
35 __CFPREFERENCES_AVOID_DAEMON="${__CFPREFERENCES_AVOID_DAEMON}" \
36 __CF_USER_TEXT_ENCODING="${__CF_USER_TEXT_ENCODING}" \
37 LANG="${LANG}" \
38 HOME="${HOME}" \
39 $EXTRA_ARGS \
40 TOOLCHAINS="${TOOLCHAINS}" \
41 xcrun -sdk "${SDKROOT}" xcodebuild install \
42 -target zic \
43 -sdk "macosxinternal" \
44 SRCROOT="${SRCROOT}" \
45 OBJROOT="${ZICHOST_OBJROOT}" \
46 SYMROOT="${ZICHOST_SYMROOT}" \
47 DSTROOT="${ZICHOST_DSTROOT}" \
48 ARCHS='$(NATIVE_ARCH_ACTUAL)' \
49 PRODUCT_NAME=zic_host \
50 INSTALL_PATH="/"