This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert 3ffc8c70ad4af0e7b: remove BOOTSTRAP_CHARSET (khw's request)
[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:
ac56dd77 11?MAKE:ebcdic: 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:.
959f3c4c 17?C:EBCDIC:
6d41512c 18?C: This symbol, if defined, indicates that this system uses
959f3c4c
JH
19?C: EBCDIC encoding.
20?C:.
21?H:#$ebcdic EBCDIC /**/
22?H:.
0065f4af 23?F:!try
959f3c4c 24?LINT:set ebcdic
d7a2632b 25: Determine if this is an EBCDIC system
959f3c4c
JH
26echo " "
27echo "Determining whether or not we are on an EBCDIC system..." >&4
0f00356b 28$cat >try.c <<'EOM'
959f3c4c
JH
29int main()
30{
31 if ('M'==0xd4) return 0;
32 return 1;
33}
34EOM
35
36val=$undef
0f00356b 37set try
959f3c4c 38if eval $compile_ok; then
0f00356b 39 if $run ./try; then
45793be8 40 echo "You seem to speak EBCDIC." >&4
959f3c4c
JH
41 val="$define"
42 else
0f00356b 43 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
959f3c4c
JH
44 fi
45else
46 echo "I'm unable to compile the test program." >&4
45793be8 47 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
959f3c4c 48fi
2cb64bf6 49$rm_try
959f3c4c
JH
50set ebcdic
51eval $setvar
52