1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-31 16:37:47 +00:00

Ports: Add GNU APL

Since the glyphs are being worked on, a APL interpreter seems like a
good way to use them.
This commit is contained in:
Tobias Christiansen 2022-03-11 19:01:35 +01:00 committed by Linus Groh
parent 38bb9afea8
commit 3303feed91
7 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Patches for GNU APL on SerenityOS
## `fix-common-includes.patch`
`fcntl.h` was included as `sys/fcntl.h`, which is not where this lives in Serenity.
Also `sys/select.h` is included here.
## `stub-performance-macro.patch`
The Macro for performance reporting was throwing compile errors, so we just stub it out.
## `stub-sbrk.patch`
Again, for performance reporting the function `sbrk` is needed which we don't have. We just stub it out.
## `sub-config.patch`
The default change to `config.sub`: Add `serenity` as a valid target.

View file

@ -0,0 +1,12 @@
--- apl-1.8/src/Common.hh
+++ apl-1.8/src/Common.hh
@@ -26,7 +26,8 @@
#include <netinet/in.h>
#include <sys/un.h>
#include <sys/stat.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
+#include <sys/select.h>
#ifdef ENABLE_NLS
#include <libintl.h>

View file

@ -0,0 +1,11 @@
--- apl-1.8/src/Performance.cc
+++ apl-1.8/src/Performance.cc
@@ -224,7 +224,7 @@ const uint64_t subsq_avg_AB = Statistics_record::average(sum_subsq_cycles_AB,
//
#define perfo_1(id, ab, _name, _thr)
#define perfo_2(id, ab, _name, _thr)
-#define perfo_3(id, ab, _name, _thr) fs_ ## id ## ab.print(out);
+#define perfo_3(id, ab, _name, _thr)
#define perfo_4(id, ab, name, thr) perfo_3(id, ab, name, thr)
#include "Performance.def"

View file

@ -0,0 +1,13 @@
--- apl-1.8/src/sbrk.cc
+++ apl-1.8/src/sbrk.cc
@@ -34,9 +34,6 @@ extern uint64_t top_of_memory();
uint64_t
top_of_memory()
{
- if (sizeof(const void *) == 4)
- return 0xFFFFFFFFULL & uint64_t(sbrk(0));
- else
- return uint64_t(sbrk(0));
+ return 0xFFFFFFFFULL;
}

View file

@ -0,0 +1,11 @@
--- apl-1.8/config.sub
+++ apl-1.8/config.sub
@@ -1290,7 +1290,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -serenity* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)