Browse Source

Compilation fix, year update

Arturs Jefimovs 1 month ago
parent
commit
9e77391dd2
12 changed files with 90 additions and 22 deletions
  1. 9 4
      Data/bin/compile.sh
  2. 1 1
      src/Autodoc/Autodoc.Mod
  3. 14 10
      src/Builder.Mod
  4. 1 1
      src/Editor.Mod
  5. 1 1
      src/EditorText.Mod
  6. 1 1
      src/Fob.Mod
  7. 1 1
      src/FreeOberon.Mod
  8. 16 0
      src/Info.plist
  9. 1 1
      src/OV.Mod
  10. 1 1
      src/Term.Mod
  11. 1 1
      src/pack_linux.sh
  12. 43 0
      src/pack_macos.sh

+ 9 - 4
Data/bin/compile.sh

@@ -40,14 +40,19 @@ PATH="$OFRDIR:$PATH"
 export OBERON=".:$DIR/../../src:$OFRDIR/Lib/Sym"
 OFR="ofront+ -s -88 -7w"
 
+NEEDPATCH=0
+MAINFLAG=$2
+if [[ "$MAINFLAG" == "-M" ]]; then
+  MAINFLAG=-m
+  NEEDPATCH=1
+fi
 
-$OFR $2 "$FNAME"
+$OFR $MAINFLAG "$FNAME"
 retcode=$?
 
 echo "AA=[$THISOS], BB=[$2]" >> /tmp/b
-if [[ "$THISOS" == "macOS" && "$2" == "-m" ]]; then
-  CFILE="$(basename "${FNAME/.Mod/}").c"
-  "$DIR/patch.sh" "$CFILE"
+if [[ "$THISOS" == "macOS" && "$NEEDPATCH" == "1" ]]; then
+  "$DIR/patch.sh" "$(basename "${FNAME/.Mod/}").c"
 fi
 
 cd ..

+ 1 - 1
src/Autodoc/Autodoc.Mod

@@ -4,7 +4,7 @@ IMPORT Files, Texts, Out, Args, Strings, Platform, Dir,
 
 CONST
   version = '1.0.0-alpha.1';
-  year = 2023;
+  year = 2025;
 
   delim = Platform.PathDelimiter;
 

+ 14 - 10
src/Builder.Mod

@@ -1,5 +1,5 @@
 MODULE Builder;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 
@@ -208,7 +208,7 @@ BEGIN
   s[j] := 0X
 END AppendArgument;*)
 
-PROCEDURE RunCommand(IN fname, mod: ARRAY OF CHAR; link, main: BOOLEAN;
+PROCEDURE RunCommand(IN fname, mod: ARRAY OF CHAR; link, main, hasGraph: BOOLEAN;
     list: Module; onError: ErrorHandler): BOOLEAN;
 CONST bufLen = 20480;
 VAR buf: ARRAY bufLen OF SHORTCHAR;
@@ -238,7 +238,10 @@ BEGIN ok := TRUE;
   IF ok THEN
     s := fname$; Func.FixFname(s); Strings.Append(s, cmd);
 
-    IF main THEN Strings.Append(' -m', cmd)
+    IF main THEN
+      IF hasGraph THEN Strings.Append(' -M', cmd)
+      ELSE Strings.Append(' -m', cmd)
+      END
     ELSIF link & (list # NIL) THEN
       p := list;
       WHILE p.next # NIL DO
@@ -282,9 +285,9 @@ BEGIN ok := TRUE;
   END ;
 RETURN success END RunCommand;
 
-PROCEDURE Compile(IN fname, mod: ARRAY OF CHAR; main: BOOLEAN;
+PROCEDURE Compile(IN fname, mod: ARRAY OF CHAR; main, hasGraph: BOOLEAN;
   onError: ErrorHandler): BOOLEAN;
-BEGIN RETURN RunCommand(fname, mod, FALSE, main, NIL, onError)
+BEGIN RETURN RunCommand(fname, mod, FALSE, main, hasGraph, NIL, onError)
 END Compile;
 
 PROCEDURE Link(IN fname, mod: ARRAY OF CHAR;
@@ -293,7 +296,7 @@ PROCEDURE Link(IN fname, mod: ARRAY OF CHAR;
 VAR ok: BOOLEAN;
   s: ARRAY 2048 OF CHAR;
   res: INTEGER;
-BEGIN ok := RunCommand(fname, mod, TRUE, FALSE, list, onError);
+BEGIN ok := RunCommand(fname, mod, TRUE, FALSE, FALSE, list, onError);
   IF ok THEN (* Move executable file if workDir is non-standard *)
     s := mod$; IF Config.isWindows THEN Strings.Append('.exe', s) END;
     exename := '_Build/'; Strings.Append(s, exename);
@@ -483,19 +486,20 @@ PROCEDURE CompileAll*(modules: Module;
     VAR exename: ARRAY OF CHAR; moveToCwd: BOOLEAN;
     onError: ErrorHandler): BOOLEAN;
 VAR p, last: Module;
-  ok: BOOLEAN;
+  ok, hasGraph: BOOLEAN;
 BEGIN exename[0] := 0X;
   IF modules # NIL THEN
-    ok := TRUE; p := modules;
+    ok := TRUE; hasGraph := FALSE; p := modules;
     WHILE ok & (p.next # NIL) DO
       IF ModuleExists(p.fname) THEN
-        IF ~Compile(p.fname, '', FALSE, onError) THEN ok := FALSE END
+        IF ~Compile(p.fname, '', FALSE, FALSE, onError) THEN ok := FALSE END
       ELSIF ~IsSysModule(p.s) THEN ok := FALSE
+      ELSIF p.s = 'Graph' THEN hasGraph := TRUE
       END;
       p := p.next
     END;
     IF ok THEN
-      IF ~ModuleExists(p.fname) OR ~Compile(p.fname, '', TRUE, onError) THEN
+      IF ~ModuleExists(p.fname) OR ~Compile(p.fname, '', TRUE, hasGraph, onError) THEN
         ok := FALSE
       END;
       ok := ok & Link(p.fname, p.s, modules, exename, onError, moveToCwd)

+ 1 - 1
src/Editor.Mod

@@ -1,5 +1,5 @@
 MODULE Editor;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/EditorText.Mod

@@ -1,5 +1,5 @@
 MODULE EditorText;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/Fob.Mod

@@ -1,5 +1,5 @@
 MODULE Fob;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/FreeOberon.Mod

@@ -1,5 +1,5 @@
 MODULE FreeOberon;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 16 - 0
src/Info.plist

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleName</key>
+    <string>FreeOberon</string>
+    <key>CFBundleIdentifier</key>
+    <string>com.yourcompany.freeoberon</string>
+    <key>CFBundleVersion</key>
+    <string>1.0</string>
+    <key>CFBundleExecutable</key>
+    <string>FreeOberon</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+</dict>
+</plist>

+ 1 - 1
src/OV.Mod

@@ -1,5 +1,5 @@
 MODULE OV;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/Term.Mod

@@ -1,5 +1,5 @@
 MODULE Term;
-(* Copyright 2017-2023 Arthur Yefimov
+(* Copyright 2017-2025 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/pack_linux.sh

@@ -21,7 +21,7 @@ echo
 git stash
 
 echo ================================
-echo      BEGIN PACK
+echo      BEGIN PACK LINUX
 
 [ -d "$FOLDER" ] && mv $FOLDER $BAKFOLDER
 mkdir -p $FOLDER/_Build

+ 43 - 0
src/pack_macos.sh

@@ -0,0 +1,43 @@
+#!/bin/bash
+
+WORKDIR=../../macos_pack
+FOLDER=$WORKDIR/FreeOberon.app
+BAKPOSTFIX=-OLD-$RANDOM$RANDOM
+BAKFOLDER=$FOLDER$BAKPOSTFIX
+PKGFILE=FreeOberon.pkg
+
+echo This script will create a directory named $FOLDER
+echo and copy the required files to form Free Oberon package for macOS.
+echo If the above directory exists, the old contents will be renamed
+echo by appending this postfix: $BAKPOSTFIX
+echo "Then the created (inner) directory FreeOberon will be packaged"
+echo and the archive will be in $PKGFILE
+echo Before this process, git stash will be called. Then: git stash apply.
+echo
+read -p "Are you sure you want to continue? " -n 1 -r
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1; fi
+echo
+
+#git stash
+
+echo ================================
+echo      BEGIN PACK MACOS
+
+[ -d "$FOLDER" ] && mv $FOLDER $BAKFOLDER
+mkdir -p $FOLDER/Contents/MacOS
+mkdir -p $FOLDER/Contents/Resources
+
+cp ../FreeOberon $FOLDER/Contents/MacOS
+#cp ../fob $FOLDER/Contents/MacOS
+cp Info.plist $FOLDER/Contents
+
+cp -r ../Data $FOLDER/Contents/MacOS
+cp -r ../Programs $FOLDER/Contents/MacOS
+#cp ../install.sh $FOLDER/Contents/MacOS
+cp ../*.{md,sh} $FOLDER/
+cp ../LICENSE $FOLDER/
+
+echo      END PACK.
+echo ================================
+
+#git stash apply