This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add bootstrap_charset/BOOTSTRAP_CHARSET for non-ASCII architectures
[metaconfig.git] / U / ebcdic / ebcdic.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: ebcdic.U,v 3.0.1.3 1994/05/06 15:11:49 doughera Exp $
2?RCS:
3?RCS: Copyright (c) 1998 Andy Dougherty
4?RCS:
5?RCS: You may distribute under the terms of either the GNU General Public
6?RCS: License or the Artistic License, as specified in the README file.
7?RCS:
8?RCS: Original author Jarkko Hietaniemi <jhi@iki.fi>
9?RCS: Merged into dist by Andy Dougherty July 13, 1998
10?RCS:
6d41512c 11?MAKE:ebcdic bootstrap_charset: Compile Setvar cat rm_try run
959f3c4c
JH
12?MAKE: -pick add $@ %<
13?S:ebcdic:
14?S: This variable conditionally defines EBCDIC if this
6d41512c
MBT
15?S: system uses EBCDIC encoding.
16?S:.
17?S:bootstrap_charset:
18?S: This variable conditionally defines BOOTSTRAP_CHARSET if
19?S: this system uses non-ASCII encoding.
959f3c4c
JH
20?S:.
21?C:EBCDIC:
6d41512c 22?C: This symbol, if defined, indicates that this system uses
959f3c4c
JH
23?C: EBCDIC encoding.
24?C:.
6d41512c
MBT
25?C:BOOTSTRAP_CHARSET:
26?C: This symbol, if defined, indicates that this system needs
27?C: converting various files to the native character set before
28?C: bringing up perl on a system that has a non-ASCII character
29?C: set and no working perl.
30?C:.
31?LINT:extern BOOTSTRAP_CHARSET
32?D:bootstrap_charset=undef
959f3c4c 33?H:#$ebcdic EBCDIC /**/
6d41512c 34?H:#$bootstrap_charset BOOTSTRAP_CHARSET /**/
959f3c4c 35?H:.
0065f4af 36?F:!try
959f3c4c 37?LINT:set ebcdic
d7a2632b 38: Determine if this is an EBCDIC system
959f3c4c
JH
39echo " "
40echo "Determining whether or not we are on an EBCDIC system..." >&4
0f00356b 41$cat >try.c <<'EOM'
959f3c4c
JH
42int main()
43{
44 if ('M'==0xd4) return 0;
45 return 1;
46}
47EOM
48
6d41512c
MBT
49case "$BOOTSTRAP_CHARSET" in
50 Y|y|define) bootstrap_charset=$define ;;
51 *) bootstrap_charset=$undef ;;
52esac
53
959f3c4c 54val=$undef
0f00356b 55set try
959f3c4c 56if eval $compile_ok; then
0f00356b 57 if $run ./try; then
45793be8 58 echo "You seem to speak EBCDIC." >&4
959f3c4c
JH
59 val="$define"
60 else
0f00356b 61 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
959f3c4c
JH
62 fi
63else
64 echo "I'm unable to compile the test program." >&4
45793be8 65 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
959f3c4c 66fi
2cb64bf6 67$rm_try
959f3c4c
JH
68set ebcdic
69eval $setvar
70