Skip to content

Commit 793c2a6

Browse files
Merge 6439590 into ddc6ff0
2 parents ddc6ff0 + 6439590 commit 793c2a6

File tree

2,694 files changed

+3812466
-3807818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,694 files changed

+3812466
-3807818
lines changed

.clang_complete

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-Iplatforms/Cross/vm
22
-Iinclude
3-
-Isrc/vm
3+
-Isrc/vm.32bit.cog.v3
44
-Iplatforms/minheadless/common
55
-Iplatforms/minheadless/generic
66
-Iplatforms/minheadless/unix

.gitignore

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,48 @@
2626
platforms/unix/config/autom4te.cache/
2727

2828
# Don't track build directory contents (with exceptions)
29-
/build*/**/*
29+
/building/**/**/*
3030
# except do track these files
31-
!/build*/common*/*
32-
!/build*/**/Makefile
33-
!/build*/**/NotYetImplemented
34-
!/build*/**/mvm
35-
!/build*/**/plugins.*
36-
!/build*/**/*.gmk
37-
!/build*/**/*.ico
38-
!/build*/**/*.in
39-
!/build*/**/*.manifest
40-
!/build*/**/*.rc
41-
!/build*/HowToBuild
42-
!/build*/edit*.sh
43-
!/build*/make*
31+
!/building/**/common*/*
32+
!/building/**/**/Makefile
33+
!/building/**/**/NotYetImplemented
34+
!/building/**/**/mvm
35+
!/building/**/**/plugins.*
36+
!/building/**/**/*.gmk
37+
!/building/**/**/*.ico
38+
!/building/**/**/*.in
39+
!/building/**/**/*.manifest
40+
!/building/**/**/*.rc
41+
!/building/**/HowToBuild
42+
!/building/**/edit*.sh
43+
!/building/**/make*
44+
!/building/**/asasm
45+
# ... and except this custom artifacts? What is this?
4446
!/build/**/conf.COG*
4547
!/build/**/make*
46-
!/build.*/asasm
48+
49+
4750

4851
# Track installer directories
4952
!installer
5053
# but ignore these files (derived from `grep installer .gitignore.orig`)
51-
/build*/**/installer/*.app
52-
/build*/**/installer/*.applescript
53-
/build*/**/installer/*.dmg
54-
/build*/**/installer/Binary
55-
/build*/**/installer/Control.idt.orig
56-
/build*/**/installer/Icon
57-
/build*/**/installer/files.???
58-
/build*/**/installer/nsvm.*
59-
/build*/**/installer/*.idt
60-
/build*/**/installer/*.msi
61-
/build*/**/installer/*.rtf
54+
/building/**/**/installer/*.app
55+
/building/**/**/installer/*.applescript
56+
/building/**/**/installer/*.dmg
57+
/building/**/**/installer/Binary
58+
/building/**/**/installer/Control.idt.orig
59+
/building/**/**/installer/Icon
60+
/building/**/**/installer/files.???
61+
/building/**/**/installer/nsvm.*
62+
/building/**/**/installer/*.idt
63+
/building/**/**/installer/*.msi
64+
/building/**/**/installer/*.rtf
6265

6366
# Track xcode directories
6467
!xcode
6568
# but ignore these files (derived from `grep xcode .gitignore.orig`)
66-
/build.macos32x86/xcode/*/Template.xcodeproj/*.mode1v3
67-
/build.macos32x86/xcode/*/Template.xcodeproj/*.pbxuser
69+
/building/macos32x86/xcode/*/Template.xcodeproj/*.mode1v3
70+
/building/macos32x86/xcode/*/Template.xcodeproj/*.pbxuser
6871

6972
# /history/
7073
/history/README.*

CMakeLists.txt

Lines changed: 102 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# OpenSmalltalkVM cmake build script.
2-
cmake_minimum_required(VERSION 2.8)
2+
cmake_minimum_required(VERSION 3.11)
33
cmake_policy(SET CMP0054 NEW)
44
project(OpenSmalltalkVM)
55
#for setjmp.asm
66
enable_language(ASM-ATT)
77

88
option(ONLY_CONFIG_H "Only generate config.h" OFF)
9-
option(SPUR_OBJECT_MODEL "Spur Object Model" ON)
10-
option(SISTA_OPTIMIZER "Sista Optimizer" OFF)
9+
10+
option(COG_JIT "Cog JIT" ON)
11+
option(SPUR_OBJECT_MODEL "Spur Object Model (i.e, no V3 image format)" ON)
12+
option(SISTA_OPTIMIZER "Sista-optimized Cog JIT" OFF)
1113
option(LOWCODE_EXTENSIONS "Lowcode Extensions" OFF)
12-
option(PHARO_BRANDING "Pharo Branding" ON)
14+
15+
option(PHARO_BRANDING "Pharo Branding" OFF)
16+
option(NEWSPEAK_BRANDING "Newspeak Branding" OFF)
17+
option(SQUEAK_BRANDING "Squeak Branding" ON)
18+
1319
option(SUPPORT_TRADITIONAL_DISPLAY "Enables building a VM with support for a window." OFF)
1420
option(ALLOW_SDL2 "Enables support for the SDL2 display plugin" OFF)
15-
option(COG_JIT "Cog JIT" ON)
1621
option(GENERATE_TOP_LEVEL_RUN_SCRIPT "Generate a top level run script on installation" ON)
1722
option(MINIMAL_PLUGIN_SET "Build the VM with the minimal number of plugins" OFF)
1823
option(BUILD_PLUGINS_AS_BUNDLES "Build VM plugins as bundles" OFF)
@@ -117,18 +122,17 @@ endif()
117122

118123
if(IS_64_BITS_BUILD_MACHINE)
119124
option(BUILD_I386_VERSION "Build x86 32 bits version" OFF)
120-
set(SQUEAK_PLATFORM_X86_64 True)
125+
set(OSVM_PLATFORM_X86_64 True)
121126
else(IS_X86_BUILD_MACHINE)
122-
set(SQUEAK_PLATFORM_X86_32 True)
127+
set(OSVM_PLATFORM_X86_32 True)
123128
endif()
124129

125-
if(SQUEAK_PLATFORM_X86_64)
130+
if(OSVM_PLATFORM_X86_64)
126131
if(BUILD_I386_VERSION)
127-
set(SQUEAK_PLATFORM_X86_32 True)
128-
set(SQUEAK_PLATFORM_X86_64 False)
132+
set(OSVM_PLATFORM_X86_32 True)
133+
set(OSVM_PLATFORM_X86_64 False)
129134
else()
130135
set(VM_64BITS TRUE)
131-
set(SourceFolderName "${SourceFolderName}64")
132136
set(VM_TARGET_CPU "x86_64")
133137
if(WIN32)
134138
set(VM_TARGET_CPU "X64")
@@ -141,7 +145,7 @@ else()
141145
set(VM_64BITS False)
142146
endif()
143147

144-
if(SQUEAK_PLATFORM_X86_32)
148+
if(OSVM_PLATFORM_X86_32)
145149
if (MSVC)
146150
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
147151
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2")
@@ -158,9 +162,19 @@ if(SQUEAK_PLATFORM_X86_32)
158162
endif()
159163

160164
set(VM_TARGET "${CMAKE_SYSTEM}")
161-
set(SourceFolderName "")
165+
set(SourceFolderName "src/")
162166
set(ProductFolderName "")
163167

168+
# Lowcode extended instructions
169+
if(LOWCODE_EXTENSIONS)
170+
add_definitions(-DLowcodeVM=1)
171+
set(SourceFolderName "${SourceFolderName}lowcode.vm")
172+
set(ProductFolderName "${ProductFolderName}lowcodevm")
173+
else()
174+
set(SourceFolderName "${SourceFolderName}vm")
175+
endif()
176+
177+
164178
if(WIN32)
165179
set(OS_TYPE "Win32")
166180
set(VM_TARGET_OS "Win32")
@@ -180,78 +194,102 @@ elseif(UNIX)
180194
endif()
181195

182196

183-
# Spur object model
184-
185-
if(SPUR_OBJECT_MODEL)
186-
#add_definitions(SpurVM=1)
187-
set(SourceFolderName "spur")
188-
set(ProductFolderName "spur${ProductFolderName}")
197+
# 64 bits VM
198+
if(VM_64BITS)
199+
set(SourceFolderName "${SourceFolderName}.64bit")
200+
set(ProductFolderName "${ProductFolderName}64")
201+
else()
202+
set(SourceFolderName "${SourceFolderName}.32bit")
203+
set(ProductFolderName "${ProductFolderName}32")
189204
endif()
190205

191-
# Sista optimizer
206+
207+
# What Cogit is active?
192208
if(SISTA_OPTIMIZER)
193-
#add_definitions(SistaVM=1)
194-
set(SourceFolderName "${SourceFolderName}sista")
195-
set(ProductFolderName "${ProductFolderName}spur")
209+
#add_definitions(SistaVM=1) # not needed because already set in sources
210+
set(SourceFolderName "${SourceFolderName}.sista")
211+
set(ProductFolderName "sista${ProductFolderName}")
212+
elseif(COG_JIT)
213+
set(SourceFolderName "${SourceFolderName}.cog")
214+
set(ProductFolderName "cog${ProductFolderName}")
215+
else()
216+
set(SourceFolderName "${SourceFolderName}.stack")
217+
set(ProductFolderName "stack${ProductFolderName}")
196218
endif()
197219

198-
# Lowcode extended instructions
199-
if(LOWCODE_EXTENSIONS)
200-
add_definitions(-DLowcodeVM=1)
201-
set(SourceFolderName "${SourceFolderName}lowcode")
202-
set(ProductFolderName "${ProductFolderName}lowcode")
203-
endif()
204220

205-
# Stack interpreter
206-
if(COG_JIT)
207-
set(ProductFolderName "cog${ProductFolderName}")
221+
# Spur object model
222+
if(SPUR_OBJECT_MODEL)
223+
#add_definitions(SpurVM=1) # not needed because already set in sources
224+
set(SourceFolderName "${SourceFolderName}.spur")
225+
set(ProductFolderName "spur${ProductFolderName}")
208226
else()
209-
set(SourceFolderName "${SourceFolderName}stack")
210-
set(ProductFolderName "stack${ProductFolderName}")
227+
set(SourceFolderName "${SourceFolderName}.v3")
228+
set(ProductFolderName "v3${ProductFolderName}")
211229
endif()
212230

231+
213232
# Add the minheadless suffix
214233
set(ProductFolderName "${ProductFolderName}mhdls")
215234
if(HAVE_SDL2 AND SUPPORT_TRADITIONAL_DISPLAY)
216235
set(ProductFolderName "${ProductFolderName}sdl2")
217236
endif()
218237

219-
# 64 bits VM
220-
if(VM_64BITS)
221-
set(SourceFolderName "${SourceFolderName}64")
222-
set(ProductFolderName "${ProductFolderName}64")
223-
endif()
224-
225238

226239
# VM branding
227-
set(VM_EXECUTABLE_NAME squeak)
228-
set(VM_LIBRARY_NAME SqueakVMCore)
229-
set(VM_NAME Squeak)
230-
set(PHARO_VM FALSE)
231-
set(SQUEAK_VM FALSE)
232-
233-
if(DARWIN OR WIN32)
234-
set(VM_EXECUTABLE_NAME Squeak)
235-
endif()
236-
237240
if(PHARO_BRANDING)
238-
add_definitions(-DPharoVM=1 -DIMMUTABILITY=1)
241+
set(PHARO_VM TRUE)
239242
set(VM_EXECUTABLE_NAME pharo)
240243
set(VM_LIBRARY_NAME PharoVMCore)
241-
set(VM_NAME Pharo)
244+
set(VM_NAME Pharo)
242245
set(VM_PLUGINS_ENV_VAR_NAME "PHARO_PLUGINS")
243-
set(PHARO_VM TRUE)
244246
set(ProductFolderName "ph${ProductFolderName}")
245247
if(DARWIN OR WIN32)
246248
set(VM_EXECUTABLE_NAME Pharo)
247249
endif()
248-
else()
249-
set(SQUEAK_VM TRUE)
250+
elseif(NEWSPEAK_BRANDING)
251+
set(NEWSPEAK_VM TRUE)
252+
set(VM_EXECUTABLE_NAME newspeak)
253+
set(VM_LIBRARY_NAME NewspeakVMCore)
254+
set(VM_NAME Newspeak)
255+
set(VM_PLUGINS_ENV_VAR_NAME "NEWSPEAK_PLUGINS")
256+
set(ProductFolderName "ns${ProductFolderName}")
257+
if(DARWIN OR WIN32)
258+
set(VM_EXECUTABLE_NAME Newspeak)
259+
endif()
260+
elseif(SQUEAK_BRANDING)
261+
set(SQUEAK_VM TRUE)
262+
set(VM_EXECUTABLE_NAME squeak)
263+
set(VM_LIBRARY_NAME SqueakVMCore)
264+
set(VM_NAME Squeak)
250265
set(VM_PLUGINS_ENV_VAR_NAME "SQUEAK_PLUGINS")
251266
set(ProductFolderName "sq${ProductFolderName}")
267+
if(DARWIN OR WIN32)
268+
set(VM_EXECUTABLE_NAME Squeak)
269+
endif()
270+
else()
271+
set(PHARO_VM FALSE)
272+
set(NEWSPEAK_VM FALSE)
273+
set(SQUEAK_VM FALSE)
274+
set(VM_EXECUTABLE_NAME osvm)
275+
set(VM_LIBRARY_NAME OpenSmalltalkVMCore)
276+
set(VM_NAME OpenSmalltalkVM)
277+
set(VM_PLUGINS_ENV_VAR_NAME "OPENSMALLTALK_PLUGINS")
278+
if(DARWIN OR WIN32)
279+
set(VM_EXECUTABLE_NAME OpenSmalltalkVM)
280+
endif()
252281
endif()
253282
add_definitions(-DVM_NAME="${VM_NAME}")
254283

284+
if(PHARO_VM)
285+
add_definitions(-DPharoVM=1 -DIMMUTABILITY=1)
286+
elseif(NEWSPEAK_VM)
287+
add_definitions(-DNewspeakVM=1)
288+
elseif(SQUEAK_VM)
289+
# Nothing extra to define
290+
endif()
291+
292+
255293
# Cog JIT
256294
if(COG_JIT)
257295
#add_definitions(CogVM=1)
@@ -411,7 +449,7 @@ else()
411449
endif()
412450

413451
# Type sizes
414-
if(BUILD_I386_VERSION OR SQUEAK_PLATFORM_X86_32)
452+
if(BUILD_I386_VERSION OR OSVM_PLATFORM_X86_32)
415453
set(SIZEOF_INT 4)
416454
set(SIZEOF_LONG 4)
417455
set(SIZEOF_LONG_LONG 8)
@@ -465,22 +503,22 @@ include_directories(
465503
"${PROJECT_SOURCE_DIR}/include"
466504
"${PROJECT_SOURCE_DIR}/platforms/Cross/vm"
467505
"${PROJECT_SOURCE_DIR}/platforms/Cross/plugins"
468-
"${SourceFolderName}/vm"
506+
"${SourceFolderName}"
469507
)
470508

471509
# VM Flavor sources
472510
if(COG_JIT)
473511
if(VM_MSVC)
474-
set(InterpreterSource ${SourceFolderName}/vm/cointerp.c)
512+
set(InterpreterSource ${SourceFolderName}/cointerp.c)
475513
else()
476-
set(InterpreterSource ${SourceFolderName}/vm/gcc3x-cointerp.c)
514+
set(InterpreterSource ${SourceFolderName}/gcc3x-cointerp.c)
477515
endif()
478516
set(VM_FAVLOR_SOURCES
479-
${SourceFolderName}/vm/cogit.c
517+
${SourceFolderName}/cogit.c
480518
${InterpreterSource}
481519
)
482520
else()
483-
set(InterpreterSource ${SourceFolderName}/vm/interp.c)
521+
set(InterpreterSource ${SourceFolderName}/interp.c)
484522
set(VM_FAVLOR_SOURCES
485523
${InterpreterSource}
486524
)
@@ -626,7 +664,7 @@ elseif(WIN32)
626664
platforms/minheadless/windows
627665
)
628666

629-
if(SQUEAK_PLATFORM_X86_32)
667+
if(OSVM_PLATFORM_X86_32)
630668
set(SETJMP_IMPL platforms/win32/misc/_setjmp-x86.asm)
631669
else()
632670
set(SETJMP_IMPL platforms/win32/misc/_setjmp-x64.asm)
@@ -669,12 +707,12 @@ elseif(WIN32)
669707
endif()
670708

671709
set(VM_DEPENDENCIES_LIBRARIES Winmm ${VM_DEPENDENCIES_LIBRARIES})
672-
if(SQUEAK_PLATFORM_X86_32)
710+
if(OSVM_PLATFORM_X86_32)
673711
add_definitions(
674712
-DX86
675713
-DWIN32=1
676714
)
677-
elseif(SQUEAK_PLATFORM_X86_64)
715+
elseif(OSVM_PLATFORM_X86_64)
678716
add_definitions(
679717
-DWIN64=1
680718
)

0 commit comments

Comments
 (0)