Esteban Lorenzano uploaded a new version of CMakeVMMaker to project VM Maker: http://source.squeak.org/VMMaker/CMakeVMMaker-EstebanLorenzano.173.mcz
==================== Summary ====================
Name: CMakeVMMaker-EstebanLorenzano.173 Author: EstebanLorenzano Time: 1 August 2012, 11:46:02.715 am UUID: f53e0e46-a3e3-4f7e-8dea-00f099de9a0a Ancestors: CMakeVMMaker-IgorStasenko.172
fixes for compiling freetype on iOS
=============== Diff against CMakeVMMaker-IgorStasenko.172 ===============
Item was changed: ----- Method: CMFreetype2>>build (in category 'generating actions') ----- build + gen puts: ' add_custom_command(OUTPUT "${ft2config}" + COMMAND ./configure --prefix=''${installPrefix}'' ', self configurationFlags, ' - COMMAND ./configure --prefix=''${installPrefix}'' CFLAGS=''-arch i386'' LDFLAGS=''-arch i386'' 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 changed: + ----- Method: CMFreetype2>>includeDir (in category 'accessing') ----- - ----- Method: CMFreetype2>>includeDir (in category 'as yet unclassified') ----- includeDir "see setVariables"
" `<prefix>/include/freetype2' must be in your current inclusion path "
^ '"${thirdpartyDir}/out/include" "${thirdpartyDir}/out/include/freetype2"'!
Item was changed: Object subclass: #CMThirdpartyLibrary + instanceVariableNames: 'gen vmGen configurationFlags' - instanceVariableNames: 'gen vmGen' classVariableNames: '' poolDictionaries: '' category: 'CMakeVMMaker-Libs'!
!CMThirdpartyLibrary commentStamp: 'IgorStasenko 6/7/2012 04:53' prior: 0! My subclasses describing a configuration/settings necessary to build some third-party library used by VM or by one of it's plugins.
We cannot use cmake configuration for those libraries, since most of them having own configuration/make scripts which build that library.
I serve as a convenience layer for building those libraries and connecting them with cmake configuration, as well as provide necessary information, what output file(s) should be bundled with virtual machine. !
Item was added: + ----- Method: CMThirdpartyLibrary>>configurationFlags (in category 'settings') ----- + configurationFlags + ^(configurationFlags + ifNil: [ self defaultConfigurationFlags ]) + reduce: [ :a :b | a, ' ', b]!
Item was added: + ----- Method: CMThirdpartyLibrary>>configurationFlags: (in category 'settings') ----- + configurationFlags: aCollection + configurationFlags := aCollection + !
Item was added: + ----- Method: CMThirdpartyLibrary>>defaultConfigurationFlags (in category 'settings') ----- + defaultConfigurationFlags + ^#( + 'CFLAGS=''-arch i386''' + 'LDFLAGS=''-arch i386''')!
Item was changed: ----- Method: CogFamilyCocoaIOSConfig>>setGlobalOptions: (in category 'settings') ----- 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++'. - maker set: 'CMAKE_C_COMPILER' to: '/usr/bin/gcc-4.2'. - maker set: 'CMAKE_CXX_COMPILER' to: '/usr/bin/g++-4.2'. maker set: 'CMAKE_OSX_ARCHITECTURES' to: 'i386'. maker set: 'CMAKE_OSX_SYSROOT' to: '/'. " maker set: 'CMAKE_OSX_SYSROOT' to: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk'"!
Item was changed: ----- Method: StackIPhoneConfig>>commonCompilerFlags (in category 'settings') ----- commonCompilerFlags "Common compiler flags" ^{ "'-miphoneos-version-min=4.3'. " '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS', self sdkVersion, '.sdk'. '-x objective-c'. '-std=gnu99'. '-falign-functions=16'. '-fno-gcse'. '-fno-cse-follow-jumps'. '-fvisibility=hidden'. '-funroll-loops'. '-finline-functions'. '-mno-thumb'. '-fwrapv'. '-DSTACKVM=1'. '-DCOGMTVM=0'. '-DUSE_GLOBAL_STRUCT=0'. '-DBASE_HEADER_SIZE=4'. '-DTARGET_OS_IS_IPHONE'. '-DHAVE_UUID_GENERATE'. "'-DUSE_INLINE_MEMORY_ACCESSORS'. " '-DHAVE_SYS_TIME_H'. '-DLSB_FIRST'. '-DHAVE_NANOSLEEP'. '-DISQUEAK_IMAGE=', self imageName. '-DISQUEAK_SOURCES=PharoV10'}!
Item was added: + ----- Method: StackIPhoneConfig>>configureFT2Plugin: (in category 'plugin extra rules') ----- + configureFT2Plugin: maker + "extra rules for Freetype plugin. + a custom rule to build freetype library" + | lib devRoot sdkRoot | + + maker isExternal + ifFalse: [ self error: 'building internal FT2Plugin is not supported yet' ]. + + devRoot := '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'. + sdkRoot := '{devRoot}/SDKs/iPhoneOS{sdkVersion}.sdk' + nameFormat: {'devRoot'->devRoot. 'sdkVersion'->self sdkVersion} asDictionary. + + "add freetype library into loop" + lib := self addThirdpartyLibrary: 'freetype2'. + lib configurationFlags: ({ + '--host=arm-apple-darwin'. + '--enable-static=yes'. + '--enable-shared=yes'. + 'CC={devRoot}/usr/bin/gcc'. + 'CXX={devRoot}/usr/bin/g++'. + "'AR={devRoot}/usr/bin/ld'." + 'CFLAGS=\"-arch armv6 -std=c99 -Wno-trigraphs -O2 -fwrapv -Wreturn-type -Wunused-variable -fmessage-length=0 -miphoneos-version-min=4.0 -I{sdkRoot}/usr/include/libxml2 -isysroot {sdkRoot}\"'. + 'LDFLAGS=\"-arch armv6 -isysroot {sdkRoot}\"'} + collect: [ :each | each nameFormat: {'sdkRoot'->sdkRoot. 'devRoot'->devRoot} asDictionary ]). + + "maker set: 'XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR' toString: ''." + + "link plugin with freetype lib" + maker addExternalLibrary: lib targetForLinking. + maker includeDirectories: lib includeDir. + !
Item was changed: ----- Method: StackIPhoneConfig>>platformSources (in category 'source files') ----- platformSources "files added from platform/iOS/vm dir " ^ #( 'Common/main.m' '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/sqSqueakMainApplication.m' 'Common/Classes/sqSqueakMainApplication+attributes.m' 'Common/Classes/sqSqueakMainApplication+events.m' 'Common/Classes/sqSqueakMainApplication+imageReadWrite.m' 'Common/Classes/sqSqueakMainApplication+sound.m' 'Common/Classes/sqSqueakMainApplication+vmAndImagePath.m' 'Common/Classes/sqSqueakMainApplication+screen.m' 'Common/Classes/sqSqueakMainApplication+cursor.m' "'Common/Classes/sqSqueakCursorAPI.m'" 'Common/Classes/sqSqueakAttributesAPI.m' 'Common/Classes/sqSqueakSoundAPI.m' 'Common/Classes/sqSqueakVmAndImagePathAPI.m' 'Common/Classes/sqSqueakMainApp.m' 'Common/Classes/sqSqueakEventsAPI.m' 'Common/Classes/sqSqueakScreenAPI.m' 'Common/Classes/sqSqueakScreenAndWindow.m' 'iPhone/Classes/SqueakNoOGLIPhoneAppDelegate.m' 'iPhone/Classes/sqSqueakIPhoneApplication.m' 'iPhone/Classes/sqSqueakIPhoneApplication+attributes.m' 'iPhone/Classes/sqSqueakIPhoneApplication+clipboard.m' 'iPhone/Classes/sqSqueakIPhoneApplication+imageReadWrite.m' 'iPhone/Classes/sqSqueakIPhoneApplication+events.m' 'iPhone/Classes/sqSqueakIPhoneApplication+Network.m' 'iPhone/Classes/sqSqueakiPhoneApplication+sound.m' 'iPhone/Classes/sqSqueakIPhoneFileDirectoryInterface.m' 'iPhone/Classes/sqSqueakIPhoneInfoPlistInterface.m' 'iPhone/Classes/sqiPhoneScreenAndWindow.m' 'iPhone/Classes/SqueakUIView.m' 'iPhone/Classes/SqueakUIViewCALayer.m' 'iPhone/Classes/SqueakUIViewOpenGL.m' 'iPhone/Classes/SqueakUIController.m' 'iPhone/Classes/sqSqueakIPhoneClipboardAPI.m' 'iPhone/macintoshextra.c' 'iPhone/osExports.c' "'iPhone/sqDummyaio.c'" "I'm using real aio.c from unix (and seems to work)" 'iPhone/sqMacV2Memory.c' + 'iPhone/sqMacUnixExternalPrims.m' )!
Item was changed: ----- Method: StackIPhoneConfig>>setCommonProperties: (in category 'settings') ----- setCommonProperties: maker maker set: 'CMAKE_CROSSCOMPILING' to: 'TRUE'. maker set: 'CMAKE_SYSTEM_NAME' to: 'Darwin'. maker set: 'CMAKE_SYSTEM_PROCESSOR' to: 'arm'.
maker set: 'SDKVER' toString: self sdkVersion. maker set: 'DEVROOT' toString: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'. maker set: 'SDKROOT' toString: '${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk'.
maker set: 'CMAKE_OSX_SYSROOT' to: 'iphoneos${SDKVER}'. - maker set: 'CMAKE_C_COMPILER' to: '${DEVROOT}/usr/bin/llvm-gcc'. - maker set: 'CMAKE_CXX_COMPILER' to: '${DEVROOT}/usr/bin/llvm-g++'. - maker set: 'CMAKE_FIND_ROOT_PATH' to: '"${SDKROOT}" "${DEVROOT}"'. maker set: 'CMAKE_FIND_ROOT_PATH_MODE_PROGRAM' to: 'ONLY'. maker set: 'CMAKE_FIND_ROOT_PATH_MODE_LIBRARY' to: 'ONLY'. maker set: 'CMAKE_FIND_ROOT_PATH_MODE_INCLUDE' to: 'ONLY'. + maker set: 'CMAKE_EXE_LINKER_FLAGS' toString: '--sysroot ${SDKROOT} -L${SDKROOT}/usr/lib -L${SDKROOT}/usr/lib/system'. + maker set: 'CMAKE_C_FLAGS' toString: '--sysroot ${SDKROOT} -L${SDKROOT}/usr/lib -L${SDKROOT}/usr/lib/system'. + maker set: 'CMAKE_CXX_FLAGS' toString: '--sysroot ${SDKROOT} -L${SDKROOT}/usr/lib -L${SDKROOT}/usr/lib/system'. - maker set: 'CMAKE_EXE_LINKER_FLAGS' toString: '-L${SDKROOT}/usr/lib -L${SDKROOT}/usr/lib/system'.
maker addFrameworks: self frameworks.!
Item was added: + ----- Method: StackIPhoneConfig>>setGlobalOptions: (in category 'settings') ----- + setGlobalOptions: maker + "set any CMake global options, before declaring a project in cmake file" + + maker + set: 'CMAKE_C_COMPILER' + to: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc'. + maker + set: 'CMAKE_CXX_COMPILER' + to: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++'. + maker set: 'CMAKE_OSX_ARCHITECTURES' to: 'arm6'. + maker set: 'CMAKE_OSX_SYSROOT' to: '/'. + !
Item was added: + ----- Method: String>>nameFormat: (in category '*cmakevmmaker-extensions') ----- + nameFormat: aDictionary + "format the receiver with aDictionary + + simplest example: + 'foo {name} bar' format: {'name'->value}. + " + | result stream | + result := String new writeStream. + stream := self readStream. + + [stream atEnd] + whileFalse: [| currentChar | + currentChar := stream next. + currentChar == ${ + ifTrue: [| expression | + expression := self getEnclosedExpressionFrom: stream. + result nextPutAll: (aDictionary at: expression ifAbsent: [ 'UNDEFINED' ]) asString ] + ifFalse: [ + currentChar == $\ + ifTrue: [ + stream atEnd + ifFalse: [result nextPut: stream next]] + ifFalse: [result nextPut: currentChar]]]. + + ^ result contents!
vm-dev@lists.squeakfoundation.org