qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix OS X SDL breakage


From: Bernhard Ehlers
Subject: Re: [Qemu-devel] [PATCH] Fix OS X SDL breakage
Date: Sun, 30 Jan 2005 21:21:39 +0100
User-agent: Mutt/1.5.6+20040907i

Fabrice Bellard wrote:

> Can you confirm that QEMU for OS X works with this include ? IMHO it was
> added to add the '#define main SDL_main' define.
> 
> Fabrice.

Hi,

Here my test results on my Mac OS X 10.3.7.

I use the qemu-snapshot-2004-12-28_23.tar.bz2 from 
http://people.fruitsalad.org/nox/ , but the results should be the same on CVS.

1)  self compiled SDL V1.2.8

# sdl-config --version --cflags --libs
1.2.8
-I/usr/local/include/SDL -D_THREAD_SAFE
-L/usr/local/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL

a) no change to vl.c
compiles OK, links OK, runs OK

b) remove the #include SDL/SDL.h in vl.c
compiles OK, links OK, crashes during execution

2005-01-29 11:31:55.502 qemu[1222] *** _NSAutoreleaseNoPool(): Object 0x1b01550 
of class NSCFArray autoreleased with no pool in place - just leaking
.
.
.
2005-01-29 11:31:55.533 qemu[1222] *** _NSAutoreleaseNoPool(): Object 0x1b39850 
of class NSException autoreleased with no pool in place - just leaking
2005-01-29 11:31:55.533 qemu[1222] *** Uncaught exception: 
<NSInternalInconsistencyException> Error (1002) creating CGSWindow

2)  Fink sdl v1.2.7-1

# sdl-config --version --cflags --libs
1.2.7
-I/sw/include/SDL -D_THREAD_SAFE
-L/sw/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL

a) no change to vl.c
compile error in vl.c, include file SDL/SDL.h not found

b) remove the #include SDL/SDL.h in vl.c
compiles OK, links OK, crashes during execution (see 1b)


So the removal of the #include <SDL/SDL.h> crashes the executable on MAC OSX. 
That means it has to stay.

On the other side it compiles only for the default SDL installation because 
/usr/local/include is in the default include search path. The problem is, that 
for the compilation of vl.c the SDL include path (sdl-config --cflags) is not 
used.

My proposal is to modify the Makefiles, so that for the compilation of vl.c the 
SDL_CFLAGS are used.

Here my patches. Now it compiles, links and runs with both SDL libraries.

Best regards

Bernhard Ehlers

diff -ru qemu.orig/Makefile.target qemu/Makefile.target
--- qemu.orig/Makefile.target   Mon Dec 20 00:33:47 2004
+++ qemu/Makefile.target        Sat Jan 29 12:16:04 2005
@@ -348,6 +348,9 @@
 sdlaudio.o: sdlaudio.c
        $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
 
+vl.o: vl.c vl.h
+       $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+
 depend: $(SRCS)
        $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
 
diff -ru qemu.orig/vl.c qemu/vl.c
--- qemu.orig/vl.c      Mon Dec 20 00:18:01 2004
+++ qemu/vl.c   Sat Jan 29 12:16:34 2005
@@ -68,7 +68,7 @@
 
 #ifdef CONFIG_SDL
 #ifdef __APPLE__
-#include <SDL/SDL.h>
+#include <SDL.h>
 #endif
 #endif /* CONFIG_SDL */
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]