char pass0
[40] = "/lib/ccom";
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;
if(*argv
[i
] == '-') switch (argv
[i
][1]) {
if ((t
=getsuf(outfile
))=='c'||t
=='o') {
error("Would overwrite %s", outfile
);
case 'W': /* deprecated */
fprintf(stderr
, "(Warning): -P option obsolete\n");
error("-f overwrites earlier option",0);
error("Too many DIUC options", 0);
error("-t overwrites earlier option",0);
error("-B overwrites earlier option", 0);
strcpyn(alist
, argv
[i
], 19);
if((c
=getsuf(t
))=='c' || c
=='s'|| exflag
) {
error("Too many source files",0);
error("Too many object/library files",0);
if (npassname
&& chpass
==0)
if (chpass
&& npassname
==0)
strcpy (pass0
, npassname
);
strcpy (pass2
, npassname
);
strcpy (passp
, npassname
);
pref
= proflag
? "/lib/fmcrt0.o" : "/lib/fcrt0.o";
sprintf(tmp0
,"/tmp/ctm%05.5da",getpid());
while((c
=fopen(tmp0
, "r")) != NULL
) {
while((creat(tmp0
, 0400))<0)
if (signal(SIGINT
, SIG_IGN
) != SIG_IGN
) /* interrupt */
if (signal(SIGTERM
, SIG_IGN
) != SIG_IGN
) /* terminate */
(tmp1
= copy(tmp0
))[13] = '1';
(tmp2
= copy(tmp0
))[13] = '2';
(tmp3
= copy(tmp0
))[13] = '3';
(tmp5
= copy(tmp0
))[13] = '5';
(tmp4
= copy(tmp0
))[13] = '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
++)
assource
= tmp3
= setsuf(clist
[i
], 's');
for (i
= 3; i
< 10 && av
[i
] != 0; i
++)
if (callsys(pass0
, av
)) {
if (callsys(pass2
, av
)) {
av
[2] = 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
);
if ((t
=(status
&0377)) != 0 && t
!=14) {
if (t
!=2) /* interrupt */
printf("Fatal error in %s\n", f
);
return((status
>>8) & 0377);
tsp
= tsa
= i
= calloc(CHSPACE
+50,1);
error("no space for file names");