OSX port

All,
I am about to port an SDL app. from linux to OSX. I have never developed on OSX before but just wondered if there any gotchas I should know about. As it’s BSD under the hood, allbeit the Darwin flavour (which I believe uses the mach micro-kernel…) it should be straight forward…yeah right !!

I am using wxWidgets for the GUI portion of the app and SDL for the sound and video abstraction.

I do know I need to install Apples XCODE pkg first (to get gcc and such like) and it looks like FINK seems to be the pkg manager of my choice as it seems to emulate apt-get which I like.
It’s an Intel based minimac with OSX installed.

Many thanks for any help,
-Chris

I don’t know anything about wxWidgets, but the SDL portion worked out
of the box for me when I ported marfitude. The only major issues I had
in porting (as I recall…it’s been a while :slight_smile: were:

  1. There was no simple dlopen()/dlsym()/dclose() functionality that
    you would expect in a Linux or BSD environment. I was eventually able
    to wrap it with a few macros that call
    CFReallyLongFunkyNameFunctions(). Point is if you dynamically load
    stuff at run time you should check to see if OSX now supports those
    functions (I last checked 10.4, I think…), or just copy the macros
    from util/dl.h in the marfitude source.

  2. The other issue I had was providing the .dmg file (bundle?) so you
    can move the entire game using the one icon, double click to run, etc.
    It just took me a while to figure out the directory structure, which
    files were actually necessary, etc. Also there was some weird caching
    issue where OSX caches bundle data, so I just had to log out and log
    back in every time I changed that stuff (like Info.plist and friends).
    Maybe there’s an easier way - I’m clearly not a Mac guru :). If it
    helps, you could again look at the marfitude source (in
    marfitude/macosx/, and mk/arch/darwin.mk) as a fairly basic example.
    That directory contains all the stuff that forms the bundle info, and
    the darwin.mk file has the commands to build the bundle. You might
    want to check out a tutorial online first though so you have some idea
    of what’s going on.

If you don’t use dlfoo() and don’t want to build a bundle, you might
have an easy time with it :wink:

Hope that helps,
-MikeOn 7/1/07, Chris Dobbs <chris_dobbs at dobbscr.karoo.co.uk> wrote:

All,
I am about to port an SDL app. from linux to OSX. I have never developed on
OSX before but just wondered if there any gotchas I should know about. As
it’s BSD under the hood, allbeit the Darwin flavour (which I believe uses
the mach micro-kernel…) it should be straight forward…yeah right !!

I am using wxWidgets for the GUI portion of the app and SDL for the sound
and video abstraction.

All,
I am about to port an SDL app. from linux to OSX. I have never
developed on
OSX before but just wondered if there any gotchas I should know
about. As
it’s BSD under the hood, allbeit the Darwin flavour (which I
believe uses
the mach micro-kernel…) it should be straight forward…yeah
right !!

I am using wxWidgets for the GUI portion of the app and SDL for
the sound
and video abstraction.

I don’t know anything about wxWidgets, but the SDL portion worked out
of the box for me when I ported marfitude. The only major issues I had
in porting (as I recall…it’s been a while :slight_smile: were:

  1. There was no simple dlopen()/dlsym()/dclose() functionality that
    you would expect in a Linux or BSD environment. I was eventually able
    to wrap it with a few macros that call

That must have been a long time ago :-). The OS provides these
nowadays, and for older systems, there is dlcompat.

CFReallyLongFunkyNameFunctions(). Point is if you dynamically load
stuff at run time you should check to see if OSX now supports those
functions (I last checked 10.4, I think…), or just copy the macros
from util/dl.h in the marfitude source.

10.4 definitely supports them out of the box. But in an SDL app,
I’d recommend using SDL_LoadObject / SDL_LoadFunction /
SDL_UnloadObject anyway.

Cheers,
MaxAm 01.07.2007 um 14:44 schrieb Mike Shal:

On 7/1/07, Chris Dobbs <chris_dobbs at dobbscr.karoo.co.uk> wrote:

  1. There was no simple dlopen()/dlsym()/dclose() functionality that
    you would expect in a Linux or BSD environment. I was eventually able
    to wrap it with a few macros that call

That must have been a long time ago :-). The OS provides these
nowadays, and for older systems, there is dlcompat.

Yeah, it was quite a while ago. I must have written it for an older
version and not checked again on the newer ones (once it works, why
bother, right? :). Thanks for the correction - I’ll have to look into
cleaning that up next time around!

-MikeOn 7/1/07, Max Horn wrote:

Am 01.07.2007 um 14:44 schrieb Mike Shal:

Try installing fink, get all the necessary libs ./configure && make &&
make install.

When I used my Mac when OS X first came out, I never had a single
Linux app not compile. Then again I was using XR116

-JoshOn 7/1/07, Chris Dobbs <chris_dobbs at dobbscr.karoo.co.uk> wrote:

All,
I am about to port an SDL app. from linux to OSX. I have never developed on
OSX before but just wondered if there any gotchas I should know about. As
it’s BSD under the hood, allbeit the Darwin flavour (which I believe uses
the mach micro-kernel…) it should be straight forward…yeah right !!

I am using wxWidgets for the GUI portion of the app and SDL for the sound
and video abstraction.

I do know I need to install Apples XCODE pkg first (to get gcc and such
like) and it looks like FINK seems to be the pkg manager of my choice as it
seems to emulate apt-get which I like.
It’s an Intel based minimac with OSX installed.

Many thanks for any help,
-Chris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It’s very comforting to hear these sort of comments.
Many thanks for input so far. Will post how I get on !
-Chris> ----- Original Message -----

From: jshriver@gmail.com (Joshua Shriver)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Sunday, July 01, 2007 6:26 PM
Subject: Re: [SDL] OSX port

Try installing fink, get all the necessary libs ./configure && make &&
make install.

When I used my Mac when OS X first came out, I never had a single
Linux app not compile. Then again I was using XR116

-Josh

On 7/1/07, Chris Dobbs <@Chris_Dobbs> wrote:

All,
I am about to port an SDL app. from linux to OSX. I have never developed
on

OSX before but just wondered if there any gotchas I should know about.
As

it’s BSD under the hood, allbeit the Darwin flavour (which I believe
uses

the mach micro-kernel…) it should be straight forward…yeah right !!

I am using wxWidgets for the GUI portion of the app and SDL for the
sound

and video abstraction.

I do know I need to install Apples XCODE pkg first (to get gcc and such
like) and it looks like FINK seems to be the pkg manager of my choice as
it

seems to emulate apt-get which I like.
It’s an Intel based minimac with OSX installed.

Many thanks for any help,
-Chris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

All,
I am about to port an SDL app. from linux to OSX. I have never
developed on OSX before but just wondered if there any gotchas I
should know about. As it’s BSD under the hood, allbeit the Darwin
flavour (which I believe uses the mach micro-kernel…) it should
be straight forward…yeah right !!

I am using wxWidgets for the GUI portion of the app and SDL for the
sound and video abstraction.

I don’t know anything about wxWidgets, but the SDL portion worked out
of the box for me when I ported marfitude. The only major issues I had
in porting (as I recall…it’s been a while :slight_smile: were:

  1. There was no simple dlopen()/dlsym()/dclose() functionality that
    you would expect in a Linux or BSD environment. I was eventually able
    to wrap it with a few macros that call
    CFReallyLongFunkyNameFunctions(). Point is if you dynamically load
    stuff at run time you should check to see if OSX now supports those
    functions (I last checked 10.4, I think…), or just copy the macros
    from util/dl.h in the marfitude source.

  2. The other issue I had was providing the .dmg file (bundle?) so you
    can move the entire game using the one icon, double click to run, etc.
    It just took me a while to figure out the directory structure, which
    files were actually necessary, etc. Also there was some weird caching
    issue where OSX caches bundle data, so I just had to log out and log
    back in every time I changed that stuff (like Info.plist and friends).
    Maybe there’s an easier way - I’m clearly not a Mac guru :). If it
    helps, you could again look at the marfitude source (in
    marfitude/macosx/, and mk/arch/darwin.mk) as a fairly basic example.
    That directory contains all the stuff that forms the bundle info, and
    the darwin.mk file has the commands to build the bundle. You might
    want to check out a tutorial online first though so you have some idea
    of what’s going on.

If you don’t use dlfoo() and don’t want to build a bundle, you might
have an easy time with it :wink:

Hope that helps,
-Mike


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

if you app is open source, please provide a make file that can install
like linux/unix. i have found linux apps where users have an osx port,
but only provide a dmg. most if not all will like that and the .app
package, but i would still rather install with a make file sometimes.
and it lets others help you too.

mattOn Sun, 1 Jul 2007 08:44:18 -0400 “Mike Shal” wrote:

On 7/1/07, Chris Dobbs <chris_dobbs at dobbscr.karoo.co.uk> wrote: