]>
Commit | Line | Data |
---|---|---|
bd5b749c A |
1 | #/bin/sh |
2 | ||
3 | echo "Setup ..." | |
4 | ||
5 | ALL_CFILES=`ls *.c` | |
6 | ALL_HFILES=`ls *.h` | |
7 | ||
8 | MACHINE_TYPE=`uname -p` | |
9 | UNICODE_DATA_FILE="UNKNOWN" | |
10 | ||
11 | if [ "$MACHINE_TYPE" == "i386" ]; then | |
12 | UNICODE_DATA_FILE="CFUnicodeData-L.mapping" | |
13 | fi | |
14 | ||
15 | if [ "$MACHINE_TYPE" == "powerpc" ]; then | |
16 | UNICODE_DATA_FILE="CFUnicodeData-B.mapping" | |
17 | fi | |
18 | ||
19 | ||
20 | ||
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" | |
23 | ||
24 | OBJBASE=../CF-Objects | |
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" | |
28 | ||
29 | /bin/rm -rf $OBJBASE | |
30 | /bin/mkdir -p $OBJBASE | |
31 | /bin/mkdir $OBJBASE/normal | |
32 | /bin/mkdir $OBJBASE/CoreFoundation | |
33 | /bin/cp $ALL_HFILES $OBJBASE/CoreFoundation | |
34 | if [ $? -ne 0 ]; then | |
35 | echo "Setup failed" | |
36 | exit 1 | |
37 | fi | |
38 | ||
39 | Build () { | |
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 | |
44 | if [ $? -ne 0 ]; then | |
45 | echo "*** Compiling $STYLE failed ***" | |
46 | exit 1 | |
47 | fi | |
48 | done | |
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 | |
52 | if [ $? -ne 0 ]; then | |
53 | echo "*** Linking $STYLE failed ***" | |
54 | exit 1 | |
55 | fi | |
56 | } | |
57 | ||
58 | STYLE=normal | |
59 | STYLE_CFLAGS="-O2" | |
60 | STYLE_LFLAGS= | |
61 | Build | |
62 | ||
63 | echo "Building done." | |
64 | ||
65 | echo "Installing ..." | |
66 | if [ -z "$DSTBASE" ]; then DSTBASE=../CF-Root ; fi | |
67 | ||
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 | |
85 | ||
f32021b4 | 86 | install_name_tool -id /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation |
bd5b749c A |
87 | |
88 | echo "Installing done. The framework is in $DSTBASE" | |
89 | ||
90 | exit 0 | |
91 |