[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mac os x framework linking target

From: Daniel Rogers
Subject: mac os x framework linking target
Date: Fri, 28 Jul 2006 13:48:07 -0700


I'm interested in developing a "framework" building feature for libtool.
Linking the shared library for a framework is exactly the same as
linking a typical shared library.  It's already quite close.  The
differences are described below, but they are summed up as, I need to be
able to create a shared library artifact that doesn't start with lib,
and the shared library needs to be placed into a particular folder
hierarchy, so those parameters would probably have to be passed to
libtool as well (in particular $(FRAMEWORK_VERSION) can't be guessed,
and probably the source of Info.plist would also need to be passed).

Futhermore, I really don't understand all the use cases of libtool, and
how/where those use cases would have to be modified to understand
frameworks.  In particular, I don't understand quite the best place or
way to go about creating a .la file for the framework (it might be best
to put it in the Resources directory, since that is what that directory
is for, but how to I fix libtool to look in the right place).  What all
does a la file need to specify?

So, to be specific, I find a bit intimidating, as I am not
very good with sh, and I don't immediately see where I can insert the
appropriate changes.  Is there an overview of somewhere?

The differences between a normal shared library and a framework are
listed below:
The runtime path is
$(FRAMEWORK_DIRECTORY) is typically /Library/Frameworks
$(FRAMEWORK_VERSION) is arbitrary, but typically A, B, C, (apple's
convention) etc.
$(FRAMEWORK_NAME) is the framework name, and what is passed to gcc as
-framework $(FRAMEWORK_NAME) to link against the framework. 
The final object needs to be put into a particular folder hierarchy
before it can be linked to other libraries.
A framework is a file hierarchy that looks like this:

-->symbolic link $(FRAMEWORK_NAME) to Versions/Current/$(FRAMEWORK_NAME)
-->symbolic link Resources/ to Versions/Current/Resources
-->directory Versions/
   -->symbolic link Current to latest installed version directory
   -->versioned library directories (arbitrary, but typically A, B, C,
etc).  Each directory contains the version of the linked shared object
file called $(FRAMEWORK_NAME) and a "Resources" directory that contains
a single xml file called Info.plist which contains the version number
and vender, and any other files the library might need (like
translations, etc).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]