[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.81.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 1 18:07:41 UTC 2014


Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.81.mcz

==================== Summary ====================

Name: CMakeVMMakerSqueak-tty.81
Author: tty
Time: 1 July 2014, 2:07:31.67 pm
UUID: 672b7f43-3b93-4e5f-a037-fad1fc9e8a39
Ancestors: CMakeVMMakerSqueak-tty.80

Linux64x86w32BitSqueakCogV3Config generates and runs.

Next up, cleanup on this class then configure for other build configurations

=============== Diff against CMakeVMMakerSqueak-tty.80 ===============

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>addCrossSources: (in category 'as yet unclassified') -----
+ addCrossSources: sources
+ 
+ 	^ self addSources: sources prefixed: '${pluginCross}/'
+ !

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>addExternalDependency: (in category 'as yet unclassified') -----
+ addExternalDependency: aString 
+ 	"We need to collect external dependencies to internal plugins because we need to force its 
+ 	resolve before, and if we just add teh dependency in executable some times is not enough. 
+ 	check StackIPhoneConfig>>#configureFT2Plugin: as an example"
+ 	externalDependencies := externalDependencies copyWith: aString.!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>addExternalLibrary: (in category 'cmake commands') -----
+ addExternalLibrary: aLibrary 
+ 	self isInternal 
+ 		ifTrue: [ vmGen addExternalLibrary: aLibrary ]
+ 		ifFalse: [ super addExternalLibrary: aLibrary ].!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>addPlatformSources: (in category 'as yet unclassified') -----
+ addPlatformSources: sources
+ 
+ 	^ self addSources: sources prefixed: '${pluginPlatform}/'
+ !

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>config (in category 'as yet unclassified') -----
+ config
+ 	^ vmGen config!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>configurationName (in category 'as yet unclassified') -----
+ configurationName
+ 	^ vmGen configurationName!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>doNotGenerate (in category 'as yet unclassified') -----
+ doNotGenerate
+ 
+ 	"Forcely exclude plugin form build. Use this method only for debugging purposes.
+ 	
+ 	Front-end users should simply specify different list of plugins for building VM,
+ 	effectively excluding any unwanted stuff "
+ 	
+ 	^doNotGenerate!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>doNotGenerate: (in category 'as yet unclassified') -----
+ doNotGenerate: aValue
+ 
+ 	"Forcely exclude plugin form build. Use this method only for debugging purposes.
+ 	
+ 	Front-end users should simply specify different list of plugins for building VM,
+ 	effectively excluding any unwanted stuff "
+ 	
+ 	doNotGenerate := aValue!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>externalDependencies (in category 'as yet unclassified') -----
+ externalDependencies
+ 	^ externalDependencies!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>generate (in category 'squeak compatibility') -----
+ generate
+ 
+ 	| name |
+ 	output := String new writeStream.
+ 
+ 	name := plugin moduleName.
+ #(	vmGen config setGlobalOptions: self.
+ 	
+ 	self 
+ 		printHeader;
+ 		project: name;
+ 		"include directories generated for build"
+ 		include: '../directories.cmake'.
+ 	
+ 	self set: 'CMAKE_CONFIGURATION_TYPES' to: 'Release'.
+ ).
+ 
+ 	self message: (internal ifTrue: [ 'Adding internal plugin: '] ifFalse: ['Adding external plugin: '])  , name.
+ 
+ 	self 
+ 		set: #pluginName toString: name;
+ 		set: #pluginSrc toString: '${srcPluginsDir}/', name;
+ 		set: #pluginCross toString: '${crossDir}/plugins/', name;
+ 		set: #pluginPlatform toString: '${targetPlatform}/plugins/', name.
+ 
+ 
+ 	"clear LINKLIBS variable"
+ 	self set: #LINKLIBS to: ''.		
+ 	
+ 	internal 
+ 		ifTrue: [ self puts: 'add_definitions(-DSQUEAK_BUILTIN_PLUGIN)'].
+ 	
+ 	self addSources: { name , '.c' } prefixed: '${pluginSrc}/'.
+ 
+ 	" default include directories for plugin "
+ 	self includeDirectories: '${pluginSrc} ${pluginCross} ${targetPlatform}/plugins/${pluginName}'.
+ 	
+ 	"Not needed because there are already there (inherited from main configuration)"
+ 	"self addDefinitions: vmGen config compilerFlags."
+ 
+ 	" perform config's configureXYZ: message to apply per-plugin custom rules, if any "
+ 	
+ 	vmGen config configurePlugin: plugin with: self.
+ 	
+ 	extraRules ifNotNil: [ extraRules value: self ].
+ 	
+ 	" generate a static lib for internal plugin, or shared for external"
+ 	internal ifTrue: [
+ 		self cmd: 'add_library' params:  name , ' STATIC ${sources}'.
+ 	] ifFalse: [
+ 		self cmd: 'add_library' params: name , ' SHARED ${sources}'.
+ 		
+ 	"	self cmd: 'set_property' params: 'TARGET ' , name , ' PROPERTY LINK_FLAGS -bundle'"
+ 	].
+ 
+ 	vmGen config extraPluginSettings: self.
+ 	self isExternal ifTrue: [
+ 		self cmd: 'target_link_libraries'
+ 			params: self moduleName , ' ${LINKLIBS}'.
+ 		].
+ 	
+ 	" see senders of #linkFlags "
+ 	self 
+ 		cmd: 'set_property' 
+ 		params: 'TARGET ', name, ' PROPERTY LINK_FLAGS "${linkFlags}"'.
+ 	
+ 	"set dependencies"
+ 	self puts: 'IF (',self moduleName , '_dependencies)'.
+ 	
+ 	self cmd: 'add_dependencies'
+ 		params: name , ' ${', self moduleName , '_dependencies}'.
+ 	
+ 	self puts: 'ENDIF (',self moduleName , '_dependencies)'.
+ 	self saveFile.!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>initialize (in category 'initialize-release') -----
+ initialize 
+ 	super initialize.
+ 	externalDependencies := #().!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>isExternal (in category 'as yet unclassified') -----
+ isExternal
+ 	^ internal not!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>isInternal (in category 'as yet unclassified') -----
+ isInternal
+ 	^ internal!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>moduleName (in category 'accessing') -----
+ moduleName 
+ 	^plugin moduleName!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>plugin (in category 'as yet unclassified') -----
+ plugin
+ 	^ plugin!

Item was added:
+ ----- Method: CMakePluginGeneratorForSqueak>>vmGenerator (in category 'squeak compatibility') -----
+ vmGenerator
+ 	"Make it accessible from plugin generator side"
+ 	^ vmGen!

Item was changed:
  ----- Method: CMakeVMGeneratorForSqueak>>generatePlugin:internal:extraRules: (in category 'as yet unclassified') -----
  generatePlugin: aPlugin internal: aBoolean extraRules: aBlock
  	" this method called back from plugin"
+ 	^ CMakePluginGeneratorForSqueak new
- 	^ CMakePluginGenerator new
  		generate: aPlugin for: self internal: aBoolean extraRules: aBlock!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>linkFlags (in category 'cmake buildType redirects') -----
  linkFlags
  	" '-lSM -lICE -ldl -lGL -lpthread -lm -lnsl -lX11' -L/usr/lib32 etc..."
  	|d flags|
  	d:= SqueakCMakeVMMakerAbstractBuilder default buildTypeAndDirectoryInfo copy.
  	d 
  		at: #build put: [self linkFlagsBuild];
  		at: #buildAssert  put: [self linkFlagsBuildAssert];
  		at: #buildAssertITimerHeartbeat  put: [self linkFlagsBuildAssertITimerHeartbeat];
              at:#buildDebug  put: [self linkFlagsBuildDebug];   
  		at: #buildDebugITimerHeartbeat  put: [self linkFlagsBuildDebugITimerHeartbeat ];
  		at: #buildITimerHeartbeat  put: [self linkFlagsBuildITimerHeartbeat];
  		at: #buildMultiThreaded  put: [self linkFlagsBuildMultiThreaded ];
  		at: #buildMultiThreadedAssert  put: [self linkFlagsBuildMultiThreadedAssert];
  		at: #buildMultiThreadedDebug   put: [self linkFlagsBuildMultiThreadedDebug ];
  		at: #buildNone put:[self linkFlagsNoBuildType].
  	flags := String
  				streamContents: [:stream | ((d at: buildType) value collect: #withBlanksTrimmed as: Set)
  						asStringOn: stream
  						delimiter: ' '].
  	^flags.
  
  
  !

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>preferredIncludesBuild (in category 'source files') -----
  preferredIncludesBuild
+ 	^ #(  '${targetPlatform}/plugins/B3DAcceleratorPlugin')
- 	^ #(  '${targetPlatform}/plugins/AioPlugin'
-  '${targetPlatform}/plugins/B3DAcceleratorPlugin'
-  '${targetPlatform}/plugins/DropPlugin'
-  '${targetPlatform}/plugins/FilePlugin'
-  '${targetPlatform}/plugins/HostWindowPlugin'
-  '${targetPlatform}/plugins/JPEGReadWriter2Plugin'
-  '${targetPlatform}/plugins/LocalePlugin'
-  '${targetPlatform}/plugins/Mpeg3Plugin'
-  '${targetPlatform}/plugins/PseudoTTYPlugin'
-  '${targetPlatform}/plugins/SerialPlugin'
-  '${targetPlatform}/plugins/SoundPlugin'
-  '${crossDir}/plugins/SoundGenerationPlugin'
-  '${targetPlatform}/plugins/SqueakSSL'
-  '${targetPlatform}/plugins/UnixOSProcessPlugin'
-  '${targetPlatform}/plugins/AsynchFilePlugin'
-  '${targetPlatform}/plugins/BochsIA32Plugin'
-  '${targetPlatform}/plugins/FileCopyPlugin'
-  '${targetPlatform}/plugins/FloatMathPlugin'
-  '${targetPlatform}/plugins/InternetConfigPlugin'
-  '${targetPlatform}/plugins/JoystickTabletPlugin'
-  '${targetPlatform}/plugins/MIDIPlugin'
-  '${targetPlatform}/plugins/PrintJobPlugin'
-  '${targetPlatform}/plugins/SecurityPlugin'
-  '${crossDir}/plugins/SocketPlugin'
-  '${targetPlatform}/plugins/SqueakFFIPrims'
-  '${targetPlatform}/plugins/UUIDPlugin'    
-  '${targetPlatform}/plugins/XDisplayControlPlugin'
  
- )
  
- 
  	
  
  "SystemNavigation default browseMethodsWhoseNamesContain: 'preferredIncludes'"
  	!

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>setExtraTargetPropertiesBuild: (in category 'cmake buildType redirects') -----
  setExtraTargetPropertiesBuild: aMaker
  	self flag:'tty'. "I am nervous about this method up here in this class, but pharo has it in CogUnixConfig, so using as is for now"
  
  
+ 
  	aMaker message: 'setExtraTargetPropertiesBuild: aMaker'.		
  
+ 	aMaker setTargetProperties: 'LINK_FLAGS "-m32"'.
  	aMaker puts: 'set_source_files_properties( ${srcVMDir}/cogit.c PROPERTIES 
  		COMPILE_FLAGS "' , self compilerFlags , '")'.
  		
  	
  	aMaker 
  		cmd: 'set_source_files_properties'
  		params: ' ${targetPlatform}/vm/sqUnixHeartbeat.c PROPERTIES 
  		COMPILE_FLAGS "' , self compilerFlags , '"'.
+ 	
- 	"
  	aMaker addExternalLibraries: 
  		#(
  			'uuid'  ""
  			'ssl'  ""
  			'crypto' ""
  			'm'  
  			'dl' 
  			'pthread' 
  		).
  				
+ 
- "
  	aMaker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.
  	self addVMDrivers: aMaker.!

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>setGlobalOptionsAfterDetermineSystemBuild: (in category 'cmake buildType redirects') -----
  setGlobalOptionsAfterDetermineSystemBuild: aMaker
  	"
  	SystemNavigation default browseMethodsWhoseNamesContain: 'setGlobalOptionsAfterDetermineSystemBuild:'"
+ 	aMaker message: 'setGlobalOptionsAfterDetermineSystemBuild: aMaker'.	
+ "	aMaker set: 'CMAKE_FIND_ROOT_PATH' to: '/usr/lib  ' "	!
- 	aMaker message: 'setGlobalOptionsAfterDetermineSystemBuild: aMaker'.		!

Item was changed:
  ----- Method: Linux64x86w32BitConfig>>setGlobalOptionsBuild: (in category 'cmake buildType redirects') -----
  setGlobalOptionsBuild: aMaker
  	aMaker message: 'setGlobalOptionsBuild: aMaker'.
+ 	aMaker linkDirectories: '/usr/lib'.
+ 
+ "	SystemNavigation default browseMethodsWhoseNamesContain: 'setGlobalOptions:'  "!
- "	maker set: 'CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}' to: ' /usr/lib/gcc/x86_64-slackware-linux/4.8.2/'. 
- set any CMake global options, before declaring a project in cmake file
- 	
- 	set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/lib)
- 	SystemNavigation default browseMethodsWhoseNamesContain: 'setGlobalOptions:'
- "!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>compilerFlagsBuild (in category 'cmake buildType redirects') -----
  compilerFlagsBuild
  	"Some gcc versions (3.4*) create a broken VM using -O2, so try -O1 if you have problems"
  	^{ 
+   '-g3'                                               "more debugging"
+  . '-O1'                                              "low optimization level"
+  . '-m32'
+  . '-msse2'
+  . '-D_GNU_SOURCE'
+  . '-D_FILE_OFFSET_BITS=64'
+  . '-DNDEBUG'                                      "disable assertions"
+  . '-DLSB_FIRST=1'                               ""
+  . '-DUSE_GLOBAL_STRUCT=0'
+  . '-DDEBUGVM=0'
+  . '-DCOGMTVM=0'
+  . '-fno-tree-pre	'
+  . '-fno-caller-saves'
+  . '-L/usr/lib'
- '-g3'                                               "more debugging"
- .'-O1'                                              "low optimization level"
- .'-m32'
- .'-msse2'
- .'-D_GNU_SOURCE'
- .'-D_FILE_OFFSET_BITS=64'
- .'-DNDEBUG'                                      "disable assertions"
- .'-DLSB_FIRST=1'                               ""
- .'-DUSE_GLOBAL_STRUCT=0'
- .'-DDEBUGVM=0'
- .'-DCOGMTVM=0'
- .'-fno-tree-pre	'
- .'-fno-caller-saves'
  }
  
  !

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>defaultExternalPlugins (in category 'plugins') -----
  defaultExternalPlugins
  	""
+ 	^ #()!
- 	^ (super defaultExternalPlugins copyWithoutAll: #(BochsIA32Plugin #UUIDPlugin))!

Item was added:
+ ----- Method: Linux64x86w32BitSqueakCogV3Config>>defaultInternalPlugins (in category 'plugins') -----
+ defaultInternalPlugins
+ 	^super defaultInternalPlugins copyWithoutAll:#(#FloatMathPlugin)!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>dirInstall (in category 'cmake') -----
  dirInstall
  	"the directory of the finished product.. the place where 'make install' puts stuff.
  	SystemNavigation default browseMethodsWhoseNamesContain: 'outputDir'
        "
+ 	^self squeakCogV3!
- 	^self squeakCogV3 , '.noGL'!

Item was changed:
  ----- Method: Linux64x86w32BitSqueakCogV3Config>>linkFlagsBuild (in category 'cmake buildType redirects') -----
  linkFlagsBuild
  	"Answer array of libraries to link to"
+ 	^ { '-L/usr/lib'
+ 	     . '-L/usr/lib/X11'
+            . '-luuid'
- 	^ { 
-             '-luuid'
             . 'lSM' 
             . '-lICE'
             . '-ldl' 
             . '-lGL'
             . '-lpthread'
             . '-lm' 
             . '-lnsl'
             . '-lX11'
+ 	   } addAll: (self lDFlagsBuild)
- 	   }
  !



More information about the Vm-dev mailing list