Browse Source

Merge pull request #21 from proberon/master

mono tweaks (fixes for Unix-style systems)
John Gough 2 years ago
parent
commit
7f0eaf5838
9 changed files with 578 additions and 40 deletions
  1. 3 1
      .gitattributes
  2. 32 31
      gpcp/CompState.cp
  3. 8 4
      gpcp/IlasmUtil.cp
  4. 243 0
      gpcp/MkNetDistro.bat
  5. 259 0
      gpcp/MkNetDistro.sh
  6. 4 1
      gpcp/csharp/MsilAsm.cs
  7. 11 0
      gpcp/env.bat
  8. 14 0
      gpcp/env.sh
  9. 4 3
      libs/csharp/GPFiles.cs

+ 3 - 1
.gitattributes

@@ -37,6 +37,8 @@
 *.filters    text eol=crlf
 *.vcxitems   text eol=crlf
 
+*.bat        text eol=crlf
+*.sh         text eol=lf
 
 #*.sln       merge=binary
 #*.csproj    merge=binary
@@ -54,4 +56,4 @@
 #*.xproj     merge=binary
 #*.props     merge=binary
 #*.filters   merge=binary
-#*.vcxitems  merge=binary
+#*.vcxitems  merge=binary

+ 32 - 31
gpcp/CompState.cp

@@ -250,46 +250,47 @@ MODULE CompState;
     PROCEDURE Usage;
     BEGIN
       PrintLn("gardens point component pascal: " + GPCPcopyright.verStr);
+      PrintLn("(mono-tweaks paulreed@paddedcell.com 2022-12-22)");
       Message("Usage from the command line ...");
       IF RTS.defaultTarget = "net" THEN
 
 PrintLn("       $ gpcp [cp-options] file {file}");
 PrintLn("# CP Options ...");
 PrintLn("  General Options ---");
-PrintLn("       /copyright   ==> Display copyright notice");
-PrintLn("       /dostats     ==> Give a statistical summary");
-PrintLn("       /help        ==> Write out this usage message");
-PrintLn("       /list        ==> (default) Create *.lst file if errors");
-PrintLn("       /list+       ==> Unconditionally create *.lst file");
-PrintLn("       /list-       ==> Don't create error *.lst file");
-PrintLn("       /quiet       ==> Compile silently if possible");
-PrintLn("       /verbose     ==> Emit verbose diagnostics");
-PrintLn("       /version     ==> Write out version number");
-PrintLn("       /warn-       ==> Don't emit warnings");
-PrintLn("       /nowarn      ==> Don't emit warnings");
+PrintLn("       -copyright   ==> Display copyright notice");
+PrintLn("       -dostats     ==> Give a statistical summary");
+PrintLn("       -help        ==> Write out this usage message");
+PrintLn("       -list        ==> (default) Create *.lst file if errors");
+PrintLn("       -list+       ==> Unconditionally create *.lst file");
+PrintLn("       -list-       ==> Don't create error *.lst file");
+PrintLn("       -quiet       ==> Compile silently if possible");
+PrintLn("       -verbose     ==> Emit verbose diagnostics");
+PrintLn("       -version     ==> Write out version number");
+PrintLn("       -warn-       ==> Don't emit warnings");
+PrintLn("       -nowarn      ==> Don't emit warnings");
 PrintLn("  Environment Options ---");
-PrintLn("       /cpsym=XXX   ==> Use environ. variable XXX instead of CPSYM");
-PrintLn("       /hsize=NNN   ==> Set hashtable size >= NNN (0 .. 65000)");
-PrintLn("       /special     ==> Compile dummy symbol file");
-PrintLn("       /strict      ==> Disallow non-standard constructs");
+PrintLn("       -cpsym=XXX   ==> Use environ. variable XXX instead of CPSYM");
+PrintLn("       -hsize=NNN   ==> Set hashtable size >= NNN (0 .. 65000)");
+PrintLn("       -special     ==> Compile dummy symbol file");
+PrintLn("       -strict      ==> Disallow non-standard constructs");
 PrintLn("  Output Options ---");
-PrintLn("       /bindir=XXX  ==> Place binary files in directory XXX");
-PrintLn("       /debug       ==> Generate debugging information (default)");
-PrintLn("       /noasm       ==> Don't create asm (or object) files");
-PrintLn("       /nocheck     ==> Don't perform arithmetic overflow checks");
-PrintLn("       /nocode      ==> Don't create any object files");
-PrintLn("       /nodebug     ==> Give up debugging for maximum speed");
-PrintLn("       /nosym       ==> Don't create *.sym (or asm or object) files");
-PrintLn("       /quiet       ==> Compile silently if possible");
-PrintLn("       /symdir=XXX  ==> Place symbol files in directory XXX");
+PrintLn("       -bindir=XXX  ==> Place binary files in directory XXX");
+PrintLn("       -debug       ==> Generate debugging information (default)");
+PrintLn("       -noasm       ==> Don't create asm (or object) files");
+PrintLn("       -nocheck     ==> Don't perform arithmetic overflow checks");
+PrintLn("       -nocode      ==> Don't create any object files");
+PrintLn("       -nodebug     ==> Give up debugging for maximum speed");
+PrintLn("       -nosym       ==> Don't create *.sym (or asm or object) files");
+PrintLn("       -quiet       ==> Compile silently if possible");
+PrintLn("       -symdir=XXX  ==> Place symbol files in directory XXX");
 PrintLn("  Code Generation Options ---");
-PrintLn("       /ilasm       ==> (default) Force compilation via ILASM emitter");
-PrintLn("       /rflemit     ==> Use prototype System.Reflection.Emit emitter");
-PrintLn("       /target=XXX  ==> Emit (jvm|net) assembly");
-PrintLn("       /unsafe      ==> Allow unsafe code generation");
-PrintLn("       /vserror     ==> Print error messages in Visual Studio format");
-PrintLn("       /xmlerror    ==> Emit error messages in XML format");
-PrintLn(' Unix-style options: "-option" are recognized also');
+PrintLn("       -ilasm       ==> (default) Force compilation via ILASM emitter");
+PrintLn("       -rflemit     ==> Use prototype System.Reflection.Emit emitter");
+PrintLn("       -target=XXX  ==> Emit (jvm|net) assembly");
+PrintLn("       -unsafe      ==> Allow unsafe code generation");
+PrintLn("       -vserror     ==> Print error messages in Visual Studio format");
+PrintLn("       -xmlerror    ==> Emit error messages in XML format");
+IF RTS.eol[0] # 0AX THEN PrintLn(' Windows-style options: "/option" are recognized also') END;
 
 (* PrintLn("       /extras      ==> Enable experimental compiler features"); *)
 (* PrintLn("       /perwapi     ==> Force compilation via PERWAPI (Deprecated) "); *)

+ 8 - 4
gpcp/IlasmUtil.cp

@@ -1857,12 +1857,16 @@ MODULE IlasmUtil;
     IF s = NIL THEN RETURN END;
     os.CatStr(Asm.dirStr[Asm.dot_line]); 
     os.Tint(s.sLin);
-    os.CatChar(",");
-    os.CatInt(s.eLin);
+    IF RTS.eol[0] # 0AX THEN
+      os.CatChar(",");
+      os.CatInt(s.eLin)
+    END;
     os.CatChar(":");
     os.CatInt(s.sCol);
-    os.CatChar(",");
-    os.CatInt(s.eCol);
+    IF RTS.eol[0] # 0AX THEN
+      os.CatChar(",");
+      os.CatInt(s.eCol)
+    END;
     os.Bstring(os.srcS);
     os.CatEOL();
   END LineSpan;

+ 243 - 0
gpcp/MkNetDistro.bat

@@ -0,0 +1,243 @@
+
+@echo off
+REM 
+REM ===================================
+REM This batch file creates a new distribution rooted at .\gpcp-NET
+REM The file must be executed from %CROOT%\sources\gpcp
+REM Most of the files are recompiled from the sources of the distribution
+REM rooted at %CROOT% using the binaries in %CROOT%\bin. However some 
+REM files (documentation, examples, .NET symbols files) are copied
+REM from the existing distribution.
+REM ===================================
+REM
+if defined CROOT goto :init
+echo CROOT is not defined, terminating.
+goto :EOF
+
+:init
+echo CROOT = %CROOT%
+setlocal
+set HOME=%CD%
+set SOURCES_GPCP=%CROOT%\sources\gpcp
+set TRGT=%HOME%\gpcp-NET
+REM Check if this is being executed from %CROOT%\sources\gpcp
+if /i %HOME% == %SOURCES_GPCP% goto :clean
+echo Current directory not %SOURCES_GPCP%, terminating
+goto :EOF
+
+:clean
+REM ===================================
+echo Cleaning old gpcp-NET filetree
+REM ===================================
+if exist gpcp-NET rmdir /s /q gpcp-NET 
+
+REM
+REM - Make sure that JavaTarget.cp is the CLR version.
+REM - And make sure that PeTarget.cp is the NET version.
+REM
+copy JavaTargetForCLR.cp JavaTarget.cp
+copy PeTargetForNET.cp PeTarget.cp
+
+mkdir gpcp-NET\bin
+mkdir gpcp-NET\sources
+mkdir gpcp-NET\symfiles
+mkdir gpcp-NET\documentation\Examples
+mkdir gpcp-NET\symfiles\NetSystem
+mkdir gpcp-NET\symfiles\HtmlBrowseFiles
+
+REM ===================================
+echo Building C# library implementations
+REM ===================================
+CD %CROOT%\sources\libs\csharp
+set TOOL="CSC"
+csc /t:library /debug /nologo RTS.cs
+if errorlevel 1 goto :fail
+csc /t:library /debug /nologo GPFiles.cs
+if errorlevel 1 goto :fail
+csc /t:library /r:GPFiles.dll /debug /nologo GPBinFiles.cs
+if errorlevel 1 goto :fail
+csc /t:library /r:GPFiles.dll /debug /nologo GPTextFiles.cs
+if errorlevel 1 goto :fail
+REM ===================================
+echo moving PE files to TRGT\bin
+REM ===================================
+move *.dll %TRGT%\bin
+move *.pdb %TRGT%\bin
+CD %HOME%\libs\csharp
+REM ===================================
+echo compiling MsilAsm 
+REM ===================================
+csc /t:library /debug /nologo MsilAsm.cs
+if errorlevel 1 goto :fail
+move MsilAsm.dll %TRGT%\bin
+move MsilAsm.pdb %TRGT%\bin
+REM
+REM The source of PeToCpsUtils.cp is included.
+REM It is required to allow PeToCps v1.4.06 to be
+REM compiled using the gpcp v1.4.04 executables. 
+REM It is not required when re-compiling with gpcp 1.4.06
+REM
+REM csc /t:library /debug /nologo PeToCpsUtils.cs
+REM PeToCps PeToCpsUtils.dll
+REM move PeToCpsUtils.dll %TRGT%\bin
+REM move PeToCpsUtils.pdb %TRGT%\bin
+REM move PeToCpsUtils_.cps %TRGT%\symfiles
+REM if errorlevel 1 goto :fail
+REM move MsilAsm.dll %TRGT%\bin
+REM move MsilAsm.pdb %TRGT%\bin
+REM 
+REM ===================================
+echo Compiling CP library sources
+REM ===================================
+set TOOL="gpcp"
+CD %CROOT%\sources\libs\cpascal
+%CROOT%\bin\gpcp.exe /special /nowarn ASCII.cp Console.cp CPmain.cp Error.cp GPFiles.cp GPBinFiles.cp GPTextFiles.cp ProgArgs.cp RTS.cp STA.cp StdIn.cp WinMain.cp
+if errorlevel 1 goto :fail
+%CROOT%\bin\gpcp.exe /nowarn /bindir=%TRGT%\bin RealStr.cp StringLib.cp
+if errorlevel 1 goto :fail
+move *.cps %TRGT%\symfiles
+del *.il /q
+
+REM ===================================
+echo NOT Copying the PERWAPI symbol files
+REM  Have to leave this in until PERWAPI is removed from distro
+REM ===================================
+REM CD %CROOT%\symfiles
+REM copy QUT_*.cps %TRGT%\symfiles
+
+REM ===================================
+echo Copying the NetSystem symbol files
+REM ===================================
+CD %CROOT%\symfiles\NetSystem
+copy *.cps %TRGT%\symfiles\NetSystem
+
+REM ===================================
+echo Generating html browse files for NetSystem libraries
+REM ===================================
+CD %TRGT%\symfiles\NetSystem
+echo DST=%TRGT%\symfiles\HtmlBrowseFiles
+%CROOT%\bin\Browse.exe /verbose /html /sort /dst:%TRGT%\symfiles\HtmlBrowseFiles *.cps
+if errorlevel 1 goto :fail
+
+REM ===================================
+echo Generating html browse files for CP libraries
+REM ===================================
+CD %TRGT%\symfiles
+set TOOL="Browse"
+%CROOT%\bin\Browse.exe /html /sort /dst:HtmlBrowseFiles *.cps
+
+REM ===================================
+echo Generating index for html browse files
+REM ===================================
+%CROOT%\bin\MakeIndex.exe /verbose /dst:HtmlBrowseFiles
+
+REM ===================================
+echo Building compiler-tools exes and dlls
+REM ===================================
+CD %HOME%
+set TOOL="CPMake"
+%CROOT%\bin\CPMake.exe /all /bindir=%TRGT%\bin /nowarn gpcp
+if errorlevel 1 goto :fail
+set TOOL="gpcp"
+%CROOT%\bin\gpcp.exe /bindir=%TRGT%\bin /nowarn ModuleHandler.cp SymbolFile.cp CPMake.cp
+if errorlevel 1 goto :fail
+%CROOT%\bin\gpcp.exe /bindir=%TRGT%\bin /nowarn BrowseLookup.cp BrowsePopups.cp Browse.cp
+if errorlevel 1 goto :fail
+%CROOT%\bin\CPMake.exe /all /bindir=%TRGT%\bin /nowarn PeToCps.cp
+if errorlevel 1 goto :fail
+
+REM ===================================
+echo Building MakeIndex.exe
+REM ===================================
+set TOOL="MakeIndex"
+CD %HOME%\MakeIndex
+%CROOT%\bin\CPMake.exe /all /bindir=%TRGT%\bin /nowarn MakeIndex
+if errorlevel 1 goto :fail
+
+REM ===================================
+REM ===================================
+REM  This is only necessary until the new PeToCps
+REM  uses System.Reflection to build symbol files.
+REM ===================================
+REM ===================================
+echo NOT Copying PERWAPI to gpcp-NET\bin
+REM ===================================
+REM CD %CROOT%\bin
+REM copy QUT*.* %TRGT%\bin
+REM ===================================
+
+REM ===================================
+echo Copying the documentation
+REM ===================================
+CD %CROOT%\documentation
+copy *.pdf %TRGT%\documentation
+CD examples
+copy *.* %TRGT%\documentation\Examples
+
+REM ===================================
+echo Getting ready to copy the sources
+REM ===================================
+CD %CROOT%
+mkdir %TRGT%\sources\gpcp\libs\java
+mkdir %TRGT%\sources\gpcp\libs\csharp
+mkdir %TRGT%\sources\gpcp\MakeIndex
+mkdir %TRGT%\sources\libs\java
+mkdir %TRGT%\sources\libs\csharp
+mkdir %TRGT%\sources\libs\cpascal
+
+REM ===================================
+echo Copying GPCP sources
+REM ===================================
+copy sources\gpcp\env.bat %TRGT%
+copy sources\gpcp\env.sh %TRGT%
+copy sources\gpcp\*.cp %TRGT%\sources\gpcp
+copy sources\gpcp\MkNetDistro.bat %TRGT%\sources\gpcp
+copy sources\gpcp\MkNetDistro.sh %TRGT%\sources\gpcp
+copy sources\gpcp\MakeIndex\*.cp %TRGT%\sources\gpcp\MakeIndex
+copy sources\gpcp\libs\java\MsilAsm.java %TRGT%\sources\gpcp\libs\java
+copy sources\gpcp\libs\csharp\MsilAsm.cs %TRGT%\sources\gpcp\libs\csharp
+
+REM ===================================
+echo Copy helper files for .NET bin directory
+REM ===================================
+copy sources\gpcp\CopyNetLibs.bat %TRGT%\bin
+copy sources\gpcp\_README-NET.txt %TRGT%\bin
+copy sources\gpcp\CopyNetLibs.bat %TRGT%\sources\gpcp
+copy sources\gpcp\_README-NET.txt %TRGT%\sources\gpcp
+
+REM ===================================
+echo Copying CP library sources
+REM ===================================
+copy sources\libs\cpascal\*.cp %TRGT%\sources\libs\cpascal
+copy sources\libs\cpascal\*.bat %TRGT%\sources\libs\cpascal
+
+REM ===================================
+echo Copying C# library sources
+REM ===================================
+copy sources\libs\csharp\*.cs %TRGT%\sources\libs\csharp
+
+REM ===================================
+echo Copying java library sources
+REM ===================================
+copy sources\libs\java\*.* %TRGT%\sources\libs\java
+
+REM ===================================
+echo (No Longer) Copying PERWAPI-project.zip to gpcp-NET\sources
+REM ===================================
+REM copy sources\PERWAPI-project.zip %TRGT%\sources
+
+REM ===================================
+echo BUILD SUCCEDED
+REM ===================================
+CD %HOME%
+goto :EOF
+
+:fail
+REM ===================================
+echo BUILD FAILED IN %TOOL%
+REM ===================================
+CD %HOME%
+REM
+REM End of script
+REM
+

+ 259 - 0
gpcp/MkNetDistro.sh

@@ -0,0 +1,259 @@
+#!/bin/sh
+
+# ===================================
+# This shell script creates a new distribution rooted at ./gpcp-NET
+# The file must be executed from $CROOT/sources/gpcp
+# Most of the files are recompiled from the sources of the distribution
+# rooted at $CROOT using the binaries in $CROOT/bin. However some 
+# files (documentation, examples, .NET symbols files) are copied
+# from the existing distribution.
+# ===================================
+
+#tracing
+#set -x
+
+if [ "$CROOT" = "" ]
+then
+  echo CROOT is not defined, terminating.
+  exit 1
+fi
+
+echo CROOT = $CROOT
+HOME=`pwd`
+SOURCES_GPCP=$CROOT/sources/gpcp
+TRGT=$HOME/gpcp-NET
+# Check if this is being executed from $CROOT/sources/gpcp
+if [ "$HOME" != "$SOURCES_GPCP" ]
+then
+  echo Current directory not $SOURCES_GPCP, terminating
+  exit 2
+fi
+
+echo HOME = $HOME
+echo SOURCES_GPCP = $SOURCES_GPCP
+
+# ===================================
+echo Cleaning old gpcp-NET filetree
+# ===================================
+rm -rf gpcp-NET 
+
+# - Make sure that JavaTarget.cp is the CLR version.
+# - And make sure that PeTarget.cp is the NET version.
+cp JavaTargetForCLR.cp JavaTarget.cp
+cp PeTargetForNET.cp PeTarget.cp
+
+mkdir -p gpcp-NET/bin
+mkdir -p gpcp-NET/sources
+mkdir -p gpcp-NET/symfiles
+mkdir -p gpcp-NET/documentation/Examples
+mkdir -p gpcp-NET/symfiles/NetSystem
+mkdir -p gpcp-NET/symfiles/HtmlBrowseFiles
+
+# ===================================
+echo Building C# library implementations
+# ===================================
+cd $CROOT/sources/libs/csharp
+csc /t:library /debug /nologo RTS.cs \
+  && csc /t:library /r:RTS.dll /debug /nologo GPFiles.cs \
+  && csc /t:library /r:GPFiles.dll /debug /nologo GPBinFiles.cs \
+  && csc /t:library /r:GPFiles.dll /debug /nologo GPTextFiles.cs
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 3
+fi
+
+# ===================================
+echo moving PE files to TRGT/bin
+# ===================================
+for i in *.dll; do mv $i $TRGT/bin; done
+for i in *.pdb; do mv $i $TRGT/bin; done
+cd $HOME/libs/csharp
+# ===================================
+echo compiling MsilAsm 
+# ===================================
+csc /t:library /debug /nologo MsilAsm.cs
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 4
+fi
+
+mv MsilAsm.dll $TRGT/bin
+mv MsilAsm.pdb $TRGT/bin
+
+# The source of PeToCpsUtils.cp is included.
+# It is required to allow PeToCps v1.4.06 to be
+# compiled using the gpcp v1.4.04 executables. 
+# It is not required when re-compiling with gpcp 1.4.06
+
+# csc /t:library /debug /nologo PeToCpsUtils.cs
+# PeToCps PeToCpsUtils.dll
+# move PeToCpsUtils.dll %TRGT%\bin
+# move PeToCpsUtils.pdb %TRGT%\bin
+# move PeToCpsUtils_.cps %TRGT%\symfiles
+# if errorlevel 1 goto :fail
+# move MsilAsm.dll %TRGT%\bin
+# move MsilAsm.pdb %TRGT%\bin
+
+# ===================================
+echo Compiling CP library sources
+# ===================================
+cd $CROOT/sources/libs/cpascal
+mono $CROOT/bin/gpcp.exe -special -nowarn \
+    ASCII.cp Console.cp CPmain.cp Error.cp GPFiles.cp GPBinFiles.cp \
+    GPTextFiles.cp ProgArgs.cp RTS.cp STA.cp StdIn.cp WinMain.cp \
+  && mono $CROOT/bin/gpcp.exe -nowarn -bindir=$TRGT/bin/ RealStr.cp StringLib.cp
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 5
+fi
+for i in *.cps; do mv $i $TRGT/symfiles; done
+rm -rf *.il
+
+# ===================================
+echo NOT Copying the PERWAPI symbol files
+#  Have to leave this in until PERWAPI is removed from distro
+# ===================================
+# CD %CROOT%\symfiles
+# copy QUT_*.cps %TRGT%\symfiles
+
+# ===================================
+echo Copying the NetSystem symbol files
+# ===================================
+cd $CROOT/symfiles/NetSystem
+for i in *.cps; do cp $i $TRGT/symfiles/NetSystem; done
+
+# ===================================
+echo Generating html browse files for NetSystem libraries
+# ( -verbose removed PDR 21.12.22 )
+# ===================================
+cd $TRGT/symfiles/NetSystem
+echo DST=$TRGT/symfiles/HtmlBrowseFiles
+mono $CROOT/bin/Browse.exe -html -sort \
+  -dst:$TRGT/symfiles/HtmlBrowseFiles *.cps
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 6
+fi
+
+# ===================================
+echo Generating html browse files for CP libraries
+# ===================================
+cd $TRGT/symfiles
+mono $CROOT/bin/Browse.exe -html -sort -dst:HtmlBrowseFiles *.cps
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 7
+fi
+
+# ===================================
+echo Generating index for html browse files
+# ( -verbose removed PDR 21.12.22 )
+# ===================================
+mono $CROOT/bin/MakeIndex.exe -dst:HtmlBrowseFiles
+
+# ===================================
+echo Building compiler-tools exes and dlls
+# ===================================
+cd $HOME
+mono $CROOT/bin/CPMake.exe -all -bindir=$TRGT/bin/ -nowarn gpcp \
+  && mono $CROOT/bin/gpcp.exe -bindir=$TRGT/bin/ -nowarn \
+    ModuleHandler.cp SymbolFile.cp CPMake.cp \
+  && mono $CROOT/bin/gpcp.exe -bindir=$TRGT/bin/ -nowarn \
+    BrowseLookup.cp BrowsePopups.cp Browse.cp \
+  && mono $CROOT/bin/CPMake.exe -all -bindir=$TRGT/bin/ -nowarn PeToCps.cp
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 8
+fi
+
+# ===================================
+echo Building MakeIndex.exe
+# ===================================
+cd $HOME/MakeIndex
+mono $CROOT/bin/CPMake.exe -all -bindir=$TRGT/bin/ -nowarn MakeIndex.cp
+if [ $? -gt 0 ]
+then
+  cd $HOME
+  exit 9
+fi
+
+# ===================================
+# ===================================
+#  This is only necessary until the new PeToCps
+#  uses System.Reflection to build symbol files.
+# ===================================
+# ===================================
+echo NOT Copying PERWAPI to gpcp-NET/bin
+# ===================================
+# CD %CROOT%\bin
+# copy QUT*.* %TRGT%\bin
+# ===================================
+
+# ===================================
+echo Copying the documentation
+# ===================================
+cd $CROOT/documentation
+for i in *.pdf; do cp $i $TRGT/documentation; done
+cd examples
+for i in *; do cp $i $TRGT/documentation/Examples; done
+
+# ===================================
+echo Getting ready to copy the sources
+# ===================================
+cd $CROOT
+mkdir -p $TRGT/sources/gpcp/libs/java
+mkdir -p $TRGT/sources/gpcp/libs/csharp
+mkdir -p $TRGT/sources/gpcp/MakeIndex
+mkdir -p $TRGT/sources/libs/java
+mkdir -p $TRGT/sources/libs/csharp
+mkdir -p $TRGT/sources/libs/cpascal
+
+# ===================================
+echo Copying GPCP sources
+# ===================================
+cp sources/env.bat $TRGT
+cp sources/env.sh $TRGT
+for i in sources/gpcp/*.cp; do cp $i $TRGT/sources/gpcp; done
+cp sources/gpcp/MkNetDistro.bat $TRGT/sources/gpcp
+cp sources/gpcp/MkNetDistro.sh $TRGT/sources/gpcp
+for i in sources/gpcp/MakeIndex/*.cp; do cp $i $TRGT/sources/gpcp/MakeIndex; done
+cp sources/gpcp/libs/java/MsilAsm.java $TRGT/sources/gpcp/libs/java
+cp sources/gpcp/libs/csharp/MsilAsm.cs $TRGT/sources/gpcp/libs/csharp
+
+# ===================================
+echo Copy helper files for .NET bin directory
+# ===================================
+cp sources/gpcp/CopyNetLibs.bat $TRGT/bin
+cp sources/gpcp/_README-NET.txt $TRGT/bin
+cp sources/gpcp/CopyNetLibs.bat $TRGT/sources/gpcp
+cp sources/gpcp/_README-NET.txt $TRGT/sources/gpcp
+
+# ===================================
+echo Copying CP library sources
+# ===================================
+for i in sources/libs/cpascal/*.cp; do cp $i $TRGT/sources/libs/cpascal; done
+for i in sources/libs/cpascal/*.bat; do cp $i $TRGT/sources/libs/cpascal; done
+for i in sources/libs/cpascal/*.sh; do cp $i $TRGT/sources/libs/cpascal; done
+
+# ===================================
+echo Copying C# library sources
+# ===================================
+for i in sources/libs/csharp/*.cs; do cp $i $TRGT/sources/libs/csharp; done
+
+# ===================================
+echo Copying java library sources
+# ===================================
+for i in sources/libs/java/*; do cp $i $TRGT/sources/libs/java; done
+
+# ===================================
+echo \(No Longer\) Copying PERWAPI-project.zip to gpcp-NET/sources
+# ===================================
+# copy sources\PERWAPI-project.zip %TRGT%\sources
+
+cd $HOME

+ 4 - 1
gpcp/csharp/MsilAsm.cs

@@ -45,7 +45,10 @@ public class MsilAsm {
                 asm = new Process();
                 System.String frameworkDir = GetDotNetRuntimeInstallDirectory();
                 //System.String frameworkDir = Environment.GetEnvironmentVariable("NET40", EnvironmentVariableTarget.User);
-                asm.StartInfo.FileName = frameworkDir + "\\" + "ilasm";
+                asm.StartInfo.FileName = frameworkDir
+                  + (frameworkDir[0] == '/' ?
+                        "/../../../Commands/" : "\\") + "ilasm";
+
                 asm.StartInfo.CreateNoWindow = true;
                 asm.StartInfo.UseShellExecute = false;
             }

+ 11 - 0
gpcp/env.bat

@@ -0,0 +1,11 @@
+@echo off
+if defined CROOT echo CROOT already defined: run this once in a new CMD
+if defined CROOT goto end
+set CROOT=%CD%
+echo CROOT=%CROOT%
+set PATH=%CROOT%\bin;%PATH%
+REM or, e.g. set PATH=%CROOT%\bin;C:\windows\Microsoft.NET\Framework\v4.0.30319;%PATH%
+echo PATH=%PATH%
+set CPSYM=.;%CROOT%\symfiles;%CROOT%\symfiles\NetSystem
+echo CPSYM=%CPSYM%
+:end

+ 14 - 0
gpcp/env.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ "$CROOT" != "" ]
+then
+  echo CROOT already defined: run this once in a new shell
+else
+  export CROOT=`pwd`
+  echo CROOT=$CROOT
+  export PATH=$CROOT/bin:$PATH
+  echo PATH=$PATH
+  export CPSYM=.:$CROOT/symfiles:$CROOT/symfiles/NetSystem
+  echo CPSYM=$CPSYM
+fi
+

+ 4 - 3
libs/csharp/GPFiles.cs

@@ -9,9 +9,10 @@
 namespace GPFiles {
 public abstract class GPFiles {
 
-  public static char pathSep = ';';
-  public static char fileSep = '\\';
-  public static char optChar = '/';
+  private static bool unix = (System.Environment.NewLine == "\n");
+  public static char pathSep = unix ? ':' : ';';
+  public static char fileSep = unix ? '/' : '\\';
+  public static char optChar = unix ? '-' : '/';
 
   /* ----------------------------------	*/