9 MACHINE_TYPE=`uname -p`
10 UNICODE_DATA_FILE="UNKNOWN"
12 if [ "$MACHINE_TYPE" == "i386" ]; then
13 UNICODE_DATA_FILE="CFUnicodeData-L.mapping"
16 if [ "$MACHINE_TYPE" == "i686" ]; then
17 UNICODE_DATA_FILE="CFUnicodeData-L.mapping"
20 if [ "$MACHINE_TYPE" == "powerpc" ]; then
21 UNICODE_DATA_FILE="CFUnicodeData-B.mapping"
24 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"
25 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"
28 ARCHFLAGS="-arch i386 -arch x86_64"
29 CFLAGS="-c -x objective-c -pipe -std=gnu99 -g -Wmost -Wno-trigraphs -mmacosx-version-min=10.6 -fconstant-cfstrings -fexceptions -DCF_BUILDING_CF=1 -DDEPLOYMENT_TARGET_MACOSX=1 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_6 -DU_SHOW_DRAFT_API=1 -I$OBJBASE -DVERSION=550.13 -include CoreFoundation_Prefix.h"
30 LFLAGS="-dynamiclib -mmacosx-version-min=10.6 -twolevel_namespace -init ___CFInitialize -compatibility_version 150 -current_version 550.13 -sectcreate __UNICODE __csbitmaps CFCharacterSetBitmaps.bitmap -Wl,-alias_list,SymbolAliases -sectcreate __UNICODE __properties CFUniCharPropertyDatabase.data -sectcreate __UNICODE __data $UNICODE_DATA_FILE -segprot __UNICODE r r"
33 /bin/mkdir -p $OBJBASE
34 /bin/mkdir $OBJBASE/normal
35 /bin/mkdir $OBJBASE/CoreFoundation
36 /bin/cp $ALL_HFILES $OBJBASE/CoreFoundation
43 echo "Compiling $STYLE ..."
44 for F in $ALL_CFILES ; do
45 echo /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .c`.o
46 /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .c`.o
48 echo "*** Compiling $STYLE failed ***"
52 for F in $ALL_MFILES ; do
53 echo /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .m`.o
54 /usr/bin/gcc $STYLE_CFLAGS $ARCHFLAGS $CFLAGS $F -o $OBJBASE/$STYLE/`basename $F .m`.o
56 echo "*** Compiling $STYLE failed ***"
60 echo "Linking $STYLE ..."
61 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
62 /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
64 echo "*** Linking $STYLE failed ***"
77 if [ -z "$DSTBASE" ]; then DSTBASE=../CF-Root ; fi
79 /bin/rm -rf $DSTBASE/CoreFoundation.framework
80 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Resources
81 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Headers
82 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/PrivateHeaders
83 /bin/ln -sf A $DSTBASE/CoreFoundation.framework/Versions/Current
84 /bin/ln -sf Versions/Current/Resources $DSTBASE/CoreFoundation.framework/Resources
85 /bin/ln -sf Versions/Current/Headers $DSTBASE/CoreFoundation.framework/Headers
86 /bin/ln -sf Versions/Current/PrivateHeaders $DSTBASE/CoreFoundation.framework/PrivateHeaders
87 /bin/ln -sf Versions/Current/CoreFoundation $DSTBASE/CoreFoundation.framework/CoreFoundation
88 /bin/cp Info.plist $DSTBASE/CoreFoundation.framework/Versions/A/Resources
89 /bin/mkdir -p $DSTBASE/CoreFoundation.framework/Versions/A/Resources/en.lproj
90 /bin/cp $PUBLIC_HEADERS $DSTBASE/CoreFoundation.framework/Versions/A/Headers
91 /bin/cp $PRIVATE_HEADERS $DSTBASE/CoreFoundation.framework/Versions/A/PrivateHeaders
92 /usr/bin/strip -S -o $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation $OBJBASE/CoreFoundation_normal
93 /usr/sbin/chown -RH -f root:wheel $DSTBASE/CoreFoundation.framework
94 /bin/chmod -RH a-w,a+rX $DSTBASE/CoreFoundation.framework
95 /bin/chmod -RH u+w $DSTBASE
97 install_name_tool -id /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation
99 echo "Installing done. The framework is in $DSTBASE"