8 MACHINE_TYPE=`uname -p`
9 UNICODE_DATA_FILE="UNKNOWN"
11 if [ "$MACHINE_TYPE" == "i386" ]; then
12 UNICODE_DATA_FILE="CFUnicodeData-L.mapping"
15 if [ "$MACHINE_TYPE" == "powerpc" ]; then
16 UNICODE_DATA_FILE="CFUnicodeData-B.mapping"
21 PUBLIC_HEADERS="CFArray.h CFBag.h CFBase.h CFBinaryHeap.h CFBitVector.h CFBundle.h CFByteOrder.h CFCalendar.h CFCharacterSet.h CFData.h CFDate.h CFDateFormatter.h CFDictionary.h CFError.h CFLocale.h CFMachPort.h CFMessagePort.h CFNumber.h CFNumberFormatter.h CFPlugIn.h CFPlugInCOM.h CFPreferences.h CFPropertyList.h CFRunLoop.h CFSet.h CFSocket.h CFStream.h CFString.h CFStringEncodingExt.h CFTimeZone.h CFTree.h CFURL.h CFURLAccess.h CFUUID.h CFUserNotification.h CFXMLNode.h CFXMLParser.h CoreFoundation.h"
22 PRIVATE_HEADERS="CFBundlePriv.h CFCharacterSetPriv.h CFError_Private.h CFLogUtilities.h CFPriv.h CFRuntime.h CFStorage.h CFStreamAbstract.h CFStreamPriv.h CFStreamInternal.h CFStringDefaultEncoding.h CFStringEncodingConverter.h CFStringEncodingConverterExt.h CFUniChar.h CFUnicodeDecomposition.h CFUnicodePrecomposition.h ForFoundationOnly.h"
25 ARCHFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
26 CFLAGS="-c -pipe -std=gnu99 -g -Wmost -Wno-trigraphs -mmacosx-version-min=10.5 -fconstant-cfstrings -fexceptions -DCF_BUILDING_CF=1 -DDEPLOYMENT_TARGET_MACOSX=1 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_5 -DU_SHOW_DRAFT_API=1 -I$OBJBASE -DVERSION=476.10"
27 LFLAGS="-dynamiclib -mmacosx-version-min=10.5 -twolevel_namespace -init ___CFInitialize -compatibility_version 150 -current_version 476 -sectcreate __UNICODE __csbitmaps CFCharacterSetBitmaps.bitmap -sectcreate __UNICODE __properties CFUniCharPropertyDatabase.data -sectcreate __UNICODE __data $UNICODE_DATA_FILE -segprot __UNICODE r r"
30 /bin/mkdir -p $OBJBASE
31 /bin/mkdir $OBJBASE/normal
32 /bin/mkdir $OBJBASE/CoreFoundation
33 /bin/cp $ALL_HFILES $OBJBASE/CoreFoundation
40 echo "Compiling $STYLE ..."
41 for F in $ALL_CFILES ; do
42 echo /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .c`.o
43 /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .c`.o
45 echo "*** Compiling $STYLE failed ***"
49 echo "Linking $STYLE ..."
50 echo /usr/bin/gcc $STYLE_LFLAGS -install_name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation_$STYLE $ARCHFLAGS $LFLAGS $OBJBASE/$STYLE/*.o -licucore.A -lobjc -o $OBJBASE/CoreFoundation_$STYLE
51 /usr/bin/gcc $STYLE_LFLAGS -install_name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation_$STYLE $ARCHFLAGS $LFLAGS $OBJBASE/$STYLE/*.o -licucore.A -lobjc -o $OBJBASE/CoreFoundation_$STYLE
53 echo "*** Linking $STYLE failed ***"
66 if [ -z "$DSTBASE" ]; then DSTBASE=../CF-Root ; fi
68 /bin/rm -rf $DSTBASE/CoreFoundation.framework
69 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Resources
70 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Headers
71 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/PrivateHeaders
72 /bin/ln -sf A $DSTBASE/CoreFoundation.framework/Versions/Current
73 /bin/ln -sf Versions/Current/Resources $DSTBASE/CoreFoundation.framework/Resources
74 /bin/ln -sf Versions/Current/Headers $DSTBASE/CoreFoundation.framework/Headers
75 /bin/ln -sf Versions/Current/PrivateHeaders $DSTBASE/CoreFoundation.framework/PrivateHeaders
76 /bin/ln -sf Versions/Current/CoreFoundation $DSTBASE/CoreFoundation.framework/CoreFoundation
77 /bin/cp Info.plist $DSTBASE/CoreFoundation.framework/Versions/A/Resources
78 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Resources/en.lproj
79 /bin/cp $PUBLIC_HEADERS $DSTBASE/CoreFoundation.framework/Versions/A/Headers
80 /bin/cp $PRIVATE_HEADERS $DSTBASE/CoreFoundation.framework/Versions/A/PrivateHeaders
81 /usr/bin/strip -S -o $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation $OBJBASE/CoreFoundation_normal
82 /usr/sbin/chown -RH -f root:wheel $DSTBASE/CoreFoundation.framework
83 /bin/chmod -RH a-w,a+rX $DSTBASE/CoreFoundation.framework
84 /bin/chmod -RH u+w $DSTBASE
86 install_name_tool -id /System/Library/Frameworks/CoreFoundation/Versions/A/CoreFoundation $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation
88 echo "Installing done. The framework is in $DSTBASE"