[wx-dev] Creating a MacOS X Framework
Etienne Samson
samson.etienne at gmail.com
Mon Mar 5 10:41:53 PST 2007
Le 5 mars 07 à 18:34, Vadim Zeitlin a écrit :
> On Mon, 5 Mar 2007 10:11:25 +0100 Anders F Björklund
> <afb at algonet.se> wrote:
>
> AFB> > Maybe this is a stupid question but what's the point of
> using Xcode
> AFB> > for something like that? Wouldn't it be more convenient (and,
> AFB> > importantly, much more amenable to automation) to use a simple
> AFB> > makefile?
> AFB>
> AFB> I think that most people on Mac use Xcode rather than Make,
> and those
> AFB> that use autoconf/make probably want the UNIX libraries rather
> than
> AFB> frameworks.
>
> I agree that people _using_ the framework would use Xcode. But normal
> users like this won't need to build the framework if we distribute the
> official version of it. And for us it's more convenient to be able
> to build
> it remotely and so using command line tools is more convenient (as
> usual ;-)
I agree that building a framework without Xcode is actually a real
hassle ;-). If you need some kind of almost-official wx.framework
manager, I'll be glad to take care of this.
>
> AFB> It would be a good thing if both the Xcode projects and the
> AFB> autoconf/make built the same libraries
>
> This is absolutely required, indeed. Isn't it the case already?
It should, as the only difference is that in a framework, there can
be only one dylib (which requires --enable-monolithic for configure).
This limitation could be overcomed by using an umbrella framework,
but Apple recommends not to use these...
>
> AFB> Even nicer would be if the Xcode projects could be generated
> AFB> automatically, but that would first require a major new
> feature for
> AFB> Bakefile - though great.
>
> Yes, Xcode backend is sorely lacking. But it's another topic.
>
> AFB> > You'd also probably need to symlink some other things, e.g.
> wxstd.mo
> AFB> > and wxwin.m4.
> AFB>
> AFB> Then again, if you want to support those you probably want
> UNIX install
>
> I could be wrong but I thought that we'd distribute *only* the
> framework
> for OS X. And so it should include everything necessary for both Xcode
> builds using framework as such and for command line builds. Maybe
> this is
> impossible for some reason but if it is indeed possible then I'd
> really
> prefer to do it like this. Having one distribution is always better
> than 2.
For (MacOS X) developers, a framework is preferable to a static or
dynamic library, because the framework contains everything needed for
development (dylib, headers, default icons, ...).
I think that going the framework way doesn't require inclusion of .m4
files, because Apple-GCC (and IIRC mainstream GCC) support a -
framework option that can be used to include a Framework, which means
that as soon as you're building on OSX, you should just need to tell
the compiles "use this framework", should you go the Xcode way or the
configure/make way.
> AFB> And it would probably require the build scripts and Xcode
> templates
> AFB> and other things to be written first, before it being
> considered ?
>
> Well, what do you mean by "being considered"? We consider it right
> now, by
> discussing it, but to be useful it would indeed have to be
> written... I'm
> afraid I might be missing the real point of this question.
>
> AFB> But maybe 2.8.2 should have a /usr/local Installer, rather than a
> AFB> /Library/Frameworks/wx.framework ? Either way "works", your
> call...
>
> Sorry again but this is unclear to me as well.
>
> In any case, this framework-ization of wx should be done in cvs
> HEAD, at
> least initially, and not for 2.8.2.
Hmm actually I started frameworking HEAD, but got stuck by a bug in
cursors.cpp, so I stepped back to WX_2_8_BRANCH. I'll try HEAD again
tonight...
What I would say as an important point, is that normally a framework
doesn't contain anything else than Headers, a dylib, and some
resources...
The JavaVM.framework is built this way because Java ought to be
portable without recompilation.
From my limited knowledge, it would seem to me that an application
built on a non-MacOS X system using wx would need to be recompiled
anyway to work on OS X (since it would require linking against wxMac
instead of wxGTK)... Is this right ?
So it would be better if codebases wanting to build on OSX just
launch Xcode, create a project using the wx Template, add their
codebase and click build, and voila, they have a native codebase.app
bundle containing wx (or requiring installation of wx), ready to
install...
A little thought, I really need 4 version of this framework, for
Unicode/ANSI, Debug/Release, or is MacOS X Unicode support sufficient
for wx ?
tiennou
More information about the wx-dev
mailing list