Gentoo Archives: gentoo-osx

From: "Dirk Schönberger" <dirk.schoenberger@×××××××××.de>
To: gentoo-osx@l.g.o
Subject: Re: [gentoo-osx] Gentoo-OSX and Mac system / frameworks
Date: Thu, 02 Feb 2006 14:19:55
Message-Id: 59121.84.179.212.10.1138889884.squirrel@mail.sz-online.de
In Reply to: Re: [gentoo-osx] Gentoo-OSX and Mac system / frameworks by Kito
1 >> Something like a "Creating and using MacOS frameworks in 21 days"
2 >> type guide
3 >> would be nice, though ;)
4 >
5 > Straight from the horses mouth:
6 >
7 > http://developer.apple.com/documentation/MacOSX/Conceptual/
8 > BPFrameworks/index.html
9 >
10
11 Thanks for the link. However, it seems to be rather Apple specific and not
12 really suited specific for the things I want to do.
13 So perhaps I have to start from the basics and woork from there on.
14
15 I have an open source application (a game which depend on SDL, not in
16 Gentoo, yet).
17 I have a working libSDL, libSDL_ttf, libSDL_image aso from Gentoo-OSX,
18 installed into /usr prefix (/usr/lib, /usr/include)
19 The game compiles and runs fine if started from the console.
20 As a good Apple developer and user ;) I would like to create an
21 application folder
22 in order to be able to start the application from inside the finder,
23 without having to resort to the CLI.
24 I have managed a basic app folder, mostly by manually copying the
25 necessary files into the needed places. The game runs from the finder.
26
27 Next step would be to create a standalone application, suitable for
28 distribution.
29 This means including the used libs into the app folder structure.
30 If I check the actual executable with otool -L, I see that the exe is
31 still linked against /usr/lib/libSDL-X.Y.Z.dylib (including other libs and
32 system frameworks)
33
34 >From what I see, basically I have two choices.
35
36 a) copy the needed libs to a app folder local sub folder and do some hacks
37 with DYLD_LIBRARY_PATH. The actual starting program of my application is a
38 Unix shell script, so this could be even possible
39 b) learn to build frameworks from inside Gentoo, so that I can link
40 against the framework. I have the idea that I can distribute the framework
41 as part of my app folder and it is fetched automatically.
42
43 >From what I have seen in the link you gave, framework creation is done in
44 XCode / ProjectBuilder only. I did not found any example about how to do
45 this in a portage like environment (I found a DarwinPorts script for
46 creating a libSDL framework, but this uses .pbx scripts, too)
47
48 After a framework is created (which I think is the problematic part), I
49 assume that using the framework just is replacing a
50
51 gcc CFLAGS main.c -o main.o
52 gcc LFLAGS main main.o
53
54 with
55
56 CFLAGS=-I/usr/include
57 LDFLAGS=-L/usr/lib -lSDL
58
59 by a
60
61 CFLAGS=-framework SDL
62 LDFLAGS=-framework SDL
63
64 and for deployment just copy the files from the framework (or a subset
65 from them?) into my app folder?
66
67 Regards
68 Dirk
69
70
71 --
72 gentoo-osx@g.o mailing list