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: 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'.
36 ?S: Fervent ANSI compilers may be called 'c89'.
45 : see if we need a special compiler
53 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
54 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
66 ?X: I've received sensible complaints about how this prompt. It's
67 ?X: wordy, hard for the novice to check out, and almost never relevant.
68 ?X: I'll only include it if it looks like we need Mcc or cc -M, though
69 ?X: I have no idea if anyone ever needs them anymore. --A.D. 2/1998.
72 On some older systems the default C compiler will not resolve multiple global
73 references that happen to have the same name. On some such systems the "Mcc"
74 command may be used to force these to be resolved. On other systems a "cc -M"
75 command is required. (Note that the -M flag on other systems indicates a
76 memory model to use!) If you have the Gnu C compiler, you might wish to use
82 rp="Use which C compiler?"
90 rp="Use which C compiler?"
94 : Look for a hint-file generated 'call-back-unit'. Now that the
95 : user has specified the compiler, we may need to set or change some
97 if $test -f cc.cbu; then
100 : Quick sanity check, we will do a fuller one later when we know
101 : the various flags and libs
104 int main(int argc, char *argv[]) {
108 if $cc -o try try.c; then
111 echo "Uh-oh, the C compiler "$cc" doesn't seem to be working..." >&4
117 case "`$cc -v 2>&1`" in
120 if $test X"$trygcc" = Xyes; then
121 if gcc -o try try.c; then
123 echo "You seem to have a working gcc, though."
124 rp="Do you want to use it?"
128 [yY]*) cc=gcc; despair=no ;;
132 if $test X"$despair" = Xyes; then
133 echo "You need to find a working C compiler." >&4
134 echo "I cannot continue any further, aborting." >&4