qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Ehlers <B-Ehlers@gmx.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix OS X SDL breakage
Date: Sun, 30 Jan 2005 21:21:39 +0100	[thread overview]
Message-ID: <20050130202139.GA6410@colin.test> (raw)

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	other threads:[~2005-01-30 20:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-30 20:21 Bernhard Ehlers [this message]
2005-01-30 22:43 ` [Qemu-devel] SDL fix (was: [PATCH] Fix OS X SDL breakage) Daniel Egger
2005-01-30 22:55   ` Daniel Egger
  -- strict thread matches above, loose matches on Subject: below --
2005-01-23 22:31 [Qemu-devel] [PATCH] Fix OS X SDL breakage Daniel Egger
2005-01-26 19:47 ` Fabrice Bellard
2005-01-26 20:47   ` Daniel Egger
2005-01-26 20:58   ` Laurent Amon
2005-01-27  7:53     ` Daniel Egger
2005-01-27 10:51       ` Laurent Amon
2005-01-27 11:40         ` Johannes Schindelin
2005-01-27 12:08           ` René Korthaus
2005-01-27 17:07             ` Daniel Egger
2005-01-27 22:39             ` Daniel Egger
2005-01-27 23:01             ` Laurent Amon
2005-01-27 21:33         ` Daniel Egger

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=20050130202139.GA6410@colin.test \
    --to=b-ehlers@gmx.de \
    --cc=qemu-devel@nongnu.org \
    /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.
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).