zsh-workers
 help / color / mirror / code / Atom feed
From: "François Revol" <revol@free.fr>
To: zsh-workers@sunsite.dk
Subject: PATCH: Re: BeOS port
Date: Mon, 17 Nov 2008 23:52:24 +0100 CET	[thread overview]
Message-ID: <12127198389-BeMail@laptop> (raw)
In-Reply-To: <1487794487-BeMail@laptop>

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

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.


[-- Attachment #2: zsh-beos.diff.001.txt --]
[-- Type: text/plain, Size: 2577 bytes --]

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));
 

  reply	other threads:[~2008-11-17 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 17:53 François Revol
2008-11-17 22:52 ` François Revol [this message]
2008-11-18 10:15   ` PATCH: " Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12127198389-BeMail@laptop \
    --to=revol@free.fr \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).