%%s 0/0/0 %%d D 1.1 26-Mar-82 12:31:11 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- cfc 493 asc 25-mar-82 07:28:44 v1.1 (sw-tools v1.1) #---------------------------------------------------------- ## cfc common block for 'fc' tool # put on a file called 'cfc' common / cfc / load, verbos, list, errcnt, debug integer load # YES/NO for link integer verbos # YES/NO for verbose mutterings on terminal integer list # YES/NO for listings of fortran compilations integer errcnt # running count of errors in compilation -- load # not performed unless errcnt == 0 integer debug # YES/NO if -d switch seen; passed on to ld #-h- flist 277 asc 25-mar-82 07:28:45 v1.1 (sw-tools v1.1) #------------------------------------------------------ # flist - common block # should be put on a file named 'flist' common /flist/ flevel, ffiles(FILENAMESIZE, FLMAX) integer flevel #pointer to current file character ffiles #list of files to process #-h- fc.r 5107 asc 25-mar-82 07:28:47 v1.1 (sw-tools v1.1) #-h- defns 37 asc 25-mar-82 07:28:19 v1.1 (sw-tools v1.1) define(EXTSIZE,4) define(FLMAX,25) #-h- main 1990 asc 25-mar-82 07:28:21 v1.1 (sw-tools v1.1) DRIVER(fc) character source(FILENAMESIZE), object(FILENAMESIZE), arg(FILENAMESIZE), ext(EXTSIZE), listfl(FILENAMESIZE), ldargs(ARGBUFSIZE), descr(PIDSIZE), spath(arith(FILENAMESIZE,*,3)) integer i, getarg, spawn, k, fortrn, loccom, index include flist include cfc string suffix IMAGE_SUFFIX string minusv "-v " string minusd "-d " string exto "obj" string extl "l" string ld "ld" flevel = 0 load = YES verbos = NO # initialize cfc and flist varibles list = NO debug = NO errcnt = 0 call query("usage: fc [-cdov] [-l[libr]] [-pproc] file ...") for (i=1; getarg(i, arg, FILENAMESIZE) != EOF; i=i+1) { if (arg(1) == '-' | arg(1) == '+') call fccmd(arg) else call fstack(arg) } for (k=1; k<=flevel; k=k+1) { call getext(ffiles(1,k), ext) if (ffiles(1,k) != '-' & ext(1) == 'f' & ext(2) == EOS) { if (index(ffiles(1,k), '/') > 0) call mklocl(ffiles(1,k), source) else call scopy(ffiles(1,k), 1, source, 1) call genfil(source, exto, object) if (list == YES) call genfil(source, extl, listfl) else listfl(1) = EOS if (fortrn(source, object, listfl, verbos, debug) == ERR) errcnt = errcnt + 1 } } if (load == YES & errcnt == 0) { i = 1 call stcopy(ld, 1, ldargs, i) call chcopy(' ', ldargs, i) if (verbos == YES) call stcopy(minusv, 1, ldargs, i) if (debug == YES) call stcopy(minusd, 1, ldargs, i) for (k=1; k<=flevel; k=k+1) { call getext(ffiles(1,k), ext) if (ffiles(1,k) != '-' & ext(1) == 'f' & ext(2) == EOS) call genfil(ffiles(1,k), exto, arg) else call scopy(ffiles(1,k), 1, arg, 1) call stcopy(arg, 1, ldargs, i) call chcopy(' ', ldargs, i) } ldargs(i-1) = EOS call impath(spath) if (loccom(ld, spath, suffix, arg) != BINARY) call error("Cannot locate ld image file.") if (verbos == YES) call remark(ldargs) if (spawn(arg, ldargs, descr, WAIT) == ERR) call remark("Error in linking process") } DRETURN end #-h- fccmd 484 asc 25-mar-82 07:28:23 v1.1 (sw-tools v1.1) ## fccmd -- handles switches in fc command line subroutine fccmd(arg) character arg(FILENAMESIZE) integer index include cfc call fold(arg) if (arg(1) == '-') if (arg(2) == 'p' | arg(2) == 'l') call fstack(arg) else { if (index(arg, 'c') > 0) load = NO if (index(arg, 'd') > 0) debug = YES if (index(arg, 'o') > 0) list = YES if (index(arg, 'v') > 0) verbos = YES } else call badarg(arg) if (debug == YES) list = YES return end #-h- fortrn 841 asc 25-mar-82 07:28:24 v1.1 (sw-tools v1.1) integer function fortrn(source, object, list, verbos, debug) character source(ARB), object(ARB), list(ARB), arg(80), pid(PIDSIZE) integer spawn, i, verbos, debug, junk, remove ifelse(FORT_COMP,F4P,string srcsw "/notr/nock/co:19./ro", string srcsw "/nosn/nova/nolo/ro") i = 1 call stcopy(COMP_NAME, 1, arg, i) call chcopy(' ', arg, i) junk = remove(object) # delete most recent version of object file call stcopy(object, 1, arg, i) if (list(1) != EOS) { call chcopy(',', arg, i) junk = remove(list) # delete most recent version of list file call stcopy(list, 1, arg, i) call stcopy("/-sp", 1, arg, i) } call chcopy('=', arg, i) call stcopy(source, 1, arg, i) call scopy(srcsw, 1, arg, i) call fold(arg) if (verbos == YES) call remark(arg) fortrn = spawn("local", arg, pid, WAIT) return end #-h- fstack 330 asc 25-mar-82 07:28:25 v1.1 (sw-tools v1.1) ## fstack - generate stack of input files subroutine fstack (iarg) integer i character iarg(FILENAMESIZE) include flist if (flevel < FLMAX) { flevel = flevel + 1 for (i=1; i<=FILENAMESIZE; i=i+1) ffiles(i,flevel) = iarg(i) call fold(ffiles(1, flevel)) } return end #-h- genfil 458 asc 25-mar-82 07:28:26 v1.1 (sw-tools v1.1) ## genfil -- generates file name with extension ext from in subroutine genfil(in, ext, out) integer i, j integer length character in(FILENAMESIZE), ext(EXTSIZE), out(FILENAMESIZE) string trmchr "/]" for (i=length(in); i > 0; i=i-1) if (index(trmchr, in(i)) > 0) break for (j=i+1; in(j) != EOS; j=j+1) if (in(j) == '.') break for (i=1; i < j; i=i+1) out(i) = in(i) call chcopy('.', out, i) call scopy(ext, 1, out, i) return end #-h- getext 456 asc 25-mar-82 07:28:27 v1.1 (sw-tools v1.1) subroutine getext(file, ext) character file(FILENAMESIZE), ext(EXTSIZE) integer i, j integer length, index string trmchr "/]" for (i=length(file); i > 0; i=i-1) if (index(trmchr, file(i)) > 0) break for (j=i+1; file(j) != EOS; j=j+1) if (file(j) == '.') { j = j + 1 break } for (i=1; file(j) != EOS & file(j) != ';' & file(j) != '.'; i=i+1) { ext(i) = file(j) j = j + 1 } ext(i) = EOS call fold(ext) return end #-h- fc.fmt 1461 asc 25-mar-82 07:28:52 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Fc (1) 12-Aug-81 fortran compiler .sy fc [-cdov] [-l[libr]] [-pproc] file ... .ds fc is the fortran compiler callable from the software tools shell. It accepts the following types of arguments: .in +3 .ti -3 1. Files whose names end in '.f' are assumed to be fortran source programs. They are compiled, and the object file is left on a file whose name is that of the source with '.obj' substituted for '.f'. .ti -3 2. Other arguments (except for the flags listed in 3 below) are assumed to be either loader flags, or object files, typically created by an earlier fc run. These programs, together with the results of any compilations, are loaded (in the order given) to produce an executable program. .ti -3 3. Four flags which affect the actions of the compiler are: .in +3 .ti -3 -c suppress the loading phase, as does any compilation error in any routine .ti -3 -d do whatever is necessary to prepare the object files for the system-specific debugger. This flag is passed on to `ld' if the -c switch is not specified. .ti -3 -o generates a fortran listing for 'file.f' on 'file.l' .ti -3 -v verbose option; prints name of file as it is compiled at the terminal .in -3 .in -3 .sa rc, the ratfor compiler, which provides a more pleasant programming dialect and environment ld, the loader, for descriptions of loader flags and process naming conventions .au Joe Sventek wrote the interface of fc to the DEC ForTran compiler. .bu %%E 1