diff options
author | Manoj Srivastava <srivasta@debian.org> | 2008-05-30 12:42:47 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2008-05-30 12:42:47 -0700 |
commit | ceb3507a8fca872770b3dcd7e5c5b36179ab95b0 (patch) | |
tree | b46b4e25cfff5f4c13a330b8428ceed343e3796c /mcon/U/ebcdic.U |
Import dist_3.5-236.orig.tar.gz
[dgit import orig dist_3.5-236.orig.tar.gz]
Diffstat (limited to 'mcon/U/ebcdic.U')
-rw-r--r-- | mcon/U/ebcdic.U | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mcon/U/ebcdic.U b/mcon/U/ebcdic.U new file mode 100644 index 0000000..6a1dda3 --- /dev/null +++ b/mcon/U/ebcdic.U @@ -0,0 +1,58 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic License, +?RCS: as specified in the README file that comes with the distribution. +?RCS: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic License; a copy of which may be found at the root +?RCS: of the source tree for dist 4.0. +?RCS: +?RCS: Copyright (c) 1998 Andy Dougherty +?RCS: +?RCS: Original author Jarkko Hietaniemi <jhi@iki.fi> +?RCS: Merged into dist by Andy Dougherty July 13, 1998 +?RCS: +?MAKE:ebcdic: Compile Setvar cat rm_try run +?MAKE: -pick add $@ %< +?S:ebcdic: +?S: This variable conditionally defines EBCDIC if this +?S: system uses EBCDIC encoding. Among other things, this +?S: means that the character ranges are not contiguous. +?S: See trnl.U +?S:. +?C:EBCDIC: +?C: This symbol, if defined, indicates that this system uses +?C: EBCDIC encoding. +?C:. +?H:#$ebcdic EBCDIC /**/ +?H:. +?F:!try +?LINT:set ebcdic +: look whether system uses EBCDIC +echo " " +echo "Determining whether or not we are on an EBCDIC system..." >&4 +$cat >try.c <<'EOM' +int main() +{ + if ('M'==0xd4) return 0; + return 1; +} +EOM +val=$undef +set try +if eval $compile_ok; then + if $run ./try; then + echo "You seem to speak EBCDIC." >&4 + val="$define" + else + echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4 + fi +else + echo "I'm unable to compile the test program." >&4 + echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4 +fi +$rm_try +set ebcdic +eval $setvar + |