freetype
[Top][All Lists]
Advanced

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

Re: [ft] freetype universal on Mac OS X 10.4 PowerPC


From: Ryan Schmidt
Subject: Re: [ft] freetype universal on Mac OS X 10.4 PowerPC
Date: Fri, 23 May 2008 19:31:31 -0500

On May 17, 2008, at 12:24, address@hidden wrote:

On Sat, 17 May 2008 05:03:33 -0500 Ryan Schmidt wrote:

The problem is that I cannot build a universal binary of freetype
(2.3.5) when running on a Mac OS X 10.4 PowerPC machine. I believe
this is because freetype is trying to link with /usr/lib/
libSystem.B.dylib even when cross-compiling for Intel. This doesn't
work because on a Mac OS X 10.4 PowerPC machine, /usr/lib/
libSystem.B.dylib only contains PowerPC code.

I see. Mainly I use PowerBook G4 and I had experienced that.
The installation of universal binary SDK for Mac OS X 10.4
does not integrate its content with the system libraries.

Well, no SDK integrates its content with the system libraries. All SDKs install their content exclusively into /Developer/SDKs. At issue is the fact Mac OS X 10.4 on Intel and Mac OS X 10.5 on Intel and PowerPC provide universal system libraries, while Mac OS X 10.4 on PowerPC provides only PowerPC system libraries. For this reason, and for the reason that one may want to compile for one major Mac OS X release while running on a different major Mac OS X release, the use of the SDKs should be supported. Actually I thought that software packages like freetype wouldn't need to make any changes in order to support this, that somehow it was handled automatically.


However freetype doesn't seem to be making use of the sysroot in this
case. Can you help me make freetype use the sysroot, or think of
another solution? Thanks.

I will update configure script to support sysroot, but I
want to ask 2 questions to automate it. Please give me
your comment.

1. What is standard/popular method to specify the
   architechtures to be included in the binary?

   You mentioned the method "-isysroot xxx -arch xxx -arch yyy ..."
   is used in MacPorts, I have to update configure script
   to extract the list of architechture from CFLAG option.
   Is there any other popular method to be supported?

That's the only method I'm aware of. It's the one documented by Apple:

http://developer.apple.com/technotes/tn2005/tn2137.html

Well, the method described there is to build for all architectures at once by passing multiple -arch flags.

The other method, not described there, is to configure and make and make install multiple times, to different destroots, each time with one -arch flag, then use the lipo program to combine the separate binaries into universal binaries. The advantage is that you can use a different SDK and even a different compiler for PowerPC and Intel, so that for example you can support 10.3 and up or even 10.2 and up on PowerPC and 10.4 and up on Intel. The disadvantage is that it's more complicated to set up, it takes longer to build, and the resulting binary is larger. Also, this is not a solution to the problem; on Mac OS X 10.4 on PowerPC, this results in the same error:

CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" \
LDFLAGS="-arch i386" \
./configure \
--prefix=/tmp/freetype \
--disable-dependency-tracking

cd builds/unix; ./configure "--prefix=/tmp/freetype" "--disable- dependency-tracking"
checking build system type... powerpc-apple-darwin8.11.0
checking host system type... powerpc-apple-darwin8.11.0
checking target system type... powerpc-apple-darwin8.11.0
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [setup] Error 1


2. Carbon-dependent API should be consistent among the
   architechtures included in the universal binaries?

   libSystem.B.dylib of SDK 10.4u includes all 4
   architectures ppc|ppc64|i386|x86_64, but
   CoreServices & ApplicationServices (frameworks
   required by QuickDraw/ATS-related functions in
   ftmac.c) includes only 2 architectures ppc|i386.

   If a consistency of APIs in universal binary is
   important, ftmac.c should be disabled on all
   architechtures, when the list of architechture
   includes ppc64 or x86_64. The features of
   universal binary is less than the prebuilt library
   libfreetype.6.3.dylib in SDK 10.4u (it includes
   only ppc & i386, no ppc64, no x86_64). I'm afraid
   such incompatibility makes people confused.
   However, I'm not sure if building 64bit binaries
   by SDK 10.4u is popular /or not.

I was under the impression that Apple does not support Carbon on 64- bit Mac OS X, so there would never be any 64-bit Carbon apps. Based on that, it seems reasonable to include the Carbon bits in the 32-bit freetype libraries and by necessity omit them from the 64-bit libraries. This will enable developers to create Carbon apps (which will only be 32-bit) or 4-way universal apps (which won't be Carbon).

I did not read through this guide but maybe it clarifies the situation:

http://developer.apple.com/documentation/Carbon/Conceptual/ Carbon64BitGuide/Introduction/chapter_1_section_1.html






reply via email to

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