[Vm-dev] VM Maker: CMakeVMMaker-golubovsky.142.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 1 03:15:33 UTC 2012


Dmitry Golubovsky uploaded a new version of CMakeVMMaker to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMaker-golubovsky.142.mcz

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

Name: CMakeVMMaker-golubovsky.142
Author: golubovsky
Time: 31 December 2011, 10:16:11 pm
UUID: a76ea11e-3839-4c69-a3d1-5947855b06b6
Ancestors: CMakeVMMaker-golubovsky.141

Copy to source.squeak.org: will now host here.

=============== Diff against CMakeVMMaker-IgorStasenko.136 ===============

Item was changed:
+ SystemOrganization addCategory: #'CMakeVMMaker-Android'!
  SystemOrganization addCategory: #CMakeVMMaker!
  SystemOrganization addCategory: #'CMakeVMMaker-Unix'!
  SystemOrganization addCategory: #'CMakeVMMaker-Windows'!
  SystemOrganization addCategory: #'CMakeVMMaker-MacOS'!
  SystemOrganization addCategory: #'CMakeVMMaker-IOS'!
  SystemOrganization addCategory: #'CMakeVMMaker-FreeBSD'!

Item was added:
+ CMakeVMGenerator subclass: #CMakeAndroidGenerator
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Android'!
+ 
+ !CMakeAndroidGenerator commentStamp: 'golubovsky 7/27/2011 22:49' prior: 0!
+ This class inherits from CMakeGenerator and provides the same generation facilities as its parent, but output is more adjusted to the Android NDK requirements.!

Item was added:
+ ----- Method: CMakeAndroidGenerator>>addDefinitions: (in category 'gmake commands') -----
+ addDefinitions: aString
+ 	output 
+ 		nextPutAll: ('COG_CFLAGS += ', aString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>addSubdirectory: (in category 'gmake commands') -----
+ addSubdirectory: aDir
+ 
+ 	^ self include: ('$(buildDir)/', aDir, '/', self outputFileName).
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>append:with: (in category 'gmake commands') -----
+ append: variableName with: aValueString
+ 
+ 	output 
+ 		nextPutAll: (variableName, ' += ', aValueString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>generate (in category 'code generation') -----
+ generate
+ 
+ 	"override this method to produce gmake syntax"
+ 	
+ 	output := String new writeStream.
+ 		
+ 	self printHeader.
+ 
+ 	config setupDirectories: self.
+ 		
+ 	config preferredIncludes 
+ 		do: [ :each | self includeDirectories: each ].
+ 	self includeDirectories: self includeDirs.	
+ 	config standardIncludes 
+ 		do: [:each | self includeDirectories: each ].
+ 
+ 	self addDefinitions: config compilerFlags.
+ 
+ 	config extraVMSettings: self.
+ 	
+ 	self append: #LOCAL_SRC_FILES with: self sources.
+ 		
+ 	self processInternalPlugins.	
+ 	config setExtraTargetProperties: self.
+ 	
+ 	self saveFile.
+ 	!

Item was added:
+ ----- Method: CMakeAndroidGenerator>>generatePlugin:internal:extraRules: (in category 'plugins') -----
+ generatePlugin: aPlugin internal: aBoolean extraRules: aBlock
+ 	" this method called back from plugin"
+ 	^ CMakeAndroidPluginGenerator new
+ 		generate: aPlugin for: self internal: aBoolean extraRules: aBlock!

Item was added:
+ ----- Method: CMakeAndroidGenerator>>include: (in category 'gmake commands') -----
+ include: aFileName
+ 	output 
+ 		nextPutAll: ('include ', aFileName); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>includeDirectories: (in category 'gmake commands') -----
+ includeDirectories: aString
+ 	output 
+ 		nextPutAll: ('COG_INCLUDE_DIRS += ', aString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>includeDirs (in category 'sources management') -----
+ includeDirs
+ 
+ 	^ '-I$(crossDir)/vm -I$(srcVMDir) -I$(targetPlatform)/vm -I$(buildDir)'.!

Item was added:
+ ----- Method: CMakeAndroidGenerator>>outputFileName (in category 'accessing') -----
+ outputFileName
+ 	"override this to set the file name to create"
+ 	^ 'cogsources.mk'!

Item was added:
+ ----- Method: CMakeAndroidGenerator>>printHeader (in category 'submakefile creation') -----
+ printHeader
+ 	
+ 	self puts: '# This is automatically generated file using ', self configurationName, ' on ',
+ 		Date current asString, ' ' , Time current asString.
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>processInternalPlugins (in category 'plugins') -----
+ processInternalPlugins
+ 
+ 	| libs |
+ 	libs := OrderedCollection new.
+ 
+ 	config internalPlugins collect: [:each | | plugin gen |
+ 		plugin := Smalltalk at: each.
+ 		gen := plugin generateFor: self internal: true.
+ 		gen doNotGenerate ifFalse: [
+ 			libs add: plugin moduleName.
+ 			self addSubdirectory: plugin moduleName.
+ 			 ].
+ 		].
+ 	
+ 	self generateExportsH: libs.
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>set:to: (in category 'gmake commands') -----
+ set: variableName to: aValueString
+ 
+ 	output 
+ 		nextPutAll: (variableName, ' := ', aValueString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidGenerator>>sources (in category 'accessing') -----
+ sources
+ 
+ 	self set: #coreSources to: 
+ 		(self append: '$(srcVMDir)/' toAll: config coreSources).
+ 		
+ 	self set: #platformVMSources to: 
+ 		(self append: '$(targetPlatform)/vm/' toAll: config platformSources).
+ 	
+ 	
+ 	self set: #crossVMSources to: 
+ 		(self append: '$(crossDir)/vm/' toAll: config crossSources).
+ 		
+ 	self set: #extraSources to: config extraSources.
+ 	
+ 	^ '$(coreSources) $(crossVMSources) $(platformVMSources) $(extraSources)'!

Item was added:
+ CMakePluginGenerator subclass: #CMakeAndroidPluginGenerator
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Android'!

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>addCrossSources: (in category 'sources management') -----
+ addCrossSources: sources
+ 
+ 	^ self addSources: sources prefixed: '$(pluginCross)/'
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>addDefinitions: (in category 'gmake commands') -----
+ addDefinitions: aString
+ 	output 
+ 		nextPutAll: ('COG_CFLAGS += ', aString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>addSources:prefixed: (in category 'sources management') -----
+ addSources: aFileNames prefixed: aPrefix
+ 
+ 	| names |
+ 	names := aFileNames inject: '' into: [:res :each | res ,  aPrefix, each, ' ' ].
+ 	self append: #LOCAL_SRC_FILES with: names.
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>addSubdirectory: (in category 'gmake commands') -----
+ addSubdirectory: aDir
+ 
+ 	^ self include: ('$(buildDir)/', aDir, '/', self outputFileName).
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>append:with: (in category 'gmake commands') -----
+ append: variableName with: aValueString
+ 
+ 	output 
+ 		nextPutAll: (variableName, ' += ', aValueString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>generate (in category 'gmake commands') -----
+ generate
+ 
+ 	| name |
+ 	output := String new writeStream.
+ 
+ 	name := plugin moduleName.
+ 	self printHeader.
+ 	
+ 	self 
+ 		set: #pluginName to: name;
+ 		set: #pluginSrc to: '$(srcPluginsDir)/', name;
+ 		set: #pluginCross to: '$(crossDir)/plugins/', name;
+ 		set: #pluginPlatform to: '$(targetPlatform)/plugins/', name.
+ 		
+ 	self addDefinitions: '-DSQUEAK_BUILTIN_PLUGIN'.
+ 	
+ 	self addSources: { name , '.c' } prefixed: '$(pluginSrc)/'.
+ 
+ 	self includeDirectories: '-I$(pluginSrc) -I$(pluginCross) -I$(targetPlatform)/plugins/$(pluginName)'.
+ 
+ 	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 ].
+ 	
+ 	vmGen config extraPluginSettings: self.
+ 	
+ 	self saveFile.!

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>generatePlugin:internal:extraRules: (in category 'plugins') -----
+ generatePlugin: aPlugin internal: aBoolean extraRules: aBlock
+ 	doNotGenerate := false.
+ 	internal := aBoolean.
+ 	plugin := aPlugin.
+ 	vmGen := CMakeAndroidGenerator.
+ 	extraRules := aBlock.
+ 		
+ 	^ self generate!

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>include: (in category 'gmake commands') -----
+ include: aFileName
+ 	output 
+ 		nextPutAll: ('include ', aFileName); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>includeDirectories: (in category 'gmake commands') -----
+ includeDirectories: aString
+ 	output 
+ 		nextPutAll: ('COG_INCLUDE_DIRS += ', aString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>includeDirs (in category 'sources management') -----
+ includeDirs
+ 
+ 	^ '-I$(crossDir)/vm -I$(srcVMDir) -I$(targetPlatform)/vm -I$(buildDir)'.!

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>outputFileName (in category 'accessing') -----
+ outputFileName
+ 	"override this to set the file name to create"
+ 	^ 'cogsources.mk'!

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>printHeader (in category 'submakefile creation') -----
+ printHeader
+ 	
+ 	self puts: '# This is automatically generated file using ', self configurationName, ' on ',
+ 		Date current asString, ' ' , Time current asString.
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>processInternalPlugins (in category 'plugins') -----
+ processInternalPlugins
+ 
+ 	| libs |
+ 	libs := OrderedCollection new.
+ 
+ 	config internalPlugins collect: [:each | | plugin gen |
+ 		plugin := Smalltalk at: each.
+ 		gen := plugin generateFor: self internal: true.
+ 		gen doNotGenerate ifFalse: [
+ 			libs add: plugin moduleName.
+ 			self addSubdirectory: plugin moduleName.
+ 			 ].
+ 		].
+ 	
+ 	self generateExportsH: libs.
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>set:to: (in category 'gmake commands') -----
+ set: variableName to: aValueString
+ 
+ 	output 
+ 		nextPutAll: (variableName, ' := ', aValueString); 
+ 		cr
+ !

Item was added:
+ ----- Method: CMakeAndroidPluginGenerator>>sources (in category 'accessing') -----
+ sources
+ 
+ 	self set: #coreSources to: 
+ 		(self append: '$(srcVMDir)/' toAll: config coreSources).
+ 		
+ 	self set: #platformVMSources to: 
+ 		(self append: '$(targetPlatform)/vm/' toAll: config platformSources).
+ 	
+ 	
+ 	self set: #crossVMSources to: 
+ 		(self append: '$(crossDir)/vm/' toAll: config crossSources).
+ 		
+ 	self set: #extraSources to: config extraSources.
+ 	
+ 	^ '$(coreSources) $(crossVMSources) $(platformVMSources) $(extraSources)'!

Item was added:
+ ----- Method: CMakeGenScripts class>>generateCogMacOS (in category 'as yet unclassified') -----
+ generateCogMacOS
+ 	" generate sources for Stack Interpreter of Mac OS"
+ 	| top |
+ 	top := FileDirectory default containingDirectory.				
+ 	
+ 	VMMaker
+ 		generate: CoInterpreter
+ 		to: (top / 'src') fullName
+ 		platformDir: ( top / 'platforms') fullName
+ 		excluding:#(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 					FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin).
+ 						
+ 	CogMacOSConfig generate.
+ 
+ 	!

Item was added:
+ ----- Method: CMakeGenScripts class>>generateCogSources (in category 'sources generation') -----
+ generateCogSources
+ 	" self generateCogSources "
+ 
+ 	" generate sources for CoInterpreter"
+ 
+ 	| top |
+ 	
+ 	CogRTLOpcodes initialize.
+ 	CogIA32Compiler initialize.
+ 	
+ 	top := FileDirectory default containingDirectory.				
+ 	
+ 	VMMaker
+ 		generate: CoInterpreter
+ 		and: StackToRegisterMappingCogit
+ 		to: (top / 'src') fullName
+ 		platformDir: ( top / 'platforms') fullName
+ 		excluding:#(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 					FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin NewsqueakIA32ABIPlugin
+ 					 NewsqueakIA32ABIPluginAttic).
+ !

Item was added:
+ ----- Method: CMakeGenScripts class>>generateCogSources: (in category 'sources generation') -----
+ generateCogSources: config
+ 	" self generateCogSources "
+ 
+ 	" generate sources for CoInterpreter"
+ 
+ 	| top src |
+ 	
+ 	CogRTLOpcodes initialize.
+ 	CogIA32Compiler initialize.
+ 	
+ 	top := config topDir.				
+ 	src := config srcDir assureExistence fullName.
+ 	
+ 	VMMaker
+ 		generate: CoInterpreter
+ 		and: StackToRegisterMappingCogit
+ 		to: src
+ 		platformDir: ( top / 'platforms') fullName
+ 		excluding:#(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 					FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin NewsqueakIA32ABIPlugin
+ 					 NewsqueakIA32ABIPluginAttic).
+ !

Item was added:
+ ----- Method: CMakeGenScripts class>>generateCogSourcesEmm40 (in category 'sources generation') -----
+ generateCogSourcesEmm40
+ 	" self generateCogSourcesEmm40 "
+ 
+ 
+ 	" generate sources for CoInterpreter"
+ 
+ 	| top |
+ 	
+ 	CogRTLOpcodes initialize.
+ 	CogIA32Compiler initialize.
+ 	
+ 	top := FileDirectory default containingDirectory.				
+ 	
+ 	VMMaker
+ 		generate: CoInterpreter
+ 		and: StackToRegisterMappingCogit
+ 		to: (top / 'src') fullName
+ 		platformDir: ( top / 'platforms') fullName
+ 		excluding:#(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 					FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin 					ReentrantPPCBEFFIPlugin NewsqueakIA32ABIPlugin
+ 					 NewsqueakIA32ABIPluginAttic).
+ !

Item was added:
+ ----- Method: CMakeGenScripts class>>generateStackMacOS (in category 'as yet unclassified') -----
+ generateStackMacOS
+ 	" generate sources for Stack Interpreter of Mac OS"
+ 	self generateStackSources.
+ 		
+ 	StackMacOSConfig generate.
+ 
+ 	!

Item was added:
+ ----- Method: CMakeGenScripts class>>generateStackSources (in category 'sources generation') -----
+ generateStackSources
+ 	" generate sources for Stack Interpreter of Mac OS"
+ 	| top |
+ 	top := FileDirectory default containingDirectory.
+ 	
+ 	VMMaker
+ 		generate: StackInterpreter
+ 		to: (top / 'src') fullName
+ 		platformDir: ( top / 'platforms') fullName
+ 		excluding: #(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 			FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin).
+ 			
+ 	
+ 
+ 	!

Item was added:
+ ----- Method: CMakeVMGenerator>>setupMacros: (in category 'as yet unclassified') -----
+ setupMacros: gen
+ 	self config cMakeMacros
+ 		ifNotNil: [ :macros | gen puts: macros ]!

Item was added:
+ ----- Method: CPlatformConfig>>cMakeMacros (in category 'accessing') -----
+ cMakeMacros
+ 	^nil	!

Item was added:
+ ----- Method: CPlatformConfig>>generateStackSources (in category 'source generation') -----
+ generateStackSources
+ 	" generate sources for Stack Interpreter"
+ 
+ 	StackInterpreter initialize.
+ 	
+ 	VMMaker
+ 		generate: StackInterpreter
+ 		to: self srcDir fullName
+ 		platformDir: self platformsDir fullName
+ 		excluding: #(BrokenPlugin IA32ABIPluginSimulator SlangTestPlugin TestOSAPlugin
+ 			FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin).!

Item was added:
+ ----- Method: CogMacOSConfig>>generateSourceFiles (in category 'source files') -----
+ generateSourceFiles
+ 
+ 	^ CMakeGenScripts generateCogSources: self!

Item was added:
+ ----- Method: MacOSConfig>>cMakeMacros (in category 'accessing') -----
+ cMakeMacros 
+ 	^'macro(add_framework appname fwname)
+     find_library(FRAMEWORK_${fwname}
+         NAMES ${fwname}
+         PATHS ${CMAKE_OSX_SYSROOT}/System/Library
+         PATH_SUFFIXES Frameworks
+         NO_DEFAULT_PATH)
+     if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND)
+         message(ERROR ": Framework ${fwname} not found")
+     else()
+ 	  include_directories(SYSTEM /System/Library/Frameworks/${fwname}.framework/Headers)
+ 	  target_link_libraries(${appname} ${FRAMEWORK_${fwname}})
+     endif()
+ endmacro(add_framework)'  !

Item was added:
+ CPlatformConfig subclass: #StackEvtAndroidConfig
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Android'!
+ 
+ !StackEvtAndroidConfig commentStamp: 'golubovsky 7/24/2011 22:47' prior: 0!
+ A class to configure the Event-driven Stack Cog for Android. This configuration does not lead to building an executable; rather it prepares the source tree to be plugged into the jni subdirectory of an Android project.!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>compilerFlags (in category 'source generation') -----
+ compilerFlags
+ 	"Compiler flags for Android. Leave empty for now"
+ 	^  ' -DDEBUG=22 '!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configH (in category 'source files') -----
+ configH
+ 	" right now its borrowed directly from unix, but likely will change"
+ 	^ '
+ #ifndef __sq_config_h
+ #define __sq_config_h
+ 
+ /* explicit image width */
+ 
+ #define	HAVE_INTERP_H 1
+ 
+ /* package options */
+ 
+ #define	USE_X11 1
+ #define	USE_X11_GLX 1
+ /* #undef	USE_QUARTZ */
+ /* #undef	USE_QUARTZ_CGL */
+ /* #undef	USE_RFB */
+ 
+ /* libraries */
+ 
+ /* #undef	HAVE_LIBX11 */
+ /* #undef	HAVE_LIBXEXT */
+ #define	HAVE_LIBDL 1
+ /* #undef	HAVE_DYLD */
+ /* #undef	HAVE_LIBFFI */
+ /* #undef	HAVE_ICONV */
+ 
+ /* #undef	USE_AUDIO_NONE */
+ /* #undef	USE_AUDIO_SUN */
+ /* #undef	USE_AUDIO_NAS */
+ /* #undef	USE_AUDIO_OSS */
+ /* #undef	USE_AUDIO_MACOSX */
+ /* #undef	OSS_DEVICE */
+ 
+ /* header files */
+ 
+ #define	HAVE_UNISTD_H 1
+ /* #undef	NEED_GETHOSTNAME_P */
+ 
+ #define	HAVE_DIRENT_H 1
+ /* #undef	HAVE_SYS_NDIR_H */
+ /* #undef	HAVE_SYS_DIR_H */
+ /* #undef	HAVE_NDIR_H */
+ 
+ #define	HAVE_SYS_TIME_H 1
+ #define	TIME_WITH_SYS_TIME 1
+ 
+ /* #undef	HAVE_SYS_FILIO_H */
+ 
+ /* #undef	HAVE_SYS_AUDIOIO_H */
+ /* #undef	HAVE_SUN_AUDIOIO_H */
+ 
+ #define	HAVE_PTY_H 1
+ /* #undef	HAVE_UTIL_H */
+ /* #undef	HAVE_LIBUTIL_H */
+ #define	HAVE_STROPTS_H 1
+ 
+ #define	HAVE_GL_GL_H 1
+ /* #undef	HAVE_OPENGL_GL_H */
+ 
+ /* #undef	NEED_SUNOS_H */
+ 
+ /* system calls/library functions */
+ 
+ #define	AT_EXIT atexit
+ 
+ #define	HAVE_TZSET 1
+ 
+ #define	HAVE_OPENPTY 1
+ /* #undef	HAVE_UNIX98_PTYS */
+ 
+ #define	HAVE_SNPRINTF 1
+ /* #undef	HAVE___SNPRINTF */
+ 
+ #define	HAVE_MMAP 1
+ 
+ /* #undef	HAVE_DYLD */
+ 
+ #define	HAVE_LANGINFO_CODESET 1
+ 
+ #define	HAVE_ALLOCA 1
+ #define	HAVE_ALLOCA_H 1
+ 
+ #define	HAVE_UNSETENV 1
+ 
+ #define	HAVE_NANOSLEEP 1
+ 
+ /* widths of primitive types */
+ 
+ #define	SIZEOF_INT 4
+ #define	SIZEOF_LONG 4
+ #define	SIZEOF_LONG_LONG 8
+ #define	SIZEOF_VOID_P 4
+ 
+ /* structures */
+ 
+ #define	HAVE_TM_GMTOFF 1
+ #define	HAVE_TIMEZONE 1
+ 
+ /* typedefs */
+ 
+ /* #undef	size_t */
+ /* #undef	socklen_t */
+ 
+ #define	squeakInt64 long long
+ 
+ /* architecture */
+ 
+ #define	OS_TYPE "unix"
+ 
+ #define	VM_HOST "i686-pc-linux-gnu"
+ #define	VM_HOST_CPU "i686"
+ /* #undef	VM_HOST_VENDOR */
+ #define	VM_HOST_OS "linux-gnu"
+ #define	VM_BUILD_STRING "Unix built on "__DATE__ " "__TIME__" Compiler: "__VERSION__
+ 
+ /* #undef	WORDS_BIGENDIAN */
+ /* #undef	DOUBLE_WORD_ALIGNMENT */
+ 
+ /* damage containment */
+ 
+ /* #undef	DARWIN */
+ 
+ #ifdef NEED_SUNOS_H
+ # include "sunos.h"
+ #endif
+ 
+ /* other configured variables */
+ 
+ #define SQ_VERSION "3.9a-7024"
+ #define VM_VERSION "3.9-7"
+ #define VM_MODULE_PREFIX ""
+ /* #undef VM_DLSYM_PREFIX */
+ #define VM_X11DIR ""
+ 
+ /* avoid dependencies on glibc2.3 */
+ 
+ #define HAVE_FEATURES_H 1
+ 
+ #if defined(HAVE_FEATURES_H)
+ # include "glibc.h"
+ #endif
+ 
+ 
+ /* used by UUID plugin: */
+ 
+ #define HAVE_UUID_H 1
+ 
+ #endif /* __sq_config_h */
+ 																																																																					
+ 																																																																				'!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureFileCopyPlugin: (in category 'plugin extra rules') -----
+ configureFileCopyPlugin: maker
+ 	"extra rules for DropPlugin"
+ 
+ 	maker addPlatformSources: #( 'sqAndroidFileCopyPlugin.c')
+ !

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureFilePlugin: (in category 'plugin extra rules') -----
+ configureFilePlugin: maker
+ 	"extra rules for FilePlugin"
+ 
+ 	super configureFilePlugin: maker.  
+ 	
+ 	maker addPlatformSources: #( 'sqAndroidFile.c')!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureFloatMathPlugin: (in category 'plugin extra rules') -----
+ configureFloatMathPlugin: maker
+ 	"extra rules for FloatMathPlugin"
+ 
+ 	maker addCrossSources: #(
+ 		'acos.c' 'acosh.c' 'asin.c' 'asinh.c' 'atan.c' 'atan2.c' 'atanh.c'
+ 		'copysign.c' 'cos.c' 'cosh.c' 'exp.c' 'expm1.c' 'finite.c' 'fmod.c'
+ 		'hypot.c' 'isnan.c' 'k_cos.c' 'k_rem_pio2.c' 'k_sin.c' 'k_tan.c' 'ldexp.c'
+ 		'log.c' 'log10.c' 'log1p.c' 'modf.c' 'pow.c' 'rem_pio2.c' 'rint.c'
+ 		'scalb.c' 'scalbn.c' 'sin.c' 'sinh.c' 'sqrt.c' 'tan.c' 'tanh.c' ).
+ 
+ 	
+ 	"according to http://www.netlib.org/fdlibm/readme
+ 	it should be compiled with no optimizations"
+ 	maker addDefinitions: '-O0'.
+ 	
+ 	" compile with -D__LITTLE_ENDIAN
+ 		This macro is set automatically in fdlibm.h when compiled ith -m32 but
+ 		not when compiled with -m64 (Nicolas Cellier)
+ 	"
+ 	self isLittleEndian ifTrue: [
+ 		maker addDefinitions: '-D__LITTLE_ENDIAN=1' ].
+ 
+ 	maker addDefinitions: '-DNO_ISNAN'.
+ 	
+ 
+ !

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureJoystickTabletPlugin: (in category 'plugin extra rules') -----
+ configureJoystickTabletPlugin: maker 
+ 	"extra rules for JoystickTabletPlugin"
+ 	
+ 	super configureJoystickTabletPlugin: maker.  
+ 	maker addPlatformSources:
+ 		#( 'sqAndroidJoystickTablet.c' )
+ !

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureSecurityPlugin: (in category 'plugin extra rules') -----
+ configureSecurityPlugin: maker 
+ 	"extra rules for MIDIPlugin"
+ 
+ 	super configureSecurityPlugin: maker.
+ 	
+ 	maker addPlatformSources: #( 'sqAndroidSecurity.c')!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>configureSocketPlugin: (in category 'plugin extra rules') -----
+ configureSocketPlugin: maker 
+ 	"extra rules for SocketPlugin"
+ 	
+ 	maker addPlatformSources: #( 'sqAndroidSocket.c')!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>coreSources (in category 'source files') -----
+ coreSources
+ 	"files to include from src/vm dir"
+ 	
+ 	^ #(
+ 		'gcc3x-interp.c'
+ 		)!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>crossSources (in category 'source files') -----
+ crossSources 
+ 	^#(
+ 			'sqHeapMap.c'
+ 			'sqNamedPrims.c'
+ 			'sqVirtualMachine.c'
+ 		)!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>defaultExternalPlugins (in category 'plugins') -----
+ defaultExternalPlugins
+ 	^ #(
+ 	)!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>defaultInternalPlugins (in category 'plugins') -----
+ defaultInternalPlugins
+ " took from unixbuild/bld/plugins.int"
+ 	^ #(
+ 		AndroidPlugin
+ 		BitBltSimulation "BitBltPlugin"
+ 		BalloonEnginePlugin "B2DPlugin" 
+ 		BMPReadWriterPlugin 
+ 		CroquetPlugin 
+ 		DSAPlugin "DSAPrims" 
+ 		FFTPlugin 
+ 		FileCopyPlugin 
+ 		FilePlugin 
+ 		FloatArrayPlugin 
+ 		FloatMathPlugin 
+ 		JoystickTabletPlugin 
+ 		JPEGReaderPlugin 
+ 		LargeIntegersPlugin "LargeIntegers"
+ 		Matrix2x3Plugin 
+ 		RePlugin 	
+ 		SecurityPlugin 
+ 		JPEGReadWriter2Plugin 
+ 		SocketPlugin 
+ 		MiscPrimitivePlugin 
+ 		DeflatePlugin  "ZipPlugin"
+ 		)!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>extraVMSettings: (in category 'source generation') -----
+ extraVMSettings: maker
+ 	| versionC |
+ 	self generateConfigH.
+ 	
+ 	"add a generated version.c"
+ 	
+ 	versionC := 'version.c'.
+ 
+ 	maker 
+ 		puts: '$(buildDir)/',versionC, ':' ;
+ 		puts: ({Character tab}, '$(platformsDir)/android/config/verstamp ', '$(buildDir)/', versionC,' gcc');
+ 		puts: {Character cr};
+ 		puts: ('LOCAL_SRC_FILES += $(buildDir)/', versionC);
+ 		puts: {Character cr}.
+ 	.
+ 	!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>fixLineEndsOf: (in category 'utils') -----
+ fixLineEndsOf: string
+ 	^ string copyReplaceAll: String cr with: String lf!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>generate (in category 'source generation') -----
+ generate
+ 	^ CMakeAndroidGenerator generate: self 	
+ 
+ !

Item was added:
+ ----- Method: StackEvtAndroidConfig>>generateConfigH (in category 'source files') -----
+ generateConfigH
+ 	"will fix that later"
+ 	self write: self configH toFile: 'config.h'!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>interpreterClass (in category 'source generation') -----
+ interpreterClass
+ 	^ StackEvtAndroidInterpreter!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>mkFileList:baseDir: (in category 'utils') -----
+ mkFileList: anArray baseDir: aDir
+ 	"answer the concatenated contents of the array interspersed with backslash-newline sequences"
+ 	^ (anArray collect: [ :s | aDir, s]) inject: '' into: [ :s :n | s , #($\), {Character cr}, n ].!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>outputDir (in category 'directories') -----
+ outputDir
+ 
+ 	"the directory where built binaries will be stored - for now it is copied from CogFamilyUnixConfig"
+ 	^ outputDir ifNil: [ outputDir := (self buildDir containingDirectory fullName , '/', self outputDirName) ]
+ 	!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>platformName (in category 'source generation') -----
+ platformName
+ 	^ 'android'!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>platformSources (in category 'source files') -----
+ platformSources
+ 	"files added from platform/android/vm dir "
+ 	^ #(
+ 	'aio.c'
+ 	'debug.c'
+ 	'osExports.c'
+ 	'sqAndroidCharConv.c'
+ 	'sqAndroidExternalPrims.c'
+ 	'sqAndroidEvtBeat.c'
+ 	'sqAndroidEvtMain.c'
+ 	'sqAndroidMemory.c'
+ 	'sqAndroidVMProfile.c'
+ 	'sqAndroidSemaphores.c'
+ 	'sqAndroidSoundNull.c'
+ 	'sqAndroidDisplay.c'
+ 	)!

Item was added:
+ ----- Method: StackEvtAndroidConfig>>prepareForGeneration (in category 'source generation') -----
+ prepareForGeneration
+ 
+ 	"force using LF on Macs"
+ 	CrLfFileStream defaultToLF.
+ 
+ 	^ self prepareForStackVMGeneration
+ !

Item was added:
+ ----- Method: StackEvtAndroidConfig>>setupDirectories: (in category 'directories') -----
+ setupDirectories: gen
+ 	"same logic as the super has, but use gmake syntax instead of cmake"
+ 	| dirsInclude |
+ 
+ 	" write the directories in separate include file"
+ 	dirsInclude := gen captureOutputDuring: [
+ 		gen
+ 			set: #topDir to: ('$(ROOT)/', self topDir fullName); 
+ 			set: #buildDir to: (self buildDir ifNil: ['$(topDir)/build'] ifNotNil: ['$(ROOT)/', self buildDir fullName] );
+ 			set: #platformsDir to: ('$(ROOT)/', self platformsDir);
+ 			set: #srcDir to: ('$(ROOT)/', self srcDir);
+ 			set: #srcPluginsDir to: (pluginsDir ifNil: [ '$(srcDir)/plugins' ]);
+ 			set: #srcVMDir to: '$(srcDir)/vm';
+ 			set: #platformName to: self platformName;
+ 			set: #targetPlatform to: '$(platformsDir)/$(platformName)';
+ 			set: #crossDir to: '$(platformsDir)/Cross';
+ 			set: #platformVMDir to: '$(targetPlatform)/vm'.
+ 	].
+ 
+ 	self write: dirsInclude toFile: 'cogdirs.mk'
+ !

Item was added:
+ CogUnixConfig subclass: #StackEvtUnixConfig
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Unix'!
+ 
+ !StackEvtUnixConfig commentStamp: 'golubovsky 7/7/2011 22:38' prior: 0!
+ This is a concrete class which generates an event-driven StackVM for Unix.
+ 
+ Usage: 
+ StackEvtUnixConfig generateWithSources
+ 
+ An event-driven Stack VM is an experiment to make VM return to the host process each time it asks for an event.
+ If there are events to process, the host resumes VM, otherwise VM does not get control until any event is available.
+ 
+ Fore more information, check the class comments of all the superclasses.
+ !

Item was added:
+ ----- Method: StackEvtUnixConfig>>coreSources (in category 'as yet unclassified') -----
+ coreSources
+ 	"files to include from src/vm dir"
+ 	
+ 	^ #(
+ 		'gcc3x-interp.c'
+ 		)!

Item was added:
+ ----- Method: StackEvtUnixConfig>>crossSources (in category 'as yet unclassified') -----
+ crossSources
+ 	"answer the same set of source files except that sqTicker.c is dropped"
+ 
+   ^ super crossSources select: [ :file | (file = 'sqTicker.c') not ].
+ 
+ !

Item was added:
+ ----- Method: StackEvtUnixConfig>>executableName (in category 'accessing') -----
+ executableName
+ 	"the name of the VM executable"
+ 	^ 'EventVM'.!

Item was added:
+ ----- Method: StackEvtUnixConfig>>interpreterClass (in category 'source generation') -----
+ interpreterClass
+ 	^ StackEvtInterpreter!

Item was added:
+ ----- Method: StackEvtUnixConfig>>platformSources (in category 'as yet unclassified') -----
+ platformSources
+ 	"answer the same set of source files except that sqUnixMain.c is replaced with sqUnixEvtMain.c,
+ 	sqUnixHeartbeat.c is replaced with sqUnixEvtBeat.c"
+ 
+   ^ super platformSources collect: [ :file | (file = 'sqUnixMain.c') 
+ 											ifTrue: 'sqUnixEvtMain.c'  
+ 											ifFalse: [(file = 'sqUnixHeartbeat.c') 
+ 												ifTrue: 'sqUnixEvtBeat.c'
+ 												ifFalse: file]
+ 											].
+ 
+ !

Item was added:
+ ----- Method: StackEvtUnixConfig>>prepareForGeneration (in category 'source generation') -----
+ prepareForGeneration
+ 
+ 	"force using LF on Macs"
+ 	CrLfFileStream defaultToLF.
+ 
+ 	^ self prepareForStackVMGeneration
+ !

Item was added:
+ StackEvtUnixConfig subclass: #StackEvtUnixDebugConfig
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMaker-Unix'!

Item was added:
+ ----- Method: StackEvtUnixDebugConfig>>compilerFlags (in category 'compiler flags') -----
+ compilerFlags
+ 
+ 	^  self commonCompilerFlags, ' ' ,self compilerFlagsDebug!



More information about the Vm-dev mailing list