|
| 1 | +script = Script() |
| 2 | + |
| 3 | +cf = StaticLibrary("CoreFoundation") |
| 4 | + |
| 5 | +cf.GCC_PREFIX_HEADER = 'Base.subproj/CoreFoundation_Prefix.h' |
| 6 | + |
| 7 | +if Configuration.current.target.sdk == OSType.Linux: |
| 8 | + cf.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE ' |
| 9 | + Configuration.current.requires_pkg_config = True |
| 10 | +elif Configuration.current.target.sdk == OSType.FreeBSD: |
| 11 | + cf.CFLAGS = '-DDEPLOYMENT_TARGET_FREEBSD -I/usr/local/include -I/usr/local/include/libxml2 ' |
| 12 | +elif Configuration.current.target.sdk == OSType.MacOSX: |
| 13 | + cf.CFLAGS = '-DDEPLOYMENT_TARGET_MACOSX ' |
| 14 | + |
| 15 | +cf.ASFLAGS = " ".join([ |
| 16 | + '-DCF_CHARACTERSET_BITMAP=\\"CharacterSets/CFCharacterSetBitmaps.bitmap\\"',' |
| 17 | + '-DCF_CHARACTERSET_UNICHAR_DB=\\"CharacterSets/CFUniCharPropertyDatabase.data\\"',' |
| 18 | + '-DCF_CHARACTERSET_UNICODE_DATA_B=\\"CharacterSets/CFUnicodeData-B.mapping\\"',' |
| 19 | + '-DCF_CHARACTERSET_UNICODE_DATA_L=\\"CharacterSets/CFUnicodeData-L.mapping\\"',' |
| 20 | +]) |
| 21 | + |
| 22 | +cf.ROOT_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift" |
| 23 | +cf.PUBLIC_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation" |
| 24 | +cf.PRIVATE_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation" |
| 25 | +cf.PROJECT_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation" |
| 26 | +cf.PUBLIC_MODULE_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation" |
| 27 | + |
| 28 | +cf.CFLAGS += " ".join([ |
| 29 | + '-DU_SHOW_DRAFT_API', |
| 30 | + '-DCF_BUILDING_CF', |
| 31 | + '-DDEPLOYMENT_RUNTIME_SWIFT', |
| 32 | + '-fconstant-cfstrings', |
| 33 | + '-fexceptions', |
| 34 | + '-Wno-shorten-64-to-32', |
| 35 | + '-Wno-deprecated-declarations', |
| 36 | + '-Wno-unreachable-code', |
| 37 | + '-Wno-conditional-uninitialized', |
| 38 | + '-Wno-unused-variable', |
| 39 | + '-Wno-int-conversion', |
| 40 | + '-Wno-unused-function', |
| 41 | + '-I${SYSROOT}/usr/include/libxml2', |
| 42 | + '-I./', |
| 43 | +]) |
| 44 | + |
| 45 | +headers = CopyHeaders( |
| 46 | +module = 'Base.subproj/module.modulemap', |
| 47 | +public = [ |
| 48 | + 'Stream.subproj/CFStream.h', |
| 49 | + 'String.subproj/CFStringEncodingExt.h', |
| 50 | + 'Base.subproj/SwiftRuntime/CoreFoundation.h', |
| 51 | + 'Base.subproj/SwiftRuntime/TargetConditionals.h', |
| 52 | + 'RunLoop.subproj/CFMessagePort.h', |
| 53 | + 'Collections.subproj/CFBinaryHeap.h', |
| 54 | + 'PlugIn.subproj/CFBundle.h', |
| 55 | + 'Locale.subproj/CFCalendar.h', |
| 56 | + 'Collections.subproj/CFBitVector.h', |
| 57 | + 'Base.subproj/CFAvailability.h', |
| 58 | + 'Collections.subproj/CFTree.h', |
| 59 | + 'NumberDate.subproj/CFTimeZone.h', |
| 60 | + 'Error.subproj/CFError.h', |
| 61 | + 'Collections.subproj/CFBag.h', |
| 62 | + 'PlugIn.subproj/CFPlugIn.h', |
| 63 | + 'Parsing.subproj/CFXMLParser.h', |
| 64 | + 'String.subproj/CFString.h', |
| 65 | + 'Collections.subproj/CFSet.h', |
| 66 | + 'Base.subproj/CFUUID.h', |
| 67 | + 'NumberDate.subproj/CFDate.h', |
| 68 | + 'Collections.subproj/CFDictionary.h', |
| 69 | + 'Base.subproj/CFByteOrder.h', |
| 70 | + 'AppServices.subproj/CFUserNotification.h', |
| 71 | + 'Base.subproj/CFBase.h', |
| 72 | + 'Preferences.subproj/CFPreferences.h', |
| 73 | + 'Locale.subproj/CFLocale.h', |
| 74 | + 'RunLoop.subproj/CFSocket.h', |
| 75 | + 'Parsing.subproj/CFPropertyList.h', |
| 76 | + 'Collections.subproj/CFArray.h', |
| 77 | + 'RunLoop.subproj/CFRunLoop.h', |
| 78 | + 'URL.subproj/CFURLAccess.h', |
| 79 | + 'Locale.subproj/CFDateFormatter.h', |
| 80 | + 'RunLoop.subproj/CFMachPort.h', |
| 81 | + 'PlugIn.subproj/CFPlugInCOM.h', |
| 82 | + 'Base.subproj/CFUtilities.h', |
| 83 | + 'Parsing.subproj/CFXMLNode.h', |
| 84 | + 'URL.subproj/CFURLComponents.h', |
| 85 | + 'URL.subproj/CFURL.h', |
| 86 | + 'Locale.subproj/CFNumberFormatter.h', |
| 87 | + 'String.subproj/CFCharacterSet.h', |
| 88 | + 'NumberDate.subproj/CFNumber.h', |
| 89 | + 'Collections.subproj/CFData.h', |
| 90 | + 'String.subproj/CFAttributedString.h', |
| 91 | +], |
| 92 | +private = [ |
| 93 | + 'Base.subproj/ForSwiftFoundationOnly.h', |
| 94 | + 'Base.subproj/ForFoundationOnly.h', |
| 95 | + 'String.subproj/CFBurstTrie.h', |
| 96 | + 'Error.subproj/CFError_Private.h', |
| 97 | + 'URL.subproj/CFURLPriv.h', |
| 98 | + 'Base.subproj/CFLogUtilities.h', |
| 99 | + 'PlugIn.subproj/CFBundlePriv.h', |
| 100 | + 'StringEncodings.subproj/CFStringEncodingConverter.h', |
| 101 | + 'Stream.subproj/CFStreamAbstract.h', |
| 102 | + 'Base.subproj/CFInternal.h', |
| 103 | + 'Parsing.subproj/CFXMLInputStream.h', |
| 104 | + 'Parsing.subproj/CFXMLInterface.h', |
| 105 | + 'PlugIn.subproj/CFPlugIn_Factory.h', |
| 106 | + 'String.subproj/CFStringLocalizedFormattingInternal.h', |
| 107 | + 'PlugIn.subproj/CFBundle_Internal.h', |
| 108 | + 'StringEncodings.subproj/CFStringEncodingConverterPriv.h', |
| 109 | + 'Collections.subproj/CFBasicHash.h', |
| 110 | + 'StringEncodings.subproj/CFStringEncodingDatabase.h', |
| 111 | + 'StringEncodings.subproj/CFUnicodeDecomposition.h', |
| 112 | + 'Stream.subproj/CFStreamInternal.h', |
| 113 | + 'PlugIn.subproj/CFBundle_BinaryTypes.h', |
| 114 | + 'Locale.subproj/CFICULogging.h', |
| 115 | + 'Locale.subproj/CFLocaleInternal.h', |
| 116 | + 'StringEncodings.subproj/CFUnicodePrecomposition.h', |
| 117 | + 'Base.subproj/CFPriv.h', |
| 118 | + 'StringEncodings.subproj/CFUniCharPriv.h', |
| 119 | + 'URL.subproj/CFURL.inc.h', |
| 120 | + 'NumberDate.subproj/CFBigNumber.h', |
| 121 | + 'StringEncodings.subproj/CFUniChar.h', |
| 122 | + 'StringEncodings.subproj/CFStringEncodingConverterExt.h', |
| 123 | + 'Collections.subproj/CFStorage.h', |
| 124 | + 'Base.subproj/CFRuntime.h', |
| 125 | + 'String.subproj/CFStringDefaultEncoding.h', |
| 126 | + 'String.subproj/CFCharacterSetPriv.h', |
| 127 | + 'Stream.subproj/CFStreamPriv.h', |
| 128 | + 'StringEncodings.subproj/CFICUConverters.h', |
| 129 | + 'String.subproj/CFRegularExpression.h', |
| 130 | + 'String.subproj/CFRunArray.h', |
| 131 | +], |
| 132 | +project = [ |
| 133 | +]) |
| 134 | + |
| 135 | +cf.add_phase(headers) |
| 136 | + |
| 137 | +sources = CompileSources([ |
| 138 | + 'Base.subproj/CFBase.c', |
| 139 | + 'Base.subproj/CFFileUtilities.c', |
| 140 | + 'Base.subproj/CFPlatform.c', |
| 141 | + 'Base.subproj/CFRuntime.c', |
| 142 | + 'Base.subproj/CFSortFunctions.c', |
| 143 | + 'Base.subproj/CFSystemDirectories.c', |
| 144 | + 'Base.subproj/CFUtilities.c', |
| 145 | + 'Base.subproj/CFUUID.c', |
| 146 | + 'Collections.subproj/CFArray.c', |
| 147 | + 'Collections.subproj/CFBag.c', |
| 148 | + 'Collections.subproj/CFBasicHash.c', |
| 149 | + 'Collections.subproj/CFBinaryHeap.c', |
| 150 | + 'Collections.subproj/CFBitVector.c', |
| 151 | + 'Collections.subproj/CFData.c', |
| 152 | + 'Collections.subproj/CFDictionary.c', |
| 153 | + 'Collections.subproj/CFSet.c', |
| 154 | + 'Collections.subproj/CFStorage.c', |
| 155 | + 'Collections.subproj/CFTree.c', |
| 156 | + 'Error.subproj/CFError.c', |
| 157 | + 'Locale.subproj/CFCalendar.c', |
| 158 | + 'Locale.subproj/CFDateFormatter.c', |
| 159 | + 'Locale.subproj/CFLocale.c', |
| 160 | + 'Locale.subproj/CFLocaleIdentifier.c', |
| 161 | + 'Locale.subproj/CFLocaleKeys.c', |
| 162 | + 'Locale.subproj/CFNumberFormatter.c', |
| 163 | + 'NumberDate.subproj/CFBigNumber.c', |
| 164 | + 'NumberDate.subproj/CFDate.c', |
| 165 | + 'NumberDate.subproj/CFNumber.c', |
| 166 | + 'NumberDate.subproj/CFTimeZone.c', |
| 167 | + 'Parsing.subproj/CFBinaryPList.c', |
| 168 | + 'Parsing.subproj/CFOldStylePList.c', |
| 169 | + 'Parsing.subproj/CFPropertyList.c', |
| 170 | + 'Parsing.subproj/CFXMLInputStream.c', |
| 171 | + 'Parsing.subproj/CFXMLNode.c', |
| 172 | + 'Parsing.subproj/CFXMLParser.c', |
| 173 | + 'Parsing.subproj/CFXMLTree.c', |
| 174 | + 'Parsing.subproj/CFXMLInterface.c', |
| 175 | + 'PlugIn.subproj/CFBundle.c', |
| 176 | + 'PlugIn.subproj/CFBundle_Binary.c', |
| 177 | + 'PlugIn.subproj/CFBundle_Grok.c', |
| 178 | + 'PlugIn.subproj/CFBundle_InfoPlist.c', |
| 179 | + 'PlugIn.subproj/CFBundle_Locale.c', |
| 180 | + 'PlugIn.subproj/CFBundle_Resources.c', |
| 181 | + 'PlugIn.subproj/CFBundle_Strings.c', |
| 182 | + 'PlugIn.subproj/CFPlugIn.c', |
| 183 | + 'PlugIn.subproj/CFPlugIn_Factory.c', |
| 184 | + 'PlugIn.subproj/CFPlugIn_Instance.c', |
| 185 | + 'PlugIn.subproj/CFPlugIn_PlugIn.c', |
| 186 | + 'Preferences.subproj/CFApplicationPreferences.c', |
| 187 | + 'Preferences.subproj/CFPreferences.c', |
| 188 | + 'RunLoop.subproj/CFRunLoop.c', |
| 189 | + 'RunLoop.subproj/CFSocket.c', |
| 190 | + 'Stream.subproj/CFConcreteStreams.c', |
| 191 | + 'Stream.subproj/CFSocketStream.c', |
| 192 | + 'Stream.subproj/CFStream.c', |
| 193 | + 'String.subproj/CFBurstTrie.c', |
| 194 | + 'String.subproj/CFCharacterSet.c', |
| 195 | + 'String.subproj/CFString.c', |
| 196 | + 'String.subproj/CFStringEncodings.c', |
| 197 | + 'String.subproj/CFStringScanner.c', |
| 198 | + 'String.subproj/CFStringUtilities.c', |
| 199 | + 'String.subproj/CFStringTransform.c', |
| 200 | + 'StringEncodings.subproj/CFBuiltinConverters.c', |
| 201 | + 'StringEncodings.subproj/CFICUConverters.c', |
| 202 | + 'StringEncodings.subproj/CFPlatformConverters.c', |
| 203 | + 'StringEncodings.subproj/CFStringEncodingConverter.c', |
| 204 | + 'StringEncodings.subproj/CFStringEncodingDatabase.c', |
| 205 | + 'StringEncodings.subproj/CFUniChar.c', |
| 206 | + 'StringEncodings.subproj/CFUnicodeDecomposition.c', |
| 207 | + 'StringEncodings.subproj/CFUnicodePrecomposition.c', |
| 208 | + 'URL.subproj/CFURL.c', |
| 209 | + 'URL.subproj/CFURLAccess.c', |
| 210 | + 'URL.subproj/CFURLComponents.c', |
| 211 | + 'URL.subproj/CFURLComponents_URIParser.c', |
| 212 | + 'String.subproj/CFCharacterSetData.S', |
| 213 | + 'String.subproj/CFUnicodeData.S', |
| 214 | + 'String.subproj/CFUniCharPropertyDatabase.S', |
| 215 | + 'String.subproj/CFRegularExpression.c', |
| 216 | + 'String.subproj/CFAttributedString.c', |
| 217 | + 'String.subproj/CFRunArray.c', |
| 218 | +]) |
| 219 | + |
| 220 | +sources.add_dependency(headers) |
| 221 | +cf.add_phase(sources) |
| 222 | +script.add_product(cf) |
| 223 | +script.generate() |
| 224 | + |
| 225 | + |
0 commit comments