char pass0
[20] = "/lib/c0";
char pass1
[20] = "/lib/c1";
char pass2
[20] = "/lib/c2";
char passp
[20] = "/lib/cpp";
char *pref
= "/lib/crt0.o";
char **pv
, *ptemp
[MAXOPT
], **pvt
;
int nc
, nl
, i
, j
, c
, f20
, nxo
, na
;
i
= nc
= nl
= f20
= nxo
= 0;
setbuf(stdout
, (char *)NULL
);
if(*argv
[i
] == '-') switch (argv
[i
][1]) {
if ((c
=getsuf(outfile
))=='c'||c
=='o') {
error("Would overwrite %s", outfile
);
error("-f overwrites earlier option", (char *)NULL
);
if (pv
>= ptemp
+MAXOPT
) {
error("Too many DIUC options", (char *)NULL
);
error("-t overwrites earlier option", (char *)NULL
);
error("-B overwrites earlier option", (char *)NULL
);
npassname
= "/usr/src/cmd/c/o";
if((c
=getsuf(t
))=='c' || c
=='s'|| exflag
) {
error("Too many source files", (char *)NULL
);
error("Too many object/library files", (char *)NULL
);
if (npassname
&& chpass
==0)
if (chpass
&& npassname
==0)
npassname
= "/usr/src/cmd/c/";
for (t
=chpass
; *t
; t
++) {
strcpy (pass0
, npassname
);
strcpy (pass1
, npassname
);
strcpy (pass2
, npassname
);
strcpy (passp
, npassname
);
pref
= proflag
? "/lib/fmcrt0.o" : "/lib/fcrt0.o";
tmp0
= copy("/tmp/ctm0a");
while (access(tmp0
, 0)==0)
while((creat(tmp0
, 0400))<0) {
error("cc: cannot create temp", NULL
);
if (signal(SIGINT
, SIG_IGN
) != SIG_IGN
)
if (signal(SIGTERM
, SIG_IGN
) != SIG_IGN
)
(tmp1
= copy(tmp0
))[8] = '1';
(tmp2
= copy(tmp0
))[8] = '2';
(tmp3
= copy(tmp0
))[8] = '3';
(tmp5
= copy(tmp0
))[8] = '5';
(tmp4
= copy(tmp0
))[8] = '4';
printf("%s:\n", clist
[i
]);
if (getsuf(clist
[i
])=='s') {
tmp4
= setsuf(clist
[i
], 'i');
av
[2] = exflag
? "-" : tmp4
;
for(pv
=ptemp
; pv
<pvt
; pv
++)
if (callsys(passp
, av
)) {
if (callsys(pass0
, av
)) {
assource
= tmp3
= setsuf(clist
[i
], 's');
if (callsys(pass2
, av
)) {
av
[3] = setsuf(clist
[i
], 'o');
if (callsys("/bin/as", av
) > 1) {
eflag
|= callsys("/bin/ld", av
);
if (nc
==1 && nxo
==1 && eflag
==0)
cunlink(setsuf(clist
[0], 'o'));
fprintf(exflag
?stderr
:stdout
, s
, x
);
putc('\n', exflag
? stderr
: stdout
);
if (c
<=14 && c
>2 && *s
++=='.')
printf("Can't find %s\n", f
);
printf("Fatal error in %s\n", f
);
return((status
>>8) & 0377);
tsp
= tsa
= malloc(CHSPACE
+50);
error("no space for file names", (char *)NULL
);