Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: BeOS port



Reposting, since noone noticed the patch at the end...

> Hi there,
> I've had a working port of zsh to ZETA (BeOS R6) for quite a while,
> but
> since I'm not (yet) a big user I never managed to publish it. I was
> also too lazy to clean up the small C89 fix required (we require
> gcc2.95 due to the C++ ABI breackage on later versions).
>
> I didn't try but it should likely compile fine on BeOS R5, at least
> with the BONE network stack.
>
> It should also compile without much trouble in Haiku (MIT licenced
> rewrite of BeOS). It will probably need some more library check
> (socket
> in -lnetwork) though.
>
> Some tests still break, but most are due to missing features, and at
> least they don't crash like they used to.
> - BeOS defvs shows all devices as S_IFCHR, including block devices,
> so
> there is no S_IFBLK device in /dev per see.
> - BeOS doesn't have /dev/tty (Haiku does though)
> - BeOS natively uses UTF-8 everywhere, but has an old glibc, so it
> misses some wc*()... I still don't get the point of using ugly stuff
> like wchar anyway.
> - zpty doesn't load yet for some reason
>
> I'll likely have to port over all the bash_completion stuff I
> wrote...
> http://revolf.free.fr/beos/bash_completion/zeta_completion
>

François.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.112
diff -u -r1.112 configure.ac
--- configure.ac	30 Oct 2008 13:00:21 -0000	1.112
+++ configure.ac	5 Nov 2008 05:09:46 -0000
@@ -745,6 +745,7 @@
 fi
 
 AC_CHECK_LIB(socket, socket)
+AC_CHECK_LIB(bind, gethostbyname2)
 
 dnl ---------------
 dnl CHECK FOR ICONV
@@ -2527,6 +2528,7 @@
     aix*)         DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
     solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
     darwin*)      DLLDFLAGS="${DLLDFLAGS=-bundle -flat_namespace -undefined suppress}" ;;
+    beos*|haiku*) DLLDFLAGS="${DLLDFLAGS=-nostart}" ;;
     openbsd*)
       if test x$zsh_cv_sys_elf = xyes; then
 	DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}"
@@ -2568,6 +2570,15 @@
        ;;
       esac
     ;;
+    *-beos*)
+      # gcc on BeOS doesn't like -rdynamic...
+      EXTRA_LDFLAGS="${EXTRA_LDFLAGS= }"
+      # also, dlopen() at least in Zeta respects $LIBRARY_PATH, so needs %A added to it.
+      export LIBRARY_PATH="$LIBRARY_PATH:%A/"
+    ;;
+    *-haiku*)
+      # 
+    ;;
   esac
 
   # Done with our shell code, so restore autotools quoting
Index: Src/Modules/zpty.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zpty.c,v
retrieving revision 1.39
diff -u -r1.39 zpty.c
--- Src/Modules/zpty.c	29 Sep 2008 08:46:33 -0000	1.39
+++ Src/Modules/zpty.c	5 Nov 2008 05:09:47 -0000
@@ -260,6 +260,9 @@
 
     if (master) {
 	strcpy(name, "/dev/ptyxx");
+#if defined(__BEOS__) || defined(__HAIKU__)
+	name[7] = '/';
+#endif
 
 	for (p1 = char1; *p1; p1++) {
 	    name[8] = *p1;
Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.72
diff -u -r1.72 zle_refresh.c
--- Src/Zle/zle_refresh.c	23 Oct 2008 08:52:02 -0000	1.72
+++ Src/Zle/zle_refresh.c	5 Nov 2008 05:09:47 -0000
@@ -1879,6 +1879,8 @@
 /* 3: main display loop - write out the buffer using whatever tricks we can */
 
     for (;;) {
+	int now_off;
+
 #ifdef MULTIBYTE_SUPPORT
 	if ((!nl->chr || nl->chr != WEOF) && (!ol->chr || ol->chr != WEOF)) {
 #endif
@@ -2050,7 +2052,7 @@
 	     * If an attribute was on here but isn't any more,
 	     * output the sequence to turn it off.
 	     */
-	    int now_off = ol->atr & ~nl->atr & TXT_ATTR_ON_MASK;
+	    now_off = ol->atr & ~nl->atr & TXT_ATTR_ON_MASK;
 	    if (now_off)
 		settextattributes(TXT_ATTR_OFF_FROM_ON(now_off));
 


Messages sorted by: Reverse Date, Date, Thread, Author