xref: /aosp_15_r20/external/cronet/third_party/icu/scripts/data_common.sh (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#!/bin/bash
2# Copyright (c) 2016 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
6# This is shared among scripts to build and copy ICU data.
7
8[ -r icudefs.mk ] && \
9    egrep '^## Top-level Makefile.in for ICU' Makefile > /dev/null || \
10    { echo "cd to the ICU build directory before running "$0"." >&2; exit 1; }
11
12TOPSRC2=$(egrep '^top_srcdir =' Makefile | cut -d ' ' -f 3)
13
14if [[ ! "${TOPSRC}/source" -ef "${TOPSRC2}" ]]; then
15  echo "ICU was built from the source in ${TOPSRC2}, but";
16  echo "this script is in ${TOPSRC}.";
17  exit 2
18fi
19
20echo "Working on ICU built from ${TOPSRC2}"
21
22VERSION=$(egrep '^SO_TARGET.*MAJOR' icudefs.mk | cut -d ' ' -f 3)
23echo "The major version of ICU is $VERSION"
24