Re: Probably solved [Was: picoLisp under MacOS/X 10.6 SIG-N everytime?]

2009-11-21 Thread cle

Hello Alexander,

unfortunately I couldn't try under Leopard yet. I should get a Xcode for 
Leopard tomorrow, then I will try ...


Another correction: in my patchfile I had unnecessarily changed 
RTLD_LAZY to RTLD_NOW in src/main.c. This has not to be, as it works 
with RTLD_LAZY too. So if you want to apply my patch, I would suggest to 
revert that change and use RTLD_LAZY as before.


Sorry for the confusion I caused ...


Best regards,
Cle :-)

--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Probably solved [Was: picoLisp under MacOS/X 10.6 SIG-N everytime?]

2009-11-21 Thread cle



Alexander Burger wrote:

 Hi Cle,


Hi Alexander,


 unfortunately, we see problems on Mac OS since quite some time.
 You'll see that if you search in the archive of this mailing list
 (http://www.mail-archive.com/picolisp@software-lab.de).


I had already seen this, but those problems dealt with being not able to 
build picoLisp though. Therefore I had the hope, that my problem perhaps 
is already solved! :-}



 I don't have a Mac myself. So I'm still hoping that some of the Mac
 users fires up a debugger and helps, but no results so far :-(


Ok! Today I had give it a try and finally I was able to patch and build 
picoLisp to being runable under Snow Leopard passing all unit tests in 
lib/test.l and running doc/hello.l and doc/family.l too :-)


I have attached the patch necessary to fix all glitches for Snow 
Leopard. I have tested the changes against Snow Leopard and NetBSD and 
they work fine! I intend to have a look, if they run under Leopard 
(MacOS/X 10.5) tomorrow if I can manage to install Xcode on my PPC machine.


BTW: If you duplicate the OpenBSD section in the src/Makefile and 
replace OpenBSD by NetBSD, you can add another platform picoLisp is 
running onto :-D


The attached patch was made against the development version downloaded 
as picoLisp.tgz from your homepage. The patch was applied as:


  tar xzf picoLisp.tgz
  cd picoLisp
  patch -p0 < ../picoLisp.patch
  (cd src; make clean picolisp)
  ./p lib/test.l -bye

I hope, I did not break your coding style too much via the patch ...

Best regards and thanks for picoLisp ... :-)


Ciao,
Cle.

(...)

Index: src/Makefile
===
--- src/Makefile
+++ src/Makefile
@@ -33,11 +33,11 @@
STRIP = strip
 else
 ifeq ($(shell uname), Darwin)
OS = Darwin
PICOLISP-FLAGS = -m32 -lc -lm -ldl
-   DYNAMIC-LIB-FLAGS = -dynamiclib -undefined dynamic_lookup
+   DYNAMIC-LIB-FLAGS = -dynamiclib -undefined dynamic_lookup -m32
STRIP = :
 else
 ifeq ($(shell uname -o), Cygwin)
OS = Cygwin
DYNAMIC-LIB-FLAGS = -shared

Index: src/main.c
===
--- src/main.c
+++ src/main.c
@@ -2,10 +2,31 @@
  * (c) Software Lab. Alexander Burger
  */
 
 #include "pico.h"
 
+/* Globals declared in pico.h */
+int Signal, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
+char **AV, *AV0, *Home;
+child *Child;
+heap *Heaps;
+cell *Avail;
+stkEnv Env;
+catchFrame *CatchPtr;
+struct termios OrgTermio, *Termio;
+int InFDs, OutFDs;
+inFile *InFile, **InFiles;
+outFile *OutFile, **OutFiles;
+int (*getBin)(void);
+void (*putBin)(int);
+any TheKey, TheCls, Thrown;
+any Alarm, Line, Zero, One, Intern[IHASH], Transient[IHASH], Extern[EHASH];
+any ApplyArgs, ApplyBody, DbVal, DbTail;
+any Nil, DB, Meth, Quote, T;
+any Solo, PPid, Pid, At, At2, At3, This, Dbg, Zap, Ext, Scl, Class;
+any Run, Hup, Sig1, Sig2, Up, Err, Msg, Uni, Led, Tsm, Adr, Fork, Bye;
+
 /* Globals */
 static int TtyPid;
 static word2 USec;
 static struct timeval Tv;
 static bool Tio, Jam;
@@ -633,11 +654,11 @@
   else {
  if (n)
 memcpy(buf, Home, n);
  strcpy(buf + n, "lib/"),  strcpy(buf + n + 4, nm);
   }
-  if (!(h = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL))  ||  !(h = dlsym(h,p)))
+  if (!(h = dlopen(buf, RTLD_NOW | RTLD_GLOBAL))  ||  !(h = dlsym(h,p)))
  return NO;
   val(x) = box(num(h));
}
return YES;
 }
@@ -1061,10 +1082,17 @@
   if (*av[i] != '-') {
  if ((p = strrchr(av[i], '/')) && !(p == av[i]+1 && *av[i] == '.')) {
 Home = malloc(p - av[i] + 2);
 memcpy(Home, av[i], p - av[i] + 1);
 Home[p - av[i] + 1] = '\0';
+ }
+ else if ((p = getcwd(NULL,0)) != NULL) {
+int len = strlen(p);
+Home = malloc(len + 2);
+memcpy(Home, p, len);
+Home[len] = '/';
+Home[len + 1] = '\0';
  }
  break;
   }
AV0 = *av++;
AV = av;

Index: src/pico.h
===
--- src/pico.h
+++ src/pico.h
@@ -234,512 +234,512 @@
 /* External symbol access */
 #define Fetch(ex,x) if (isExt(x)) db(ex,x,1)
 #define Touch(ex,x) if (isExt(x)) db(ex,x,2)
 
 /* Globals */
-int Signal, Chr, Slot, Spkr, Mic, Hear, Tell, Children, ExtN;
-char **AV, *AV0, *Home;
-child *Child;
-heap *Heaps;
-cell *Avail;
-stkEnv Env;
-catchFrame *CatchPtr;
-struct termios OrgTermio, *Termio;
-int InFDs, OutFDs;
-inFile *InFile, **InFiles;
-outFile *OutFile, **OutFiles;
-int (*getBin)(void);
-void (*putBin)(int);
-any TheKey, TheCls, Thrown;
-any Alarm, Line, Zero, One, Intern[IHASH], Transient[IHASH], Extern[EHASH];
-any ApplyArgs, ApplyBody, DbVal, DbTail;
-any Nil, DB, Meth, Quote, T;
-any Solo, PPid, Pid, At, At2, At3, This, Dbg, Zap, Ext, Scl, Class;
-any Run, Hup, Sig1, Sig2, Up, Err, Msg, Uni, Led, Tsm, Adr, Fork, Bye;
+extern in

Re: picoLisp under MacOS/X 10.6 SIG-N everytime?

2009-11-20 Thread Alexander Burger
Hi Cle,

unfortunately, we see problems on Mac OS since quite some time. You'll
see that if you search in the archive of this mailing list
(http://www.mail-archive.com/picolisp@software-lab.de).

I don't have a Mac myself. So I'm still hoping that some of the Mac
users fires up a debugger and helps, but no results so far :-(

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


picoLisp under MacOS/X 10.6 SIG-N everytime?

2009-11-20 Thread cle

Hello,

I am new to picoLisp. I investigate, if I can use it for a tool that 
could replace another one internal used currently wirtten in C++. 
picoLisp seem to be a nice fit.


But unfortunately I cannot get it to run properly under Snow Leopard! To 
build picoLisp correctly I had to add a '-m32' switch to the 
DYNAMIC-LIB-FLAGS in src/Makefile. Now I can compile and execute 
picoLisp and playing with it via e.g. dbg.l.


But if I try to start a more complex example like e.g. doc/hello.l or 
doc/family.l as explained in the documentation, picoLisp will start up 
fine, but if I try to access the application via a browser over 
http://127.0.0.1:8080, picoLisp will complain on the console with some


  36829 SIG-10

Sometimes one of such a line, sometimes a few ones. And it is not SIG-10 
every time, but sometimes it will also come up with e.g. SIG-5 or such ...


Do anybody have an idea what the reason for this could be? Any hint, 
what I can do to spot the problem?


Thanks in advance for any idea you may have ...


Regards,
Cle.
--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe