jdk/make/java/nio/genCoder.sh
author jjh
Fri, 09 Dec 2011 12:56:22 -0800
changeset 11277 e3a1c90dd439
parent 5506 202f599c92aa
permissions -rw-r--r--
7117053: Fix build warnings in com/sun/tools/jdi/* Summary: Warnings fixed. Also reviewed by serguei.spitsyn@oracle.com, who is not yet an openjdk reviewer Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#! /bin/sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     4
# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     9
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    11
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    24
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    25
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# Generate charset coder and decoder classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# Environment variables required from make: SED SPP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
what=$1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
SRC=$2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
DST=$3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
if [ x$what = xdecoder ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  echo '  '$SRC '--('$what')-->' $DST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  $SPP <$SRC >$DST \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    -K$what \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    -DA='A' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    -Da='a' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    -DCode='Decode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    -Dcode='decode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    -DitypesPhrase='bytes in a specific charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    -DotypesPhrase='sixteen-bit Unicode characters' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    -Ditype='byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    -Dotype='character' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    -DItype='Byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    -DOtype='Char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    -Dcoder='decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    -DCoder='Decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    -Dcoding='decoding' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    -DOtherCoder='Encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    -DreplTypeName='string' \
898
1c4e95595472 6681798: (build) CharsetEncoder.java fails to compile in openjdk6 on ubutu 8.04
sherman
parents: 2
diff changeset
    56
    -DdefaultRepl='"\\uFFFD"' \
1c4e95595472 6681798: (build) CharsetEncoder.java fails to compile in openjdk6 on ubutu 8.04
sherman
parents: 2
diff changeset
    57
    -DdefaultReplName='<tt>"\&#92;uFFFD"<\/tt>' \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    -DreplType='String' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    -DreplFQType='java.lang.String' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    -DreplLength='length()' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    -DItypesPerOtype='CharsPerByte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    -DnotLegal='not legal for this charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    -Dotypes-per-itype='chars-per-byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    -DoutSequence='Unicode character'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
elif [ x$what = xencoder ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  echo '  '$SRC '--('$what')-->' $DST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
  $SPP <$SRC >$DST \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    -K$what \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    -DA='An' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    -Da='an' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    -DCode='Encode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    -Dcode='encode' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    -DitypesPhrase='sixteen-bit Unicode characters' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    -DotypesPhrase='bytes in a specific charset' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    -Ditype='character' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    -Dotype='byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    -DItype='Char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    -DOtype='Byte' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    -Dcoder='encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    -DCoder='Encoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    -Dcoding='encoding' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    -DOtherCoder='Decoder' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    -DreplTypeName='byte array' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
898
1c4e95595472 6681798: (build) CharsetEncoder.java fails to compile in openjdk6 on ubutu 8.04
sherman
parents: 2
diff changeset
    87
    -DdefaultReplName='<tt>{<\/tt>\&nbsp;<tt>(byte)'"'"\\?"'"'<\/tt>\&nbsp;<tt>}<\/tt>' \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    -DreplType='byte[]' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    -DreplFQType='byte[]' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    -DreplLength='length' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    -DItypesPerOtype='BytesPerChar' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    -DnotLegal='not a legal sixteen-bit Unicode sequence' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    -Dotypes-per-itype='bytes-per-char' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    -DoutSequence='byte sequence in the given charset'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  echo Illegal coder type: $what
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
fi