Hi Denis,

Thanks a lot! This works very fine, both on OSX 10.6.8 and 10.8.5. I shall update the gl.tgz on my <http://folk.uio.no/jkleiser/pico/> a little later. You mentioned that you didn't understand what to do with the font-menu.l. I tested it on both of my Macs. The font menu pops up when I use a real mouse and click the right mouse button. However, if I use the Ctrl key together with a normal (left button) click, nothing happens.


/Jon

On 21-11-13 00:01 , Denis Fourt wrote:
Hello again,

Jon : I have modified the makefile from your gl lib. I use mac os 10.6 with gcc 
4.2. Here is the diff output so changes will be easier to understand. I  tried 
to attach the files, but it seems I have not succeeded, sorry. So, posting 
again and with you permission Jon, I would send to your own mail box my new 
version of your makefile if you liked. Here is the diff:

--- a/gl/Makefile
+++ b/gl/Makefile
@@ -17,7 +17,7 @@ ifeq ($(shell uname), FreeBSD)
  else
  ifeq ($(shell uname), Darwin)
        &  export MACOSX_DEPLOYMENT_TARGET=10.4     &  only for PPC Mac
-       DYNAMIC-LIB-FLAGS = -dynamiclib -undefined dynamic_lookup -framework 
GLUT
+       DYNAMIC-LIB-FLAGS = -m32 -dynamiclib -undefined dynamic_lookup 
-framework OpenGL -framework GLUT
        STRIP = :
  else
  ifeq ($(shell uname -o), Cygwin)
@@ -35,8 +35,8 @@ endif
  all: $(lib)/gl $(lib)/glu $(lib)/glut
.c.o:
-       gcc -c -O -pipe \
-       -falign-functions -fomit-frame-pointer \
+       gcc -c -O -m32 -pipe \
+       -falign-functions -fomit-frame-pointer -fno-strict-aliasing \
        -W -Wimplicit -Wreturn-type -Wunused -Wformat \
        -Wuninitialized -Wstrict-prototypes \
        -D_GNU_SOURCE  -D_FILE_OFFSET_BITS=64  $*.c

----------------------------------------------------------------------------------------------------------------------------------------------

I force building and linking with 32 bits binaries, which is what pil 32 
expects.

Do no forget, I am no Makefile/gcc specialist. It seems that two "-m32" are 
required. There may be a more elegant solution and I am not aware on the impact on 32 
bits darwins or other gcc.

I have been able to run all the tests except that I have not understood what to 
do with the font-menu.

Tomas : thanks for the link to the repository and all the information. In that 
case, I believe there is no problem with picolisp. I may (I should) 
nevertheless try this gcc.l code, when I have the time.

Thanks to all,

Denis
----------------------------------------
From: jon.klei...@usit.uio.no
To: picolisp@software-lab.de
Subject: Re: PicoLisp on mac osx : bug
Date: Wed, 20 Nov 2013 08:49:10 +0100

Hi Denis,

It's not clear to me exactly what you did to get OpenGL working with
pil32 on Mac.

On 19-11-13 16:05 , Denis Fourt wrote:
Hello Alexander,

Yes, I installed pil32 and Jon Kleiser's library. I built everything but the 
small test program could not find the gl functions wrappers.

So I modified the gl lib makefile and everything works : now I have a pil32 
running with openGL on mac os 10.6 (so not need for the emulator).
The "gl lib makefile" that you modified, is that the one here
<http://folk.uio.no/jkleiser/pico/gl/Makefile>  ?
How did you modify it? I'd be glad to have OpenGL working with pil32 on
Mac again.

/Jon

BUT:

1) The changes I made are surely not perfect, they are likely to cause some 
troubles on the other OSs or other (older?) versions of mac os x. So I have 
just explained them here, because they could be useful for another user or to 
correctly fix the makefile (sorry I cannot help more).

2) I have been curious to understand how to link pil32 with C code, so I had a 
look at the gcc.l file and the Darwin section might not run on a 64 bits mac, 
because it uses the same arguments for gcc as the gl makefile.

So, no problem on my side, but it would be nice if someone else could issue a 
proper fix (unless the real 64 bits for mac osx will be soon available).

Thanks,

Denis

----------------------------------------
From: a...@software-lab.de
To: picolisp@software-lab.de
Subject: Re: PicoLisp on mac osx : bug
Date: Tue, 19 Nov 2013 08:27:51 +0100

Hello Denis,

I have no Mac myself, but let me ask for understanding the problem.

I downloaded and installed Picolisp 32 bits on mac os 10.6. Everything
went all right. Then I tried to install the library for openGL and I had
to modify the makefile to build a 32 bits lib.
I assume that you mean Jon Kleiser's library in "gl.tgz", right? This is
currently the only way to get openGl on pil32.

Another possibility might be running the pil64 emulator on the Mac.
Should be built automatically if you 'make' in the src64 directory. In
pil64 you can use "lib/openGl.l", but unfortunately the emulator is much
slower than native executables.


**********
DYNAMIC-LIB-FLAGS = -m32 -dynamiclib -undefined dynamic_lookup -framework 
OpenGL -framework GLUT
**********

I do not believe the -framework OpenGL is required, but it may be cleaner

**********
c.o:
gcc -c -O -m32 -pipe \
-falign-functions -fomit-frame-pointer -fno-strict-aliasing \
-W -Wimplicit -Wreturn-type -Wunused -Wformat \
-Wuninitialized -Wstrict-prototypes \
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $*.c
**********

I had the -m32. I had the -fno-strict-aliasing, I do not know if it is
required, but PicoLisp need it and there is some code in the pico.h file
which is included.

I am no makefile specialist. Adding -m32 will impact compilation on
the other platforms. There may be better ways to fix it too.

The lib/gcc.l file may need a similar fix, but I have not try to use
it.

The problem arises on 64 bits macs which support both kind of binaries
: 64 seems to be the default.
So this is what I don't understand. What exactly is the problem?

♪♫ Alex


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to