This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Framework support for darwin



On Monday, August 11, 2003, at 11:08 PM, Geoff Keating wrote:


Ah, but we don't want the file entered into the hash table. Since the
lookup is context dependent, an entry in a hash table would defeat the
next context dependent lookup, making it context independent, which, is
wrong.

Yuk! This is nasty. Including the same thing and getting something different is ... counterintuitive.

I agree. We don't need or want that functionality.

I think, Mike is talking about sub-frameworks here. In that case requirement
is unavoidable. However implementation is a different issue. I'll try to
summarize requirements for framework support.


Mac OS X uses frameworks to package related dynamic library, headers,
precomps (and symbol repositories?) together. Mac OS X GCC and cctools (as,
ld, libtool etc..) support this mechanism.


Directory layout:

Frameworks use very specific directory layout. Tools rely on this fixed
directory layout.
(1) Framework is enclosed in a directory whose name always ends with ".framework".
For example, Carbon.framework
(2) In .framework directory headers are always stored in "Headers" or
"PrivateHeaders" sudirectories.
(3) If framework encloses other sub-frameworks than it is an umbrella framework.
All sub-frameworks also uses standard framework directory layout (as per (1)
and (2)) and they are located in "Frameworks" directory inside umbrella
.framework directory.
(4) Sub-frameworks are not visible outside their parent framework.


For example,

/somewhere/A.framework/Headers/A.h
/somewhere/A.framework/Headers/A1.h
/somewhere/A.framework/PrivateHeaders/A_fun1.h
/somewhere/A.framework/PrivateHeaders/A_fun2.h
/somewhere/A.framework/PrivateHeaders/A_fun3.h
/somewhere/A.framework/Frameworks/B.framework/Headers/B.h
/somewhere/A.framework/Frameworks/B.framework/PrivateHeaders/B_priv.h
/somewhere/A.framework/Frameworks/C.framework/Headers/C.h
/somewhere/A.framework/Frameworks/C.framework/PrivateHeaders/C_priv.h

In this example, A is an Umbrella Framework. Sub-frameworks, e.g. B and C, are not
visible outside parent framework A (when user supplies -F /somewhere). Which means
A.h can include headers from B and C frameworks. Users can only include headers from
framework A in their source. They can not directly include B.h in their source.


Command Line options:

(1) -F <path>

GCC uses <path> to find main framework directory. -F is like -I. GCC supplies user
provided -F to link editor also. "/System/Library/Framework" is default framework
search path.


(2) -framework <name>

GCC driver passes this -framework and its option to link editor. Link editor uses
it to find library hidden inside .framework directory structure.


(3) -iframework
Equivalent of -iprefix.

-
Devang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]