Emuforums.com

Go Back   Emuforums.com > Handheld Emulation > VBA-M Discussion
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old March 9th, 2008   #1 (permalink)
Registered User
 
Join Date: Mar 2008
Location: Norway
Posts: 3
native MacOSX support

Hi, I spent last few days trying to compile VBA-M under MacOSX and I'd like to share my findings to see if there is any interest among devs to officially support this in the main tree. At the same time, this can be seen as a sort of guide to compile VBA-M using native MacOSX SDL.

As a premise, I know that the compilation under Mac using macports libSDL is possible. And I want to thank ashaw, peterb and all the devs for the efforts put in making a real cross platform emu. Anyway, I personally keep thinking that using X11 SDL on Mac is a bit of cheating

So, what if I want to compile VBA-M with Mac SDL? well, let's simply try to do a
Code:
make
and look at the errors!


The first issue you can encounter is with libpng. This library, indeed, is not installed by default in Mac and therefore the compiler would complain about a missing png.h. Anyway, this can be solved by simply downloading, compiling and installing Mac libpng. No exoteric knowledge needed.


The second issue is a bit more problematic (and it's the only real issue with compiling VBA-M under Mac). Indeed, VBA-M compilation does use sdl-config and there is no sdl-config in Mac SDL.
This is a design choice of SDL developers, and they also offer a (sort of) solution: either use Xcode (something I'd like to avoid) or include SDLMain.m/.h in the source. In a sense, programs requiring sdl-config to be compiled are not supposed to work under MacOSX, and they only work relying on the X11 compatibility.
The SDLMain path is often followed by Mac programs (emulators as well, e.g. SDLMAME) and it's the one I decided to use in my building process. It consists in adding to the source the files SDLMain.m & .h (possibly editing the #include headers if you put them in a different directory than src/ ) and in adding the following line in the Makefile
Code:
LFLAGS=-lz -lpng -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers SDLmain.m -framework SDL -framework Cocoa -framework OpenGL
in a suitable ifdef, not to change the default behaviour (if you're compiling this for yourself only, you could as well put the line above in the Darwin ifdef... but this way you would disable VBA-M compilation with macport libSDL)


Finally, there is another small problem with the strip part, when the executable has the symbols stripped out. Indeed, under Linux the command
Code:
strip -s
means "--strip-all", while there is no equivalent option under Mac, where "-s" always expects a symbol_reference file as a parameter and therefore the compiler complains. Anyway, you can skip this step and the executable is working perfectly.


In conclusion, I would like to know if developers are interested in adding the SDLMain.m/.h files to the source and adding the corresponding line to the Makefile as an opton at compile time.
Otherwise, anyone interested in obtaining a native VBA-M could always follow the above steps to self compile it
etabeta is offline   Reply With Quote
Old March 9th, 2008   #2 (permalink)
Registered User
 
Join Date: Dec 2007
Location: New-Orleans
Posts: 46
Hmmm
It looks like ashaw managed to build the SDL port on MacOS X without adding any extra file :
http://forums.ngemu.com/vba-m/98452-...ml#post1256321
bgKu is offline   Reply With Quote
Old March 9th, 2008   #3 (permalink)
Registered User
 
Join Date: Mar 2008
Location: Norway
Posts: 3
from the post you linked:
Quote:
You also need to install the following via macports on top of the Xcode 3.0 dev tools.
libsdl
glut
libpng
as I said at the beginning of my post, I know you can do things that way. but it uses macports libSDL, i.e. the *nix SDL libraries, in place of the Mac SDL.
for people already using Mac SDL for other stuff, it would mean to install 2 different versions of the same libraries...
etabeta is offline   Reply With Quote
Old March 9th, 2008   #4 (permalink)
VBA-M Team
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 5,905
well if you want to work on the mac port.... we kicked peterb off coz he whinged to much, rather then fixing things.
Squall-Leonhart is offline   Reply With Quote
Old March 9th, 2008   #5 (permalink)
Registered User
 
Join Date: Mar 2008
Location: Norway
Posts: 3
right now I'm really busy at work, so I don't think I could offer much more than a bit of feedback in case of regressions in the svn repository. once I'm done with my present deadlines, who knows...

moreover, the only things needed at the moment (until I have time to install Qt and test the GUI) are:
* the addition of the SDLMain (but would other devs agree? I recall there were already various discussions about the dependencies folder... I wouldn't like to piss off anyone)
* the addition in Makefile of a building option to choose between Darwin and the native Mac SDL (but Nach is the Makefile god, so it would be better to ask him for a clean solution )
etabeta is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT. The time now is 23:55.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5