-
Notifications
You must be signed in to change notification settings - Fork 65
/
CogFamilyCocoaIOSConfig.class.st
362 lines (312 loc) · 10.1 KB
/
CogFamilyCocoaIOSConfig.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
"
This is an abstract class for all Mac Cocoa Cog VMs family. That is, for all CogVMS (StackVM, CogVM, CogMTVM, etc).
Fore more information, check the class comments of all the superclasses.
"
Class {
#name : #CogFamilyCocoaIOSConfig,
#superclass : #CocoaIOSConfig,
#category : #'CMakeVMMaker-IOS'
}
{ #category : #'bundle strings' }
CogFamilyCocoaIOSConfig >> CFBundleIconFile [
"An application icon"
^ 'Cog.icns'
]
{ #category : #'bundle strings' }
CogFamilyCocoaIOSConfig >> CFBundleVersion [
"An application version"
^ '6.0-pre'
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> commonCompilerFlags [
^super commonCompilerFlags, #(
"CLANG >>"
'-fwrapv' "Non optimization of stackoverflow (to allow number conversions)"
'-Wno-return-type' "to avoid clang to complain about plugins that do not return properly."
'-Qunused-arguments'
"CLANG <<"
'-funroll-loops'
'-fasm-blocks'
'-fno-inline-functions'
'-mfpmath=sse'
'-march=pentium-m'
'-mtune=prescott'
'-falign-functions=16'
'-fno-gcse'
'-std=gnu99'
'-fmessage-length=0'
'-fpascal-strings'
'-DBUILD_FOR_OSX'
"'-DUSE_INLINE_MEMORY_ACCESSORS=1' "
'-DLSB_FIRST'
'-DHAVE_SYS_TIME_H'
'-DHAVE_NANOSLEEP'
'-DCOGMTVM=0'
'-DUSE_GLOBAL_STRUCT=0'
'-DBASE_HEADER_SIZE=4'
'-DENABLE_FAST_BLT')
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> compilerFlagsDebug [
^#('-g3' '-O0' '-DDEBUGVM=1')
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> compilerFlagsRelease [
^#('-g0' '-O3' '-fomit-frame-pointer' '-DNDEBUG' '-DDEBUGVM=0')
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureFFIPlugin: maker [
"extra rules for FFIPlugin"
"Never generate this plugin. Because it is a legacy code.
For Cog FFI, use ReentrantFFIPlugin (ReentrantIA32FFIPlugin for x86) "
maker doNotGenerate: true.
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureHostWindowPlugin: maker [
super configureHostWindowPlugin: maker.
maker includeDirectories: '${platformsDir}/Cross/plugins/HostWindowPlugin'.
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureQuicktimePlugin: maker [
"extra rules for QuicktimePlugin"
maker includeDirectories: '${platformsDir}/Cross/plugins/QuicktimePlugin'.
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureSqueakSSLPlugin: maker [
maker addPlatformSources: #('sqMacSSL.c').
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureSystemInfoPlugin: maker [
maker includeDirectories: '${platformsDir}/Cross/plugins/SystemInfoPlugin'.
maker addPlatformSources: #('sqSystemInfo.m' ).
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureUnixAioPlugin: maker [
maker includeDirectories: '${crossDir}/plugins/FilePlugin'.
maker includeDirectories: '${platformsDir}/Cross/plugins/SocketPlugin'.
]
{ #category : #'plugin extra rules' }
CogFamilyCocoaIOSConfig >> configureUnixOSProcessPlugin: maker [
super configureHostWindowPlugin: maker.
maker includeDirectories: '${platformsDir}/Cross/plugins/SocketPlugin'.
]
{ #category : #'source files' }
CogFamilyCocoaIOSConfig >> crossSources [
^super crossSources, #(
'sqExternalSemaphores.c'
'sqHeapMap.c'
'sqTicker.c')
]
{ #category : #plugins }
CogFamilyCocoaIOSConfig >> defaultExternalPlugins [
^(self versionExternalPlugins),
#(
UUIDPlugin
FloatMathPlugin
AsynchFilePlugin
Mpeg3Plugin
CroquetPlugin
JoystickTabletPlugin
B3DAcceleratorPlugin
JPEGReadWriter2Plugin
JPEGReaderPlugin
RePlugin
LocalePlugin
ObjectiveCPlugin
QuicktimePlugin
TestOSAPlugin
SqueakSSLPlugin
SerialPlugin
MIDIPlugin
)
]
{ #category : #plugins }
CogFamilyCocoaIOSConfig >> defaultInternalPlugins [
^ #(
ADPCMCodecPlugin
BMPReadWriterPlugin
BalloonEnginePlugin
BitBltSimulation
ClipboardExtendedPlugin
DSAPlugin
DeflatePlugin
DropPlugin
FFTPlugin
FilePlugin
FloatArrayPlugin
GeniePlugin
HostWindowPlugin
"JPEGReadWriter2Plugin
JPEGReaderPlugin"
KlattSynthesizerPlugin
LargeIntegersPlugin
Matrix2x3Plugin
MiscPrimitivePlugin
"RePlugin"
SecurityPlugin
SocketPlugin
SoundCodecPlugin
SoundGenerationPlugin
SoundPlugin
StarSqueakPlugin
SurfacePlugin
UnixAioPlugin
UnixOSProcessPlugin
)
]
{ #category : #'source files' }
CogFamilyCocoaIOSConfig >> extraSources [
" mac VM using some unix sources "
^super extraSources,'
${platformsDir}/unix/vm/aio.c
${platformsDir}/unix/vm/sqUnixHeartbeat.c
${platformsDir}/unix/vm/sqUnixVMProfile.c
${platformsDir}/unix/vm/sqUnixThreads.c '
]
{ #category : #'source files' }
CogFamilyCocoaIOSConfig >> platformSources [
"files added from platform/iOS/vm dir "
^ #(
'Common/main.m'
"'Common/aio.c'"
'Common/Classes/Queue.m'
'Common/Classes/sqMacV2Time.c'
'Common/Classes/sqSqueakAppDelegate.m'
'Common/Classes/sqSqueakFileDirectoryAPI.m'
'Common/Classes/sqSqueakFileDirectoryInterface.m'
'Common/Classes/sqSqueakInfoPlistInterface.m'
'Common/Classes/sqSqueakMainApp.m'
'Common/Classes/sqSqueakMainApplication.m'
'Common/Classes/sqSqueakMainApplication+attributes.m'
'Common/Classes/sqSqueakAttributesAPI.m'
'Common/Classes/sqSqueakMainApplication+events.m'
'Common/Classes/sqSqueakEventsAPI.m'
'Common/Classes/sqSqueakMainApplication+imageReadWrite.m'
'Common/Classes/sqSqueakMainApplication+sound.m'
'Common/Classes/sqSqueakSoundAPI.m'
'Common/Classes/sqSqueakMainApplication+vmAndImagePath.m'
'Common/Classes/sqSqueakVmAndImagePathAPI.m'
'Common/Classes/sqSqueakMainApplication+screen.m'
'Common/Classes/sqSqueakScreenAPI.m'
'Common/Classes/sqSqueakScreenAndWindow.m'
'Common/Classes/sqSqueakCursorAPI.m'
'Common/Classes/sqSqueakMainApplication+cursor.m'
'OSX/SqueakOSXAppDelegate.m'
'OSX/sqMacV2Browser.m'
'OSX/sqMacUnixExternalPrims.m'
'OSX/sqSqueakOSXApplication.m'
'OSX/sqSqueakOSXFileDirectoryInterface.m'
'OSX/sqSqueakOSXApplication+attributes.m'
'OSX/sqSqueakOSXInfoPlistInterface.m'
'OSX/sqSqueakOSXApplication+imageReadWrite.m'
'OSX/sqSqueakOSXScreenAndWindow.m'
'OSX/sqSqueakOSXCGView.m'
'OSX/sqSqueakOSXOpenGLView.m'
'OSX/SqViewClut.m'
'OSX/BitMapConversionLogicFromX11.c'
'OSX/SqViewBitmapConversion.m'
'OSX/macintoshosxextra.c'
'OSX/sqSqueakOSXApplication+cursor.m'
'OSX/sqSqueakOSXApplication+events.m'
'OSX/keyBoardStrokeDetails.m'
'OSX/SqueakOSXApplication.m'
'OSX/sqSqueakOSXClipboardAPI.m'
'OSX/sqSqueakOSXApplication+clipboard.m'
'OSX/sqSqueakOSXDropAPI.m'
'iPhone/sqMacV2Memory.c'
'iPhone/osExports.c'
'Common/Classes/sqSqueakScreenAPI.m')
]
{ #category : #accessing }
CogFamilyCocoaIOSConfig >> sdkVersion [
^'10.6'
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> setExtraTargetProperties: maker [
| plist |
maker addFrameworks: self frameworks.
" generated and add Info.plist file "
plist := self plistFile.
(FileStream forceNewFileNamed: (maker buildDir / 'Info.plist') fullName)
nextPutAll: plist;
close.
maker
addProperty: 'MACOSX_BUNDLE_INFO_PLIST'
value: '${buildDir}/Info.plist'.
(FileStream forceNewFileNamed: (maker buildDir / self prefixHeaderFileName) fullName )
nextPutAll: self precompiledHeaders;
close.
maker addXCodeProperty: 'GCC_PREFIX_HEADER' value: '${buildDir}/', self prefixHeaderFileName.
maker
addXCodeProperty: 'PER_ARCH_CFLAGS_i386' value: '-DLSB_FIRST -mfpmath=sse -finline-functions -fno-gcse -mtune=prescott -march=pentium-m -falign-functions=16'.
"maker
addXCodeProperty: 'GCC_VERSION' value: '4.3'."
maker
cmd: 'set_target_properties'
params: self executableName, ' PROPERTIES COMPILE_FLAGS "-include \"', (self buildDir / self prefixHeaderFileName) fullName, '\""'.
" maker set: 'CMAKE_C_COMPILER' to: '/usr/bin/gcc-4.2'.
maker set: 'CMAKE_CXX_COMPILER' to: '/usr/bin/g++-4.2'.
"
maker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.
maker set: 'RUNTIME_OUTPUT_DIRECTORY' toString: self outputDir fullName.
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> setGlobalOptions: maker [
"set any CMake global options, before declaring a project in cmake file"
maker set: 'CMAKE_C_COMPILER' to: '/usr/bin/gcc'.
maker set: 'CMAKE_CXX_COMPILER' to: '/usr/bin/g++'.
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> setGlobalOptionsAfterDetermineSystem: maker [
maker set: 'CMAKE_OSX_DEPLOYMENT_TARGET' to: '10.5'.
maker
set: 'CMAKE_OSX_SYSROOT'
to: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX', self sdkVersion, '.sdk'
]
{ #category : #settings }
CogFamilyCocoaIOSConfig >> setResourceProperties: maker [
maker set: 'resourceDir' toString: self resourcesDir, '/ProjectBuilder'.
maker
set: 'resources'
to: (String streamContents: [ :stream |
self resources
do: [ :each |
stream
nextPut: $";
nextPutAll: '${resourceDir}/';
nextPutAll: each;
nextPut: $"]
separatedBy: [ stream space ] ]).
maker
set: 'resourcesLocaleEnglish'
to: '"${resourceDir}/English.lproj/InfoPlist.strings" "${resourceDir}/English.lproj/MainMenu.nib"'.
maker
cmd: 'set_source_files_properties'
params: '${resources} PROPERTIES MACOSX_PACKAGE_LOCATION Resources'.
maker
cmd: 'set_source_files_properties'
params: '${resourcesLocaleEnglish} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/English.lproj'.
]
{ #category : #'source files' }
CogFamilyCocoaIOSConfig >> standardIncludes [
^#(
'${srcDir}/vm'
'${platformsDir}/iOS/vm/OSX'
'${platformsDir}/unix/vm'
'${platformsDir}/iOS/vm/Common/Classes'
'${platformsDir}/iOS/plugins/SoundPlugin'
'${platformsDir}/iOS/vm/OSX/plugins/SoundPlugin'
'${crossDir}/plugins/SoundPlugin'
'${crossDir}/plugins/HostWindowPlugin'
'${platformsDir}/Cross/plugins/HostWindowPlugin'
'${platformsDir}/iOS/vm/iPhone/plugins/HostWindowPlugin' "Sources are here :("
'${crossDir}/plugins/FilePlugin'
)
]
{ #category : #plugins }
CogFamilyCocoaIOSConfig >> versionExternalPlugins [
"Cog Version Specific Plugins. Some times you can't use same plugins in a version (for instance, CogMT uses a diferent FFI, and you can't build IA32ABIPlugin in MT for now)"
^Array
with: #FFIPlugin
with: #IA32ABIPlugin
]