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

commits at source.squeak.org commits at source.squeak.org
Mon May 26 16:26:25 UTC 2014


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

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

Name: CMakeVMMakerSqueak-tty.22
Author: tty
Time: 26 May 2014, 1:27:42.451 pm
UUID: 0a52c2a6-81a2-457d-b772-79c599312bea
Ancestors: CMakeVMMakerSqueak-tty.21

Added CMakeVMMakerSqueak-libs tree covering ssl and freetype for SqueakCogMTWindowsConfig.

Observed thirdParty CMakeLists.txt was generated for both.

I cannot test this build on linux.

=============== Diff against CMakeVMMakerSqueak-tty.21 ===============

Item was changed:
  SystemOrganization addCategory: #CMakeVMMakerSqueak!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-Tests'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-Unix'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-Android'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-SunOS'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-FreeBSD'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-Builder'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-MacOS'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-IOS'!
  SystemOrganization addCategory: #'CMakeVMMakerSqueak-Windows'!
+ SystemOrganization addCategory: #'CMakeVMMakerSqueak-Libs'!

Item was added:
+ SqueakCMThirdpartyLibrary subclass: #SqueakCMFreetype2
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Libs'!
+ 
+ !SqueakCMFreetype2 commentStamp: '<historical>' prior: 0!
+ This is a configuration for building freetype2 library!

Item was added:
+ ----- Method: SqueakCMFreetype2 class>>canonicalName (in category 'accessing') -----
+ canonicalName
+ 	^ 'freetype2'!

Item was added:
+ ----- Method: SqueakCMFreetype2>>archiveMD5Sum (in category 'package properties') -----
+ archiveMD5Sum
+ 
+ 	^ 'c15f6dc8ed190d67b89ae09aaf7896b4'!

Item was added:
+ ----- Method: SqueakCMFreetype2>>build (in category 'generating actions') -----
+ build
+ 
+ 	gen 
+ 		puts:
+ '
+ add_custom_command(OUTPUT "${ft2config}"
+ 	COMMAND ./configure --prefix=''${installPrefix}'' ', self configurationFlags, '
+ 	WORKING_DIRECTORY "${libSourcesDir}"
+ 	DEPENDS "${unpackTarget}"
+ )
+ add_custom_command(OUTPUT "${ft2libInstalled}"
+ 	COMMAND make
+ 	COMMAND make install
+ 	WORKING_DIRECTORY "${libSourcesDir}"
+ 	DEPENDS "${ft2config}"
+ 	COMMENT "Building ${libName}"
+ )
+ '
+ !

Item was added:
+ ----- Method: SqueakCMFreetype2>>copyArtefacts (in category 'generating actions') -----
+ copyArtefacts
+ 
+ 	self 
+ 		copy: '${ft2libInstalled}' 
+ 		to: '${externalModulesDir}/${libraryFileName}'.!

Item was added:
+ ----- Method: SqueakCMFreetype2>>defineAsTarget (in category 'generating actions') -----
+ defineAsTarget
+ 
+ 	gen puts:
+ 	
+ '
+ add_custom_target(${libName} 
+ 	DEPENDS ${externalModulesDir}/${libraryFileName}
+ 	)
+ '
+ 
+ !

Item was added:
+ ----- Method: SqueakCMFreetype2>>defineGlobalTargets (in category 'generating actions') -----
+ defineGlobalTargets
+ 	| var |
+ 	var := self canonicalName , '_LIB'.
+ 	vmGen set: var toString: self targetForLinking.
+ "
+ define a library as imported one
+ and make it depend from it's build target
+ "
+ 	vmGen
+ 		puts: 
+ ('add_library("{1}" SHARED IMPORTED GLOBAL)
+ 	set_target_properties("{1}" PROPERTIES IMPORTED_LOCATION "{1}")
+ add_dependencies("{1}" "{2}")
+ ' format: { '${',var, '}' . self buildTarget }
+ ).
+ 
+ 	vmGen cmd: 'add_dependencies' params:
+ 		vmGen moduleName , ' ' , self buildTarget!

Item was added:
+ ----- Method: SqueakCMFreetype2>>downloadURL (in category 'package properties') -----
+ downloadURL
+ 	^ 'http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.4.9.tar.gz'
+ !

Item was added:
+ ----- Method: SqueakCMFreetype2>>includeDir (in category 'accessing') -----
+ includeDir
+ 	"see setVariables"
+ 
+ " `<prefix>/include/freetype2' must be in your current inclusion path "
+ 
+ 
+ 	^ '"${thirdpartyDir}/out/include" "${thirdpartyDir}/out/include/freetype2"'!

Item was added:
+ ----- Method: SqueakCMFreetype2>>libraryFileName (in category 'package properties') -----
+ libraryFileName
+ 	^ 'libfreetype.6.dylib'!

Item was added:
+ ----- Method: SqueakCMFreetype2>>setVariables (in category 'generating actions') -----
+ setVariables
+ 	super setVariables.
+ 	
+ "add include path"
+ 	gen 
+ 		set: #freetype2_includeDir toString: '${installPrefix}/include';
+ 		set: #libraryFileName to: self libraryFileName;
+ 		set: #freetype2_location toString: '${externalModulesDir}/${libraryFileName}';
+ 		set: #ft2config toString: '${libSourcesDir}/builds/unix/config.status';
+ 	 	set: #ft2libInstalled toString: '${installPrefix}/lib/${libraryFileName}'!

Item was added:
+ ----- Method: SqueakCMFreetype2>>unpackedDirName (in category 'package properties') -----
+ unpackedDirName
+ 
+ 	^ 'freetype-2.4.9'!

Item was added:
+ SqueakCMThirdpartyLibrary subclass: #SqueakCMOpenSSL
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Libs'!

Item was added:
+ ----- Method: SqueakCMOpenSSL class>>canonicalName (in category 'as yet unclassified') -----
+ canonicalName
+ 	^ 'openssl'!

Item was added:
+ CMThirdpartyLibrary subclass: #SqueakCMThirdpartyLibrary
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Libs'!
+ 
+ !SqueakCMThirdpartyLibrary commentStamp: 'tty 5/26/2014 12:51' prior: 0!
+ A SqueakCMThirdpartyLibrary is the root library for copies of classes in CMakeVMMaker-Libs.  
+ I replace only the Squeak incompatible methods of my parent
+ 
+ !

Item was added:
+ ----- Method: SqueakCMThirdpartyLibrary class>>canonicalName (in category 'as yet unclassified') -----
+ canonicalName
+ 	"answer the library canonical name, like 
+ 		'freetype2'
+ 		or 'cairo' 
+ 		etc.
+ 		
+ 	Note , this method is used to find the corresponding library
+ 	from all subclasses of CMThirdpartyLibrary	
+ 	"
+ 	^ self subclassResponsibility!

Item was added:
+ ----- Method: SqueakCMThirdpartyLibrary class>>named:config: (in category 'as yet unclassified') -----
+ named: aName config: aCPlatformConfig
+ 
+ 	^ (self allSubclasses detect: [:cls | 
+ 		cls canonicalName = aName and: [ cls supports: aCPlatformConfig ] ])
+ 		new!

Item was added:
+ ----- Method: SqueakCMThirdpartyLibrary class>>platformName (in category 'as yet unclassified') -----
+ platformName 
+ 	^nil!

Item was added:
+ ----- Method: SqueakCMThirdpartyLibrary class>>supports: (in category 'as yet unclassified') -----
+ supports: aConfig
+ 	"default implementation"
+ 	^ self platformName = aConfig platformName !

Item was added:
+ ----- Method: SqueakCMThirdpartyLibrary>>generateFor: (in category 'as yet unclassified') -----
+ generateFor: aVMGenerator
+ 
+ 	| libDir stream contents |
+ 	
+ 	vmGen := aVMGenerator.
+ 	
+ 	gen := CMakeGenerator new
+ 		output: (String new writeStream).
+ 	
+ 	libDir := (aVMGenerator thirdpartyDir / self canonicalName) assureExistence.
+ 
+ 	stream := String new writeStream.
+ 	
+ 	self generate.
+ 
+ 	stream nextPutAll: (vmGen config fixLineEndsOf: gen output contents).
+ 
+ 	contents := stream contents. 
+ 	
+ 	(self isFile: (libDir  / gen outputFileName) fullName hasContents: contents) ifFalse: [
+ 		"contents changed, update the file. Because fucking cmake will force rebuild everything if we change its modification date
+ 		without changing its contents"
+ 		(FileStream forceNewFileNamed: (libDir  / gen outputFileName) pathName) nextPutAll: contents; close.
+ 		].
+ 	
+ 
+ 	vmGen addSubdirectory:  vmGen thirdpartyDirName , '/' , self canonicalName.
+ 	self defineGlobalTargets.
+ 	!

Item was added:
+ SqueakCMFreetype2 subclass: #SqueakCMWin32Freetype2
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Libs'!
+ 
+ !SqueakCMWin32Freetype2 commentStamp: '<historical>' prior: 0!
+ Some overrides to make freetype build on windows:
+ 
+ Two artifacts to copy:
+ 
+ libfreetype.dll.a
+ libfreetype-6.dll
+ 
+ the first one is used at link time with FTPlugin to 
+ designate the exported symbols of .dll as well as .dll file name.
+ 
+ The second one is ready to use library produced by freetype makefiles.
+ 
+ We pass
+ 
+  -march=i686
+ 
+ instead of
+ 
+  -arch i386
+ 
+ to freetype configure, because MSYS GCC on windows don't understands the -arch option.
+ !

Item was added:
+ ----- Method: SqueakCMWin32Freetype2 class>>platformName (in category 'as yet unclassified') -----
+ platformName 
+ 	^'win32'!

Item was added:
+ ----- Method: SqueakCMWin32Freetype2>>copyArtefacts (in category 'generating actions') -----
+ copyArtefacts
+ 
+ 	gen puts:
+ 'add_custom_command(
+ 	OUTPUT "${externalModulesDir}/${libraryFileName}"
+ 	COMMAND cp "${ft2libInstalled}" "${externalModulesDir}"
+ 	COMMAND cp "${ft2binInstalled}" "${externalModulesDir}"
+ 	DEPENDS "${ft2libInstalled}"
+ )'!

Item was added:
+ ----- Method: SqueakCMWin32Freetype2>>defaultConfigurationFlags (in category 'settings') -----
+ defaultConfigurationFlags 
+ 	^#(
+ 		'CFLAGS=''-march=i686''' 
+ 		'LDFLAGS=''-march=i686''')!

Item was added:
+ ----- Method: SqueakCMWin32Freetype2>>defineGlobalTargets (in category 'generating actions') -----
+ defineGlobalTargets
+ 	| var |
+ 	var := self canonicalName , '_LIB'.
+ 	vmGen set: var toString: self targetForLinking.
+ "
+ define a library as imported one
+ and make it depend from it's build target
+ "
+ 	vmGen
+ 		puts: 
+ ('add_library("{1}" STATIC IMPORTED GLOBAL)
+ 	set_target_properties("{1}" PROPERTIES IMPORTED_LOCATION "{1}")
+ add_dependencies("{1}" "{2}")
+ ' format: { '${',var, '}' . self buildTarget }
+ ).
+ 
+ 	vmGen cmd: 'add_dependencies' params:
+ 		vmGen moduleName , ' ' , self buildTarget!

Item was added:
+ ----- Method: SqueakCMWin32Freetype2>>libraryFileName (in category 'package properties') -----
+ libraryFileName
+ 	^ 'libfreetype.dll.a'!

Item was added:
+ ----- Method: SqueakCMWin32Freetype2>>setVariables (in category 'generating actions') -----
+ setVariables
+ 	super setVariables.
+ 	
+ "add include path"
+ 	gen 
+ 		set: #freetype2_includeDir toString: '${installPrefix}/include';
+ 		set: #libraryFileName to: self libraryFileName;
+ 		set: #freetype2_location toString: '${externalModulesDir}/${libraryFileName}';
+ 		set: #ft2config toString: '${libSourcesDir}/builds/unix/config.status';
+ 	 	set: #ft2libInstalled toString: '${installPrefix}/lib/${libraryFileName}';
+ 	 	set: #ft2binInstalled toString: '${installPrefix}/bin/libfreetype-6.dll'.
+ 		!

Item was added:
+ SqueakCMOpenSSL subclass: #SqueakCMWin32OpenSSL
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Libs'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL class>>platformName (in category 'as yet unclassified') -----
+ platformName 
+ 	^'win32'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>archiveMD5Sum (in category 'as yet unclassified') -----
+ archiveMD5Sum
+ 	"answer the MD5 checksum (in string) for downloaded library archive 
+ 	(to check that downloaded file is not corrupt).
+ 	
+ 	You can take this sum by issuing:
+ 	  md5 filename
+ 	from command line
+ 	"
+ 	^ 'ae412727c8c15b67880aef7bd2999b2e'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>build (in category 'as yet unclassified') -----
+ build
+ 
+ 	gen 
+ 		puts:
+ '
+ add_custom_command(OUTPUT "${libSourcesDir}/Makefile"
+ 	COMMAND ./config shared --prefix=''${installPrefix}'' 
+ 	WORKING_DIRECTORY "${libSourcesDir}"
+ 	DEPENDS "${unpackTarget}"
+ )
+ 
+ add_custom_command(OUTPUT "${installPrefix}/bin/libeay32.dll" "${installPrefix}/bin/ssleay32.dll"
+ 	COMMAND make
+ 	COMMAND make install
+ 	WORKING_DIRECTORY "${libSourcesDir}"
+ 	DEPENDS "${libSourcesDir}/Makefile"
+ 	COMMENT "Building ${libName}"
+ )
+ '
+ !

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>configurationFlags (in category 'as yet unclassified') -----
+ configurationFlags
+ 	^ 'shared'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>copyArtefacts (in category 'as yet unclassified') -----
+ copyArtefacts 
+ 
+ 	self copy: '${installPrefix}/bin/libeay32.dll' to: '${externalModulesDir}/libeay32.dll'.
+ 	self copy: '${installPrefix}/bin/ssleay32.dll' to: '${externalModulesDir}/ssleay32.dll'.
+ "	self copy: '${installPrefix}/lib/libssl.dll.a' to: '${externalModulesDir}/libssl.dll.a'.
+ 	self copy: '${installPrefix}/lib/libcrypto.dll.a' to: '${externalModulesDir}/libcrypto.dll.a'.
+ "
+ "
+ 'libcrypto.dll.a' 'libssl.dll.a'.
+ "!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>defineAsTarget (in category 'as yet unclassified') -----
+ defineAsTarget 
+ 	
+ 	gen puts:
+ 	'add_custom_target(', self buildTarget , '
+ 		DEPENDS 
+ 		"${externalModulesDir}/libeay32.dll"
+ 		"${externalModulesDir}/ssleay32.dll"
+ 	)'
+ 	
+ 		"${externalModulesDir}/${libraryFileName}"
+ !

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>defineGlobalTargets (in category 'as yet unclassified') -----
+ defineGlobalTargets 
+ 
+ !

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>downloadURL (in category 'as yet unclassified') -----
+ downloadURL 
+ 	^'http://www.openssl.org/source/openssl-1.0.1c.tar.gz'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>includeDir (in category 'as yet unclassified') -----
+ includeDir
+ 
+ 	^ '"${thirdpartyDir}/out/include"'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>libraryFileName (in category 'as yet unclassified') -----
+ libraryFileName
+ 	^ 'libssl.dll.a'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>setVariables (in category 'as yet unclassified') -----
+ setVariables 
+ 	super setVariables.
+ 	
+ 	gen
+ 		set: #libraryFileName to: self libraryFileName;
+ 		set: #libInstalled to: '${installPrefix}/lib/${libraryFileName}'!

Item was added:
+ ----- Method: SqueakCMWin32OpenSSL>>unpackedDirName (in category 'as yet unclassified') -----
+ unpackedDirName
+ 	^ 'openssl-1.0.1c'!

Item was added:
+ ----- Method: SqueakCogFamilyWindowsConfig>>addThirdpartyLibrary: (in category 'as yet unclassified') -----
+ addThirdpartyLibrary: libName
+ 	| libs lib |
+ 	
+ 	libs := self thirdpartyLibs.
+ 	
+ 	lib :=  libs 
+ 		detect: [:each | each canonicalName = libName ] 
+ 		ifNone: [ nil ].
+ 		
+ 	lib ifNil: [ 
+ 		lib := SqueakCMThirdpartyLibrary named: libName config: self.
+ 		"add dependencies first, so thirpartyLibs collection will be naturally dependency sorted"
+ 		lib dependencies do: [:dep | self addThirdpartyLibrary: dep ].
+ 		libs add: lib ].
+ 
+ 	^ lib!



More information about the Vm-dev mailing list