Universal build of an app on MacOSX from command line using SDL 1.2 framework?

I’ve been generating MacOS X universal builds of a cross-platform
application that uses SDL 1.2 by installing a build environment with
MacPorts configured to produce universal binaries. The app is built
using a standard ./configure, which uses the MacPorts sdl-config to find
the SDL header files, make, and then a make target I set up which links
with the libSDLmain.a from MacPorts and bundles up an app that includes
the framework binaries I downloaded from libsdl.org.

This is something I cobbled together by trial and error, but it has
worked up until now and lets me use the existing unix command line
scripts and makefiles to get a universal binary app for the Mac.

However, the current release of MacPorts no longer supports building a
universal app under MacOS 10.5 or 10.6 that will run on MacOS 10.4. And
I read in this mailing that fatbuild.sh no longer works to get a
universal binary of SDL for building with a makefile.

The only documentation I’ve found here about universal binaries uses an
XCode project, which isn’t something I’ve worked with and would involve
porting the existing autoconfig/automake command line based build setup.

Is there a way of setting up a makefile to build against the SDL 1.2
framework so I can just download the existing framework headers and
binaries from libsdl.org? If I do that, how do I generate a libSDLmain.a
to link against?

Is there a standard way or an example of building a universal binary app
that uses libSDL, using command line and Makefile now that fatbuild.sh
doesn’t do it?

Thanks,

Sidney Markowitz
http://sidney.com

if you use SDL_CFLAGS and SDL_LIBS in the makefile you should be able to
over ride them on the command line. i would guess that you have configure
replace @SDL_CFLAGS@ and @SDL_LIBS@ in makefile.am?

guessing you would include the path to the framework headers for the
CFLAGS and ‘-framework SDL’ for SDL_LIBS

i have been experimenting with this on osx too. for my app i would like
the bundle framework to work just as well and easily as the unix install.
at the moment i am still tweaking the unix build. i use gentoo prefix
instead of macports though.

mattOn Thu, 26 Nov 2009, Sidney Markowitz wrote:

I’ve been generating MacOS X universal builds of a cross-platform application
that uses SDL 1.2 by installing a build environment with MacPorts configured
to produce universal binaries. The app is built using a standard ./configure,
which uses the MacPorts sdl-config to find the SDL header files, make, and
then a make target I set up which links with the libSDLmain.a from MacPorts
and bundles up an app that includes the framework binaries I downloaded from
libsdl.org.

This is something I cobbled together by trial and error, but it has worked up
until now and lets me use the existing unix command line scripts and
makefiles to get a universal binary app for the Mac.

However, the current release of MacPorts no longer supports building a
universal app under MacOS 10.5 or 10.6 that will run on MacOS 10.4. And I
read in this mailing that fatbuild.sh no longer works to get a universal
binary of SDL for building with a makefile.

The only documentation I’ve found here about universal binaries uses an XCode
project, which isn’t something I’ve worked with and would involve porting the
existing autoconfig/automake command line based build setup.

Is there a way of setting up a makefile to build against the SDL 1.2
framework so I can just download the existing framework headers and binaries
from libsdl.org? If I do that, how do I generate a libSDLmain.a to link
against?

Is there a standard way or an example of building a universal binary app that
uses libSDL, using command line and Makefile now that fatbuild.sh doesn’t do
it?

Thanks,

Sidney Markowitz
http://sidney.com


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

mattmatteh at mac.com wrote, On 26/11/09 8:31 PM:

i have been experimenting with this on osx too. for my app i would like
the bundle framework to work just as well and easily as the unix install.

I modified the fatbuild script so it works with 1.2.14 to let me build
it universal for 10.4+, or 10.5+ if you are on Snow Leopard and haven’t
installed the optional 10.4 SDK. The app I’m building doesn’t use SDL
1.3, so I haven’t had a reason to see if the script would have to be
changed to work in 1.3.

If the devs are interested in a working fatbuild script let me know and
I’ll upload the patch.

Anyway, that solves my problem as I can now build a universal
application and I don’t have to use the framework at all.

Sidney Markowitz wrote, On 28/11/09 3:34 AM:

I modified the fatbuild script so it works with 1.2.14

I just noticed bug http://bugzilla.libsdl.org/show_bug.cgi?id=867 that
mentions that the script was fixed (for Mac OS 10.6) in svn after 1.2.14
was released, and includes a further patch for building under 10.4. So I
guess my modification is unnecessary.

My platform is Mac OS 10.6, 32 bit.

With SDL 1.2.14 installed, when I build SDL_mixer-1.2.11 from sources
with the --disable-music-ogg-shared option I get no error messages, but
when I try build/playwave mysamplefile.ogg I get

Opened audio at 22050 Hz 16 bit stereo
Couldn’t load mysamplefile.ogg: Unrecognized sound file type

When I try it with a wav file it works fine.

If I build SDL_mixer with the default --enable-music-ogg-shared, it all
works fine.

Does anyone know if --disable-music-ogg-shared does work on any
platform, or is there a known bug with it?

My goal is to get a self-contained static build of the application, and
so far I haven’t escaped the need to dynamically link to ogg vorbis.

Thanks,

Sidney Markowitz
http://sidney.com