VM Maker: VMMaker-dtl.258.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker-dtl.258.mcz

commits-2
 
David T. Lewis uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-dtl.258.mcz

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

Name: VMMaker-dtl.258
Author: dtl
Time: 21 November 2011, 10:43:11.493 pm
UUID: 7715470a-f07b-4d76-a8fe-58b5cf814e44
Ancestors: VMMaker-dtl.257

VMMaker 4.7.15

Eliminate use of deprecated CrLfFileStream as per oscog

=============== Diff against VMMaker-dtl.257 ===============

Item was changed:
  ----- Method: RiscOSVMMaker>>export:forExternalPlugin: (in category 'generate sources') -----
  export: exportList forExternalPlugin: aPlugin
  "it may be useful on certain platforms to do something with the export list of external plugins, just as the internal plugins' exports get added to the VM list. Default is to do nothing though."
  "For RiscOS using the 'rink' external linker each plugin needs a 'dsc' file that looks like
  id:SqueakSO
  main_version:100
  code_version:001
 
  entries:
  //
  named_entries:
  getModuleName
  //
  with all the exported names in the list. We also need a '/o' directory for the object files"
 
  "open a file called plugindir/pluginname.dsc and write into it"
  | f fd dfd |
  fd := self externalPluginsDirectoryFor: aPlugin.
 
  "If we get an error to do with opening the .dsc file, we need to raise an application error to suit"
  [(fd directoryExists: 'dsc') ifFalse:[fd createDirectory: 'dsc'].
  dfd := fd directoryNamed: 'dsc'.
+ f := VMMaker forceNewFileNamed: (dfd fullNameFor: aPlugin moduleName)] on: FileStreamException do:[^self couldNotOpenFile: (dfd fullNameFor: aPlugin moduleName)].
- f := CrLfFileStream forceNewFileNamed: (dfd fullNameFor: aPlugin moduleName)] on: FileStreamException do:[^self couldNotOpenFile: (dfd fullNameFor: aPlugin moduleName)].
 
  f nextPutAll: 'id:SqueakSO
  main_version:100
  code_version:001
 
  entries:
  //
  named_entries:
  '.
  exportList do:[:el|
  f nextPutAll: el.
  f cr].
  f nextPutAll: '//'; cr.
  f close.
  (fd directoryNamed: 'o') assureExistence
  !

Item was added:
+ ----- Method: VMMaker class>>forceNewFileNamed: (in category 'utilities') -----
+ forceNewFileNamed: aFilename
+ "Always output files in unix lf format.
+ A single format is friendlier to e.g. external version control systems.
+ The Microsoft and old MacOS classic C compilers all accept lf format files."
+
+ ^(MultiByteFileStream forceNewFileNamed: aFilename)
+ lineEndConvention: #lf;
+ yourself!

Item was changed:
  ----- Method: VMMaker class>>versionString (in category 'version testing') -----
  versionString
 
  "VMMaker versionString"
 
+ ^'4.7.15'!
- ^'4.7.14'!

Item was changed:
  ----- Method: VMMaker>>saveConfigurationTo: (in category 'objects from disk') -----
  saveConfigurationTo: aFile
  "Write info about the current configuration to a file.
  Use a hack CrForSpaceWriteStream so that things
  appear on separate lines to be friendly to configuration
  management systems diffing facilities."
  | stream |
  stream := CrForSpaceWriteStream on: String new.
  self configurationInfo storeOn: stream.
+ (MultiByteFileStream newFileNamed: aFile)
+ lineEndConvention: #lf;
- (CrLfFileStream newFileNamed: aFile)
  nextPutAll: stream contents;
  close!

Item was changed:
  ----- Method: VMMaker>>storeExportsOn: (in category 'exports') -----
  storeExportsOn: aFilename
  "Store the exports on the given file"
  | s |
+ [s := VMMaker forceNewFileNamed: aFilename]
- [s := CrLfFileStream forceNewFileNamed: aFilename]
  on: FileDoesNotExistException
  do:[^self couldNotOpenFile: aFilename].
  s nextPutAll: '/* '.
  s nextPutAll: VMMaker headerNotice.
  s nextPutAll: ' */'; cr.
  s nextPutAll:'/* This is an automatically generated table of all builtin modules in the VM */'; cr.
  s cr; nextPutAll:'extern sqExport vm_exports[];'.
  s cr; nextPutAll: 'extern sqExport os_exports[];'.
  self internalPluginsDo:[:cls|
  s cr; nextPutAll: 'extern sqExport '; nextPutAll: cls moduleName; nextPutAll:'_exports[];'.
  ].
  s cr.
 
  s cr; nextPutAll:'sqExport *pluginExports[] = {'.
  s crtab; nextPutAll:'vm_exports,'.
  s crtab; nextPutAll: 'os_exports,'.
  self internalPluginsDo:[:cls|
  s crtab; nextPutAll: cls moduleName; nextPutAll:'_exports,'
  ].
  s crtab; nextPutAll:'NULL'.
  s cr; nextPutAll:'};'; cr.
  s close!

Item was changed:
  ----- Method: VMMaker>>storeExternalPluginList (in category 'exports') -----
  storeExternalPluginList
  | s fileName |
  fileName := self makefileDirectory fullNameFor: 'plugins.ext'.
+ [s := VMMaker forceNewFileNamed: fileName]
- [s := CrLfFileStream forceNewFileNamed: fileName]
  on: FileDoesNotExistException
  do:[^self couldNotOpenFile: fileName].
  s nextPutAll:'# Automatically generated makefile include for external plugins'.
  s cr; nextPutAll:'EXTERNAL_PLUGINS ='.
  self externalPluginsDo:[:cls|
  s space; nextPutAll: cls moduleName.
  ].
  s cr; close!

Item was changed:
  ----- Method: VMMaker>>storeInternalPluginList (in category 'exports') -----
  storeInternalPluginList
  | s fileName |
  fileName := self makefileDirectory fullNameFor: 'plugins.int'.
+ [s := VMMaker forceNewFileNamed: fileName]
- [s := CrLfFileStream forceNewFileNamed: fileName]
  on: FileDoesNotExistException
  do:[^self couldNotOpenFile: fileName].
  s nextPutAll:'# Automatically generated makefile include for internal plugins'.
  s cr; nextPutAll:'INTERNAL_PLUGINS ='.
  self internalPluginsDo:[:cls|
  s space; nextPutAll: cls moduleName.
  ].
  s cr; close!