1 ?RCS: $Id: d_const.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: d_const.U,v $
12 ?RCS: Revision 3.0.1.1 1993/11/10 17:33:41 ram
13 ?RCS: patch14: stronger const check with added typedef for MIPS cc
15 ?RCS: Revision 3.0 1993/08/18 12:05:51 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
18 ?MAKE:d_const: cat rm cc ccflags Setvar
19 ?MAKE: -pick add $@ %<
21 ?S: This variable conditionally defines the HASCONST symbol, which
22 ?S: indicates to the C program that this C compiler knows about the
26 ?C: This symbol, if defined, indicates that this C compiler knows about
27 ?C: the const type. There is no need to actually test for that symbol
28 ?C: within your programs. The mere use of the "const" keyword will
29 ?C: trigger the necessary tests.
31 ?H:?%<:#$d_const HASCONST /**/
32 ?H:?%<:#ifndef HASCONST
40 : check for const keyword
42 echo 'Checking to see if your C compiler knows about "const"...' >&4
43 $cat >const.c <<'EOCP'
44 ?X: mmcg@bruce.cs.monash.edu.au reports that:
45 ?X: The MIPS cc compiler (V2.10) on a dec 5000 running Ultrix 4.2A
46 ?X: pretends to understand `const' but doesn't - it'll also fail to
47 ?X: handle typedefs properly if they're declared const. To guard
48 ?X: against this, boost up the test by using an explicit typedef...
49 typedef struct spug { int drokk; } spug;
56 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
61 echo "Nope, it doesn't."
65 $rm -f const.c const.o