1#!/bin/sh2#See http://www.unicode.org/reports/tr44/3#4#Me Enclosing_Mark an enclosing combining mark5#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)6#Cf Format a format control character7#8cd "$(dirname "$0")"9UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h1011wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \12http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt &&13if ! test -d uniset; then14git clone https://github.com/depp/uniset.git &&15( cd uniset && git checkout 4b186196dd )16fi &&17(18cd uniset &&19if ! test -x uniset; then20autoreconf -i &&21./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'22fi &&23make24) &&25UNICODE_DIR=. && export UNICODE_DIR &&26cat >$UNICODEWIDTH_H <<-EOF27static const struct interval zero_width[] = {28$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD)29};30static const struct interval double_width[] = {31$(uniset/uniset --32 eaw:F,W)32};33EOF