1 ?RCS: $Id: cc.U,v 3.0.1.4 1995/05/12 12:06:47 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, 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 3.0.
12 ?RCS: Revision 3.0.1.4 1995/05/12 12:06:47 ram
13 ?RCS: patch54: may now abort Configure when cc does not work
15 ?RCS: Revision 3.0.1.3 1995/01/11 15:20:11 ram
16 ?RCS: patch45: changed gcc checking message to a more explicit one (WED)
18 ?RCS: Revision 3.0.1.2 1994/10/29 16:04:29 ram
19 ?RCS: patch36: detect gcc even when not called as 'gcc' (ADO)
20 ?RCS: patch36: simplified gcc version checking (ADO)
21 ?RCS: patch36: added ?F: line for metalint file checking
23 ?RCS: Revision 3.0.1.1 1994/05/06 14:26:06 ram
24 ?RCS: patch23: added support for gcc version (ADO)
26 ?RCS: Revision 3.0 1993/08/18 12:05:30 ram
27 ?RCS: Baseline for dist 3.0 netwide release.
29 ?MAKE:cc gccversion: cat contains sysman +large cpp rm \
30 Mcc Myread Guess Options Oldconfig Loc test
31 ?MAKE: -pick add $@ %<
33 ?S: This variable holds the name of a command to execute a C compiler which
34 ?S: can resolve multiple global references that happen to have the same
35 ?S: name. Usual values are 'cc', 'Mcc', 'cc -M', and 'gcc'.
38 ?S: If GNU cc (gcc) is used, this variable holds '1' or '2' to
39 ?S: indicate whether the compiler is version 1 or 2. This is used in
40 ?S: setting some of the default cflags. It is set to '' if not gcc.
46 : see if we need a special compiler
54 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
55 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
67 ?X: I've received sensible complaints about how this prompt. It's
68 ?X: wordy, hard for the novice to check out, and almost never relevant.
69 ?X: I'll only include it if it looks like we need Mcc or cc -M, though
70 ?X: I have no idea if anyone ever needs them anymore. --A.D. 2/1998.
73 On some older systems the default C compiler will not resolve multiple global
74 references that happen to have the same name. On some such systems the "Mcc"
75 command may be used to force these to be resolved. On other systems a "cc -M"
76 command is required. (Note that the -M flag on other systems indicates a
77 memory model to use!) If you have the Gnu C compiler, you might wish to use
83 rp="Use which C compiler?"
91 rp="Use which C compiler?"
95 : Look for a hint-file generated 'call-back-unit'. Now that the
96 : user has specified the compiler, we may need to set or change some
98 if $test -f cc.cbu; then
101 ?X: Check if they have gcc in any guise. This is really only needed
102 ?X: if the user has version 1.x.x and needs -fpcc-struct-return. Alas
103 ?X: BSD/386 ships a version of gcc 1.4.2 and calls it cc. Hence the
104 ?X: paranoid test -- ADO.
106 echo "Checking for GNU cc in disguise and/or its version number..." >&4
107 $cat >gccvers.c <<EOM
112 printf("%s\n", __VERSION__);
120 if $cc -o gccvers gccvers.c; then
121 gccversion=`./gccvers`
122 case "$gccversion" in
123 '') echo "You are not using GNU cc." ;;
124 *) echo "You are using GNU cc $gccversion." ;;
128 echo "*** WHOA THERE!!! ***" >&4
129 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
130 ?X: using -K will prevent aborting--maybe they're cross compiling?
133 echo " You'd better start hunting for one and let me know about it." >&4
139 case "$gccversion" in
140 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;