diff --git a/ReadMe.md b/ReadMe.md index fc974684..fa3f6ffe 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -121,20 +121,19 @@ It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). A C program (src/tools/make/configure.c) detects the details of the C compiler -and operating system on which it is running. In most cases it will automatically -determine all that is needed for the port to a new platform. and 'make full' -will just work. +and operating system on which it is running. -In some cases manual work will be required: +The following systems are recognised: - - If configure.c cannot recognise the operating system on which it is running - a few lines will need to be added to detect and set the make variables - correctly. - - If porting to a system that does not provide a Unix style API, it will be - necessary to implement a new variant of Platform.Mod providing the same - interface as Platformunix.Mod and Platform Windows.Mod. + - Linux, including Ubuntu and Centos derivatives. + - The BSDs, including OpenBSD and FreeBSD. + - Cygwin under Windows, MingW under Cygwin, Bash on Ubuntu on Windows. + +Additionally a Windows .cmd is provided for building with Microsoft C. + +For details, including how to add support for unrecognised systems, see +[**Porting**](/doc/Porting.md). -For details, see [**Porting**](/doc/Porting.md). ## Language support and libraries @@ -154,9 +153,9 @@ Vishap Oberon supports the Oberon 2 programming language, including type-bound p Included libraries ease porting of code from the major Oberon systems: - Oberon V4 and S3 compatible library set. - - ooc (optimizing oberon-2 compiler) library port. + - Ooc (optimizing oberon-2 compiler) library port. - Ulm’s Oberon system library port. - - Okwood standard libraries. + - Oakwood standard libraries. - Some other freely redistributable libraries. Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations. @@ -177,7 +176,7 @@ From Joseph's github repository: > Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. -Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems, and . +Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems. David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. diff --git a/doc/Porting.md b/doc/Porting.md index 94707e04..8bb2e74e 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -1,8 +1,6 @@ -#### (Work in progress) - ### Porting to a new platform -Porting to a new 32 or 64 bits platform is usually automatically handled +Porting to a new 32 or 64 bit platform is usually automatically handled by `make full`: - The makefile compiles `src/tools/make/configure.c` with the @@ -13,7 +11,7 @@ by `make full`: operating system it is running on and what the appropriate installation directory will be. - `configure.c` sets makefile variables that are used to select - which of 5 sets of preprepared C source files to build to create + which of 5 sets of pre-prepared C source files to build to create the bootstrap compiler. On most systems this will be sufficient for `make full` to build @@ -23,10 +21,11 @@ and install the compiler and libraries. `--- Branch v2docs freebsd gcc LP64 confidence tests passed ---` + #### Updating configure.c -It should only be necessary to change `configure.c` if it -cannot determine the correct install directory. +Most likely you will only need to change `configure.c` if it cannot determine +the correct install directory. In this case add code to `src/tools/make/configure.c`'s function `determineOS()` to set the `os` variable to the name @@ -41,7 +40,7 @@ variable | set to | example `binext` | Binary file extension | `""` `staticlink` | Static linking option | `"-static"` -If your new platform does not support static removing, set the +If your new platform does not support static linking, set the `staticlink` variable to `""`. Then modify `determineInstallDirectory()` to select the correct @@ -53,28 +52,7 @@ to the Windows API (`Platformwindows.Mod`), and one suitable for Unix-like systems including Linux, BSD, Android and cygwin (`Platformunix.Mod`). +If you are porting to a system that does not provide a Unix style API, it will +be necessary to implement a new variant of Platform.Mod providing the same +interface as Platformunix.Mod and Platform Windows.Mod. -#### How to add a new compiler option - - - Define it in OPM as a constant before defopt is defined. - - Define a BOOLEAN variable in OPM which will describe if setting is set. - - Add handling of a new option in OPM.ScanOptions - - Set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the - CASE) so you can check it later. - - Check your boolean when necessary, (see useParFile in OPM.GetOptions) - - Add it in OPC.GenHeaderMsg function. - -#### Known bugs - -When using SYSTEM.LSH(s, n) where s is SET, -the C compiler generates an error like -`error: duplicate 'unsigned'`, -that's because SET is defined as unsigned in SYSTEM.h, -while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), -and it makes not possible to make SYSTEM.LSH with type SET. - -I don't want to prohibit it at the parser level -because C backend is only one of possible backends. - -The solution currently is to cast set type to longint before lsh-ing it. -And then casting it back to set if necessary.