summaryrefslogtreecommitdiff
path: root/mcon/U/ebcdic.U
blob: 6a1dda315148433e238a1d1919ed4fe75e1163b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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