DEADSOFTWARE

cpmake: find compiler/linker executable using DswProcs.Directory.GetPath
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Mon, 24 Feb 2020 19:46:06 +0000 (22:46 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Mon, 24 Feb 2020 19:46:06 +0000 (22:46 +0300)
src/generic/Dsw/Mod/MakeMain.cp

index e4f49c21635861aacb2f1f5cc88dbc17249970d9..bd06566f501cd9a00c76bd1fa0af2f0704680a2a 100644 (file)
@@ -107,6 +107,8 @@ MODULE DswMakeMain;
     | 22: msg := "linker terminated with code ^2"
     | 23: msg := "unable to execute linker"
     | 24: msg := "trap occured"
+    | 25: msg := "compiler not installed"
+    | 26: msg := "linker not installed"
     ELSE
       Strings.IntToString(err, msg)
     END;
@@ -438,13 +440,19 @@ MODULE DswMakeMain;
     IF (exe # NIL) & (exe^ = "") THEN
       Error(19, "", "", 0)
     END;
-    IF cpcExe = NIL THEN
-      IF compiler = cpnative THEN cpcExe := NewStr("cpc486")
-      ELSIF compiler = cpfront THEN cpcExe := NewStr("cpfront")
+    IF (cpcExe = NIL) & (compiler # anycp) THEN
+      IF compiler = cpnative THEN cpcExe := DswProcs.dir.GetPath("cpc486")
+      ELSIF compiler = cpfront THEN cpcExe := DswProcs.dir.GetPath("cpfront")
+      END;
+      IF cpcExe = NIL THEN
+        Error(25, "", "", 0)
       END
     END;
-    IF cplExe = NIL THEN
-      IF linker = dev2 THEN cplExe := NewStr("cpl486") END
+    IF (cplExe = NIL) & (linker # anyint) THEN
+      cplExe := DswProcs.dir.GetPath("cpl486");
+      IF cplExe = NIL THEN
+        Error(26, "", "", 0)
+      END
     END
   END CheckParams;
 
@@ -776,13 +784,6 @@ MODULE DswMakeMain;
       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");
@@ -830,6 +831,13 @@ MODULE DswMakeMain;
       w.PutParam("-define-"); w.PutParam("WIN32");
       w.PutParam("-define-"); w.PutParam("CYGWIN");
       w.PutParam("-define+"); w.PutParam("DARWIN");
+    ELSE
+      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");
     END;
     CASE linker OF
     | dev2: