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