This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
6326938bde0ecc1b3e9fa22d740ddf9b20bd31ec
[metaconfig.git] / U / ebcdic / ebcdic.U
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:
11 ?MAKE:ebcdic: Compile Setvar cat rm_try run
12 ?MAKE:  -pick add $@ %<
13 ?S:ebcdic:
14 ?S:     This variable conditionally defines EBCDIC if this
15 ?S:     system uses EBCDIC encoding.  Among other things, this
16 ?S:     means that the character ranges are not contiguous.
17 ?S:     See trnl.U
18 ?S:.
19 ?C:EBCDIC:
20 ?C:     This symbol, if defined, indicates that this system uses
21 ?C:     EBCDIC encoding.
22 ?C:.
23 ?H:#$ebcdic     EBCDIC          /**/
24 ?H:.
25 ?F:!try
26 ?LINT:set ebcdic
27 : Determine if this is an EBCDIC system
28 echo " "
29 echo "Determining whether or not we are on an EBCDIC system..." >&4
30 $cat >try.c <<'EOM'
31 int main()
32 {
33   if ('M'==0xd4) return 0;
34   return 1;
35 }
36 EOM
37
38 val=$undef
39 set try
40 if eval $compile_ok; then
41         if $run ./try; then
42                 echo "You seem to speak EBCDIC." >&4
43                 val="$define"
44         else
45                 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
46         fi
47 else
48         echo "I'm unable to compile the test program." >&4
49         echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
50 fi
51 $rm_try
52 set ebcdic
53 eval $setvar
54