iPhone template main.c patch SDL1.2 => SDL1.3

Hi,

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I’m hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for “device” and “simulator” version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I’m not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker

-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-xcode-template.patch
Type: application/octet-stream
Size: 3119 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110128/0bce8728/attachment.obj
-------------- next part --------------

Your changes are in, thanks!On Fri, Jan 28, 2011 at 1:57 AM, Kees Bakker <kees.bakker at xs4all.nl> wrote:

Hi,

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I’m hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for “device” and “simulator” version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I’m not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Great.

The article in the following link gives a good workaround
to setup the xcode project with the two libraries. We can even
use the same name (in different directories of course). The trick
is to only link one of the two depending on the selection of "device"
or “simulator”.

Other than that, I am not a fan of Xcode, to put it mildly.

http://iphoneincubator.com/blog/xcode/how-to-add-multiple-static-library-files-with-different-architectures-to-xcode

Kind regards,
Kees BakkerOn 28 Jan, 2011, at 19:38 , Sam Lantinga wrote:

Your changes are in, thanks!

On Fri, Jan 28, 2011 at 1:57 AM, Kees Bakker <@Kees_Bakker> wrote:
Hi,

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I’m hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for “device” and “simulator” version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I’m not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


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

you can also do that by draggin the sdl xcode project inside your
xcode one, and then after expanding it you can drag the sdl library
under the “link binaries” phase of your target – this will reduce
clutter under your file list and automatically link the correct
version (device/simulator | debug/release)

bye
VittorioOn Fri, Jan 28, 2011 at 9:18 PM, Kees Bakker <kees.bakker at xs4all.nl> wrote:

Great.
The article in the following link gives a good workaround
to setup the xcode project with the two libraries. We can even
use the same name (in different directories of course). The trick
is to only link one of the two depending on the selection of "device"
or “simulator”.
Other than that, I am not a fan of Xcode, to put it mildly.
http://iphoneincubator.com/blog/xcode/how-to-add-multiple-static-library-files-with-different-architectures-to-xcode
Kind regards,
Kees Bakker
On 28 Jan, 2011, at 19:38 , Sam Lantinga wrote:

Your changes are in, thanks!

On Fri, Jan 28, 2011 at 1:57 AM, Kees Bakker <kees.bakker at xs4all.nl> wrote:

Hi,

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I’m hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for “device” and “simulator” version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I’m not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker


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


? ? -Sam Lantinga, Founder and President, Galaxy Gameworks LLC


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

FYI, I started mucking with everything. Perhaps the most significant
change is I made a Universal Binary out of libSDL.a for the simulator
and device.

My work branches (in-progress):

SDL
http://hg.assembla.com/sdl-ios-xcode

SDL & Satellites super-repo
http://hg.assembla.com/sdl-satellites-subrepos

-EricOn 1/28/11, Kees Bakker <kees.bakker at xs4all.nl> wrote:

Hi,

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I’m hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for “device” and “simulator” version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I’m not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Yes, this is actually a good approach, especially since Apple has
really crippled the iOS side of the Xcode toolchain for things like
3rd party libraries (especially dynamic libraries which causes pain
and hurt when dealing with LGPL licenses and technical things like
Obj-C class categories). Of course there are also some trade-offs as
well like rebuilding all of SDL for your project.

Both a prebuilt static lib and referencing the entire Xcode project
have their own merits. I’m indecisive about which to do so I think I
will ultimately will be documenting both ways.

My previous response does the prebuilt Universal libSDL.a way with the
iOS Xcode project template. However, for actually building the SDL
satellites (SDL_ttf (and freetype), SDL_image, etc), I will be doing
the reference approach. I’m in the process of utilizing the Mercurial
subrepo feature for this.

My branch:
SDL & Satellites super-repo
http://hg.assembla.com/sdl-satellites-subrepos

-EricOn 1/31/11, Vittorio G. <vitto.giova at yahoo.it> wrote:

you can also do that by draggin the sdl xcode project inside your
xcode one, and then after expanding it you can drag the sdl library
under the “link binaries” phase of your target – this will reduce
clutter under your file list and automatically link the correct
version (device/simulator | debug/release)


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

FYI, I started mucking with everything. Perhaps the most significant
change is I made a Universal Binary out of libSDL.a for the simulator
and device.

Good point

My work branches (in-progress):

SDL
http://hg.assembla.com/sdl-ios-xcode

SDL & Satellites super-repo
http://hg.assembla.com/sdl-satellites-subrepos

Thanks. Always good to see examples how things should/could
be done.On 31 Jan, 2011, at 16:42 , Eric Wing wrote: