Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / mkunidata
blob4adf667efcc1f26196167efdb5909f83d3163682
1 #! /bin/sh
3 echo Generating Unicode character properties data for newlib/libc/ctype
5 cd `dirname $0`
7 #############################################################################
8 # checks and (with option -u) download
10 case "$1" in
11 -h) echo "Usage: $0 [-h|-u|-i]"
12 echo "Generate case conversion table caseconv.t and character category table categories.t"
13 echo "from local Unicode file UnicodeData.txt."
14 echo ""
15 echo "Options:"
16 echo " -u download file from unicode.org first"
17 echo " -i copy file from /usr/share/unicode/ucd first"
18 echo " -h show this"
19 exit
21 -u)
22 wget () {
23 ref=`basename $1`
24 ref=`ls "$ref" 2> /dev/null || echo 01-Jan-1970`
25 curl -R -O --connect-timeout 55 -z "$ref" "$1"
28 echo downloading data from unicode.org
29 for data in UnicodeData.txt
30 do wget http://unicode.org/Public/UNIDATA/$data
31 done
33 -i)
34 echo copying data from /usr/share/unicode/ucd
35 for data in UnicodeData.txt
36 do cp /usr/share/unicode/ucd/$data .
37 done
39 esac
41 echo checking Unicode data file
42 for data in UnicodeData.txt
43 do if [ -r $data ]
44 then true
45 else echo $data not available, skipping table generation
46 exit
48 done
50 #############################################################################
51 # table generation
53 echo generating character category table for "isw*.c"
54 sh ./mkcategories
56 echo generating case conversion table for "tow*.c"
57 sh ./mkcaseconv
59 #############################################################################
60 # end