1#!/bin/bash 2# Copyright (c) 2014 The Chromium Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6ICUROOT="$(dirname "$0")/.." 7LINUX_SOURCE="${ICUROOT}/linux/icudtl_dat.S" 8MAC_SOURCE="${ICUROOT}/mac/icudtl_dat.S" 9 10echo "Generating ${MAC_SOURCE} from ${LINUX_SOURCE}" 11 12# Linux uses 'icudt${MAJOR VERSION}_dat' while Mac has "_" prepended to it. 13ICUDATA_SYMBOL="_$(head -1 ${LINUX_SOURCE} | cut -d ' ' -f 2)" 14 15cat > ${MAC_SOURCE} <<PREAMBLE 16.globl ${ICUDATA_SYMBOL} 17#ifdef U_HIDE_DATA_SYMBOL 18 .private_extern ${ICUDATA_SYMBOL} 19#endif 20 .data 21 .const 22 .align 4 23${ICUDATA_SYMBOL}: 24PREAMBLE 25 26PREAMBLE_LENGTH=$(($(egrep -n '^icudt' ${LINUX_SOURCE} | cut -d : -f 1) + 1)) 27tail -n +${PREAMBLE_LENGTH} ${LINUX_SOURCE} >> ${MAC_SOURCE} 28echo "Done with generating ${MAC_SOURCE}" 29