This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Generate a valid config.h even if stdarg.h and varargs.h are both missing.
[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:
2cb64bf6 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
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:.
0065f4af 25?F:!try
959f3c4c 26?LINT:set ebcdic
d7a2632b 27: Determine if this is an EBCDIC system
959f3c4c
JH
28echo " "
29echo "Determining whether or not we are on an EBCDIC system..." >&4
0f00356b 30$cat >try.c <<'EOM'
959f3c4c
JH
31int main()
32{
33 if ('M'==0xd4) return 0;
34 return 1;
35}
36EOM
37
38val=$undef
0f00356b 39set try
959f3c4c 40if eval $compile_ok; then
0f00356b 41 if $run ./try; then
45793be8 42 echo "You seem to speak EBCDIC." >&4
959f3c4c
JH
43 val="$define"
44 else
0f00356b 45 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
959f3c4c
JH
46 fi
47else
48 echo "I'm unable to compile the test program." >&4
45793be8 49 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
959f3c4c 50fi
2cb64bf6 51$rm_try
959f3c4c
JH
52set ebcdic
53eval $setvar
54