]> Nishi Git Mirror - tewi.git/commitdiff
works on netware
authorNishi <nishi@nishi.boats>
Thu, 17 Oct 2024 00:37:10 +0000 (00:37 +0000)
committerNishi <nishi@nishi.boats>
Thu, 17 Oct 2024 00:37:10 +0000 (00:37 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@361 8739d7e6-ffea-ec47-b151-bdff447c6205

Koakumafile
Platform/netware.mk
README
README.tmpl
Server/http.c
Server/main.c
Server/server.c

index 471a5ac31bd28748e3096664f40742fbaaf50c7a..c3205db8ad2f1042e475f0055bd4ed6d65c54848 100644 (file)
@@ -51,6 +51,21 @@ proc run {project_name} {
                        RunCommand "doas cp tewidist.zip /raid/f/g/tewi/os2/tewidistos2-[exec make get-version]-nossl.zip"
                        RunCommand "doas cp tewidist.zip /raid/ftp/pub/tewi/os2/tewidistos2-[exec make get-version]-nossl.zip"
                        return
+               } elseif { "$project_name" == "Tewi-NetWare" } {
+                       set ::env(WATCOM) "/usr/watcom"
+                       set ::env(NOVELLNDK) "/usr/novell/clib"
+                       set ::env(PATH) "$::env(PATH):/usr/watcom/binl64"
+                       RunCommand "rm -rf netware"
+                       RunCommand "make PLATFORM=netware"
+                       RunCommand "make PLATFORM=netware install DESTDIR=netware/"
+                       cd netware/SYS:
+                       RunCommand "zip -rv ../../tewidist.zip Tewi"
+                       cd ../..
+                       RunCommand "doas mkdir -p /raid/f/g/tewi/netware"
+                       RunCommand "doas mkdir -p /raid/ftp/pub/tewi/netware"
+                       RunCommand "doas cp tewidist.zip /raid/f/g/tewi/netware/tewidistnw-[exec make get-version]-nossl.zip"
+                       RunCommand "doas cp tewidist.zip /raid/ftp/pub/tewi/os2/tewidistnw-[exec make get-version]-nossl.zip"
+                       return
                } elseif { "$project_name" == "Tewi-PSP" } {
                        RunCommand "./psp.sh"
                        RunCommand "doas mkdir -p /raid/f/g/tewi/psp"
index ff2030f6503ddaf7fa6e6faf5086297d85e53113..1f6def146adb6b331dbad1afc3f8a0215f22e65f 100644 (file)
@@ -6,7 +6,7 @@ PLATFORM_IDENT = NETWARE_WATCOM
 CC = owcc
 AR = wlib
 AR_FLAGS = -q -b -n -fo
-CFLAGS = -b netware_clib_lite -I $(NOVELLNDK)/include -I $(NOVELLNDK)/include/nlm -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -I ../VC6Compat -fPIC -D__WATCOM_LFN__ -Duint64_t=uint32_t
+CFLAGS = -b netware_clib_lite -I $(NOVELLNDK)/include -I $(NOVELLNDK)/include/nlm -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -I ../VC6Compat -fPIC -D__WATCOM_LFN__ -Duint64_t=uint32_t -DN_PLAT_NLM
 LDFLAGS = -b netware_clib_lite
 LIBS =
 EXEC = .nlm
diff --git a/README b/README
index f2cbcc7f899c8877e2cf6cd4930706d2a778928f..0ed5f718d752ae5642eef3a628bdb3b38738edbf 100644 (file)
--- a/README
+++ b/README
@@ -46,6 +46,7 @@ Haiku                    Working
 Minix                    Working
 UnixWare                 Working on 7.1.1
 OS/2                     Working
+NetWare                  Working on 6.5 SP8
 DOS                      Working, missing module support and multi-threading
 NeXTSTEP                 Working, missing module support
 PlayStation Portable     Working, missing module support
@@ -57,5 +58,4 @@ Not supported
 -----------------------
 I sometimes check they do compile, but does not work:
 
-NetWare                  Cannot run fopen somehow
 PlayStation 2            Does not boot
index 0d15b567a75a3c3b85ea817d4a993ccd0282e74f..fc7c0fda8c0c7ce672b51bdb497006d5f23ac978 100644 (file)
@@ -46,6 +46,7 @@ Haiku                    Working
 Minix                    Working
 UnixWare                 Working on 7.1.1
 OS/2                     Working
+NetWare                  Working on 6.5 SP8
 DOS                      Working, missing module support and multi-threading
 NeXTSTEP                 Working, missing module support
 PlayStation Portable     Working, missing module support
@@ -57,5 +58,4 @@ Not supported
 -----------------------
 I sometimes check they do compile, but does not work:
 
-NetWare                  Cannot run fopen somehow
 PlayStation 2            Does not boot
index 8357759e542e47251793b043f7939c70245a1fe2..4cf46b8417213d5e45a48bc81ce646acee1c2e6c 100644 (file)
@@ -28,6 +28,7 @@
 #include <winsock2.h>
 #endif
 #elif defined(__NETWARE__)
+#include <sys/bsdskt.h>
 #include <sys/socket.h>
 #else
 #ifdef USE_POLL
index b5c7000bd4e30499917b2ecf3c528cffa58feddc..9d22d6def91e1b6a0eeb41439e903e44aff0890d 100644 (file)
@@ -41,6 +41,9 @@
 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #include <windows.h>
 #elif defined(__NETWARE__)
+#include <nwnamspc.h>
+#include <nwthread.h>
+#include <nwconio.h>
 #endif
 
 #ifdef _PSP
@@ -548,9 +551,13 @@ int main(int argc, char** argv) {
        int st;
 #ifdef __NETWARE__
        struct arg_struct* parg = malloc(sizeof(*parg));
+       SetCurrentNameSpace(NW_NS_LONG);
        parg->argc = argc;
        parg->argv = argv;
-       thread_stuff(parg);
+       DestroyScreen(GetCurrentScreen());
+       SetCurrentScreen(CreateScreen("Tewi Console", 0));
+       BeginThread(thread_stuff, NULL, 0, parg);
+       ThreadSwitch();
        return 0;
 }
 
index 3ed89fecc5c01ef7297c214715ae0c136ad217ac..72930904b07568af6648abdc4ea3f40573a1db23 100644 (file)
@@ -63,13 +63,15 @@ typedef int socklen_t;
 #include "strptime.h"
 typedef int socklen_t;
 #elif defined(__NETWARE__)
+#include <sys/bsdskt.h>
 #include <sys/socket.h>
 
 #define IPPROTO_TCP 0
 #define INADDR_ANY 0
-#define htons(x) x
 #include "strptime.h"
 typedef int socklen_t;
+
+uint16_t htons(uint16_t n) { return ((n >> 8) & 0xff) | ((n << 8) & 0xff00); }
 #elif defined(__DOS__)
 #include <netinet/tcp.h>
 #include <netinet/in.h>
@@ -1010,7 +1012,7 @@ void tw_server_loop(void) {
        fd_set fdset;
        struct timeval tv;
 #endif
-#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
+#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__))
        struct thread_entry threads[2048];
        for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) {
                threads[i].used = false;
@@ -1083,7 +1085,7 @@ void tw_server_loop(void) {
 #ifdef __OS2__
                                        _beginthread(tw_server_pass, 0, 0, e);
 #elif defined(__NETWARE__)
-                                       tw_server_pass(e);
+                                       BeginThread(tw_server_pass, NULL, 0, e);
 #elif defined(__DOS__)
                                        tw_server_pass(e);
 #else