index 57822e50c0aadd47b80e43f1e390754bda226996..989b8bcb2ce6727184062b5f0eb9489993a5acbf 100644 (file)
anymach = 0; cmach = 1; mach386 = 10; mach68k = 20;
(* operation system types *)
- anyos = 0; linux = 1; freebsd = 2; openbsd = 3; win32 = 4;
+ anyos = 0; linux = 1; freebsd = 2; openbsd = 3; win32 = 4; cygwin = 5; darwin = 6;
(* compiler types *)
anycp = 0; cpnative = 1; cpfront = 2;
END;
VAR
- err: INTEGER;
+ werr, err: INTEGER;
mno, rno: INTEGER; (* num modules *)
modList, lnkList, cmpList: ARRAY maxImps OF Module;
def: Selector; (* with head, global list of selectors *)
Log.String(" -Xi path Use executable file for internal linker (native only)"); Log.Ln;
Log.String(" -Cg params Pass parameters to Component Pasacal compiler directly"); Log.Ln;
Log.String(" -Ci params Pass parameters to internal linker directly"); Log.Ln;
-(*
Log.String(" -a Enable automatic dependency resolution"); Log.Ln;
-*)
Log.String(" -o name Generate executable file"); Log.Ln;
Log.String(" -j num Specifies the number of jobs to run simultaneously"); Log.Ln;
Log.String(' -D ident["+"|"-"] Add preprocessor selector'); Log.Ln;
Strings.ToLower(s, s);
IF s$ = "none" THEN os := anyos
ELSIF s$ = "linux" THEN os := linux
+ ELSIF s$ = "freebsd" THEN os := freebsd
+ ELSIF s$ = "openbsd" THEN os := openbsd
+ ELSIF s$ = "win32" THEN os := win32
+ ELSIF s$ = "cygwin" THEN os := cygwin
+ ELSIF s$ = "darwin" THEN os := darwin
ELSE Log.String("unknwon os "); Log.String(s); Log.Ln; INC(err)
END
| "g":
j := 0; (* find module in global list *)
WHILE (j < mno) & (modList[j].name$ # name$) DO INC(j) END;
IF j >= mno THEN
+ IF ~auto THEN
+ Log.String("module " + name + " required before " + m.name); Log.Ln; INC(werr)
+ END;
NEW(imp); imp.name := name$; imp.selectors := CopySelectorList(m.selectors);
modList[mno] := imp; INC(mno)
ELSE
END
END;
CheckSym(semicolon)
+ END;
+ LOOP (* preprocessor must read module fully *)
+ IF sym = end THEN
+ DevCPS.Get(sym);
+ IF sym = ident THEN
+ DevCPS.Get(sym);
+ IF sym = period THEN
+ IF DevCPS.name # SelfName THEN err(4) END;
+ EXIT
+ ELSIF sym = eof THEN
+ err(period);
+ EXIT
+ END
+ ELSIF sym = eof THEN
+ err(ident);
+ EXIT
+ END;
+ ELSIF sym = eof THEN
+ err(end);
+ EXIT
+ ELSE
+ DevCPS.Get(sym);
+ END
END
ELSE err(ident)
END;
END;
INC(i)
END;
+ INC(err, werr);
num := 0;
FOR i := 0 TO rno - 1 DO
Trace(modList[i], modList[i], num)
w.Program(cpcExe);
w.PutParam("-legacy");
PutParams(w, cpcArgs);
+ CASE compiler OF
+ | cpfront:
+ w.PutParam("-define+"); w.PutParam("CPFRONT");
+ w.PutParam("-define-"); w.PutParam("NATIVE");
+ | cpnative:
+ w.PutParam("-define-"); w.PutParam("CPFRONT");
+ w.PutParam("-define+"); w.PutParam("NATIVE");
+ END;
+ CASE processor OF
+ | mach386:
+ w.PutParam("-define+"); w.PutParam("I486");
+ w.PutParam("-define-"); w.PutParam("M68K");
+ | mach68k:
+ w.PutParam("-define+"); w.PutParam("I486");
+ w.PutParam("-define-"); w.PutParam("M68K");
+ ELSE
+ w.PutParam("-define-"); w.PutParam("I486");
+ w.PutParam("-define-"); w.PutParam("M68K");
+ END;
+ CASE os OF
+ | anyos:
+ w.PutParam("-define-"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define-"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | linux:
+ w.PutParam("-define+"); w.PutParam("POSIX");
+ w.PutParam("-define+"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define-"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | freebsd:
+ w.PutParam("-define+"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define+"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define-"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("CYGWIN");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | openbsd:
+ w.PutParam("-define+"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define+"); w.PutParam("OPENBSD");
+ w.PutParam("-define-"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("CYGWIN");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | win32:
+ w.PutParam("-define-"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define+"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("CYGWIN");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | cygwin:
+ w.PutParam("-define+"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define+"); w.PutParam("WIN32");
+ w.PutParam("-define+"); w.PutParam("CYGWIN");
+ w.PutParam("-define-"); w.PutParam("DARWIN");
+ | darwin:
+ w.PutParam("-define+"); w.PutParam("POSIX");
+ w.PutParam("-define-"); w.PutParam("LINUX");
+ w.PutParam("-define-"); w.PutParam("FREEBSD");
+ w.PutParam("-define-"); w.PutParam("OPENBSD");
+ w.PutParam("-define-"); w.PutParam("WIN32");
+ w.PutParam("-define-"); w.PutParam("CYGWIN");
+ w.PutParam("-define+"); w.PutParam("DARWIN");
+ END;
+ CASE linker OF
+ | dev2:
+ w.PutParam("-define+"); w.PutParam("DEV2");
+ ELSE
+ w.PutParam("-define-"); w.PutParam("DEV2");
+ END;
w.PutParam(m.path);
w.Execute(ok);
IF ok THEN
ASSERT((exe # NIL) & (exe^ # ""), 20);
ASSERT(processor = mach386, 21);
ASSERT(compiler = cpnative, 22);
- ASSERT(os IN {linux, freebsd, openbsd, win32}, 23);
p := DswProcs.dir.New();
p.Program(cplExe);
IF os # anyos THEN
| linux: p.PutParam("linux")
| freebsd: p.PutParam("freebsd")
| openbsd: p.PutParam("openbsd")
- | win32: p.PutParam("win32")
+ | win32, cygwin: p.PutParam("win32")
+ | darwin: p.PutParam("darwin")
END
END;
p.PutParam("-kernel");