]> git.saurik.com Git - apple/cf.git/blame - BuildCFLite
CF-550.tar.gz
[apple/cf.git] / BuildCFLite
CommitLineData
bd5b749c
A
1#/bin/sh
2
3echo "Setup ..."
4
5ALL_CFILES=`ls *.c`
6ALL_HFILES=`ls *.h`
cf7d2af9 7ALL_MFILES=`ls *.m`
bd5b749c
A
8
9MACHINE_TYPE=`uname -p`
10UNICODE_DATA_FILE="UNKNOWN"
11
12if [ "$MACHINE_TYPE" == "i386" ]; then
cf7d2af9 13 UNICODE_DATA_FILE="CFUnicodeData-L.mapping"
bd5b749c
A
14fi
15
cf7d2af9
A
16if [ "$MACHINE_TYPE" == "i686" ]; then
17 UNICODE_DATA_FILE="CFUnicodeData-L.mapping"
bd5b749c
A
18fi
19
cf7d2af9
A
20if [ "$MACHINE_TYPE" == "powerpc" ]; then
21 UNICODE_DATA_FILE="CFUnicodeData-B.mapping"
22fi
bd5b749c
A
23
24PUBLIC_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"
25PRIVATE_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"
26
cf7d2af9
A
27OBJBASE=./CF-Objects
28ARCHFLAGS="-arch i386 -arch x86_64"
29CFLAGS="-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=535 -include CoreFoundation_Prefix.h"
30LFLAGS="-dynamiclib -mmacosx-version-min=10.6 -twolevel_namespace -init ___CFInitialize -compatibility_version 150 -current_version 535 -sectcreate __UNICODE __csbitmaps CFCharacterSetBitmaps.bitmap -Wl,-alias_list,SymbolAliases -sectcreate __UNICODE __properties CFUniCharPropertyDatabase.data -sectcreate __UNICODE __data $UNICODE_DATA_FILE -segprot __UNICODE r r"
bd5b749c
A
31
32/bin/rm -rf $OBJBASE
33/bin/mkdir -p $OBJBASE
34/bin/mkdir $OBJBASE/normal
35/bin/mkdir $OBJBASE/CoreFoundation
36/bin/cp $ALL_HFILES $OBJBASE/CoreFoundation
37if [ $? -ne 0 ]; then
38 echo "Setup failed"
39 exit 1
40fi
41
42Build () {
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
47 if [ $? -ne 0 ]; then
48 echo "*** Compiling $STYLE failed ***"
49 exit 1
50 fi
51 done
cf7d2af9
A
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
55 if [ $? -ne 0 ]; then
56 echo "*** Compiling $STYLE failed ***"
57 exit 1
58 fi
59 done
bd5b749c
A
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
63 if [ $? -ne 0 ]; then
64 echo "*** Linking $STYLE failed ***"
65 exit 1
66 fi
67}
68
69STYLE=normal
70STYLE_CFLAGS="-O2"
71STYLE_LFLAGS=
72Build
73
74echo "Building done."
75
76echo "Installing ..."
77if [ -z "$DSTBASE" ]; then DSTBASE=../CF-Root ; fi
78
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
96
f32021b4 97install_name_tool -id /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation $DSTBASE/CoreFoundation.framework/Versions/A/CoreFoundation
bd5b749c
A
98
99echo "Installing done. The framework is in $DSTBASE"
100
101exit 0
102