1cb93a386Sopenharmony_ci#!/bin/bash
2cb93a386Sopenharmony_ci# Copyright (c) 2016 The Chromium Authors. All rights reserved.
3cb93a386Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
4cb93a386Sopenharmony_ci# found in the LICENSE file.
5cb93a386Sopenharmony_ci
6cb93a386Sopenharmony_ci# This is shared among scripts to build and copy ICU data.
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci[ -r icudefs.mk ] && \
9cb93a386Sopenharmony_ci    egrep '^## Top-level Makefile.in for ICU' Makefile > /dev/null || \
10cb93a386Sopenharmony_ci    { echo "cd to the ICU build directory before running "$0"." >&2; exit 1; }
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ciTOPSRC2=$(egrep '^top_srcdir =' Makefile | cut -d ' ' -f 3)
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_ciif [[ ! "${TOPSRC}/source" -ef "${TOPSRC2}" ]]; then
15cb93a386Sopenharmony_ci  echo "ICU was built from the source in ${TOPSRC2}, but";
16cb93a386Sopenharmony_ci  echo "this script is in ${TOPSRC}.";
17cb93a386Sopenharmony_ci  exit 2
18cb93a386Sopenharmony_cifi
19cb93a386Sopenharmony_ci
20cb93a386Sopenharmony_ciecho "Working on ICU built from ${TOPSRC2}"
21cb93a386Sopenharmony_ci
22cb93a386Sopenharmony_ciVERSION=$(egrep '^SO_TARGET.*MAJOR' icudefs.mk | cut -d ' ' -f 3)
23cb93a386Sopenharmony_ciecho "The major version of ICU is $VERSION"
24