MediaWiki:Blockiptext

From askoh.net wiki

Jump to: navigation, search

Contents

VS SqueakVM 3.9 (2)

Project Squeak

  • Open VS, I'm using VC 2008 Express, choose Empty Project, create new project named Squeak. Set Location to your working directory eg, "C:\VSSqueakVM".
  • Under Tools -> Options -> Projects and Solutions -> VC++ Directories, make sure to select Include files at Show directories for:, add in the following:
    • $(SolutionDir)\winbuild\src\vm
    • $(SolutionDir)\src\vm
    • $(SolutionDir)\platforms\win32\vm
    • $(SolutionDir)\platforms\Cross\vm
  • Extract SqueakVM-Win32-3.9.2-src into working directory. you will have two folders in the directory, platform and winbuild, along with project Squeak.
  • Right-click on Squeak, choose Add -> Existing Item.... Repeat this step, add these files to the project.
    • C:\VSSqueakVM\winbuild\src\vm : interp.h sqNamedPrims.h interp.c
    • C:\VSSqueakVM\platforms\Cross\vm : sq.h sqNamedPrims.c sqVirtualMachine.c
    • C:\VSSqueakVM\platforms\win32\vm : sqConfig.h sqWin32.h sqWin32Prefs.h version.h sqWin32Alloc.c sqWin32Args.c sqWin32Directory.c sqWin32Exports.c sqWin32ExternalPrims.c sqWin32Intel.c sqWin32PluginSupport.c sqWin32Prefs.c sqWin32Service.c sqWin32Stubs.c sqWin32Utils.c sqWin32Window.c version.c
    • C:\VSSqueakVM\platforms\win32\misc : Squeak.rc resource.h (Add to Resource File)
  • Open Squeak Property Pages.
    • Under Configuration Properties -> General, set Character Set to Use Unicode Character Set.
    • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_WINDOWS;__i386__;_CRT_SECURE_NO_DEPRECATE;VM_NAME=\"Squeak\";_USE_32BIT_TIME_T.
    • Under C/C++ -> Code Generation -> Basic Runtime Checks, choose Default.
    • Under C/C++ -> Code Generation -> Runtime Library, choose Multi-threaded Debug (/MTd).
    • Under C/C++ -> Browse Information -> Enable Browse Information, choose Include All Browse Information (/FR).
    • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
    • Under C/C++ -> Advanced -> Show Includes, choose Yes (/showIncludes).
    • Under C/C++ -> Advanced -> Undefine Preprocessor Definitions, fill in UNICODE.
    • Under Linker -> General -> Enable Incremental Linking, choose Yes (/INCREMENTAL).
    • Under Linker -> Input -> Additional Dependencies, fill in winmm.lib msvcrtd.lib.
    • Under Linker -> Input -> Ignore All Default Libraries, choose Yes (/NODEFAULTLIB).
    • Under Linker -> System -> SubSystem, choose Windows (/SUBSYSTEM:WINDOWS).
    • Under Linker -> Advanced-> Randomized Base Address, choose Disable Image Randomization (/DYNAMICBASE:NO).
    • Under Linker -> Advanced-> Data Execution Prevention (DEP), choose Default.
    • Click on Apply, then OK.
  • At this point, building the project gives error.
    • In sqWin32Prefs.c, line 368. Comment out // SetDefaultPrinter();.
    • Do a search for flag("Dan"); and flag("sizeLowBits");, comment each out. eg, // flag("Dan");
    • Comment out static void inline flag(char *ignored) {}, in sqmemoryaccess.h line 166.
    • Open version.h, change content to #define VM_BUILD_STRING "Win32 built on " __DATE__ " "__TIME__ " Compiler: Visual Studio 2008"
    • In sqWin32Window.c line 512, change void SetDefaultPrinter() to void SetDefaultPrinterSqueak()
    • Search for strdup and strnicmp, change each to _strdup and _strnicmp respectively.
    • Open sqNamedPrims.h, comment out all plugin_exports; except the first two and those plugins being used in this build. eg,
sqExport *pluginExports[] = {
	vm_exports,
	os_exports,	
	BMPReadWriterPlugin_exports,
        ...
	SocketPlugin_exports,
	/*ADPCMCodecPlugin_exports,
        ...
	UUIDPlugin_exports,*/
	NULL
};
    • Open sqWin32Intel.c, at about lineline 177-215, add in #if 0 and #endif. Eg.
#if 0
int __cdecl printf(const char *fmt, ...)
{ va_list al;
...
}

int __cdecl fprintf(FILE *fp, const char *fmt, ...)
{ va_list al;

...
}


int __cdecl putchar(int c)
{
  return printf("%c",c);
}
#endif
  • Next, add plugins to the solution.

B2DPlugin

Create a new empty project named B2DPlugin. Under Solution, choose add to solution. Right-clicked B2DPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\B2DPlugin : B2DPlugin.c

Open B2DPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check B2DPlugin.


BitBltPlugin

Create a new empty project named BitBltPlugin (or add new project). Under Solution, choose add to solution. Right-clicked BitBltPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\BitBltPlugin : BitBltPlugin.c

Open BitBltPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check BitBltPlugin.


BMPReadWriterPlugin

Create a new empty project named BMPReadWriterPlugin (or add new project). Under Solution, choose add to solution. Right-clicked BMPReadWriterPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\BMPReadWriterPlugin : BMPReadWriterPlugin.c

Open BMPReadWriterPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check BMPReadWriterPlugin.


FilePlugin

Create a new empty project named FilePlugin (or add new project). Under Solution, choose add to solution. Right-clicked FilePlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\FilePlugin : FilePlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\FilePlugin : FilePlugin.h sqFilePluginBasicPrims.c
  • C:\VSSqueakVM\platforms\win32\plugins\FilePlugin : sqWin32FilePrims.c

Open FilePlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\FilePlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check FilePlugin.


DropPlugin

Create a new empty project named DropPlugin (or add new project). Under Solution, choose add to solution. Right-clicked DropPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\DropPlugin : DropPlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\DropPlugin : DropPlugin.h
  • C:\VSSqueakVM\platforms\win32\plugins\DropPlugin : sqWin32Drop.c

Open DropPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\DropPlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check DropPlugin.
  • Search for strdup in sqWin32Drop.c, change each to _strdup.


HostWindowPlugin

Create a new empty project named HostWindowPlugin (or add new project). Under Solution, choose add to solution. Right-clicked HostWindowPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\HostWindowPlugin : HostWindowPlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\HostWindowPlugin : HostWindowPlugin.h
  • C:\VSSqueakVM\platforms\win32\plugins\HostWindowPlugin : sqWin32HostWindowPlugin.c

Open HostWindowPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\HostWindowPlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check HostWindowPlugin.


SecurityPlugin

Create a new empty project named SecurityPlugin (or add new project). Under Solution, choose add to solution. Right-clicked SecurityPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\SecurityPlugin : SecurityPlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\SecurityPlugin : SecurityPlugin.h
  • C:\VSSqueakVM\platforms\win32\plugins\SecurityPlugin : sqWin32Security.c

Open SecurityPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\SecurityPlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check SecurityPlugin.



SocketPlugin

Create a new empty project named SocketPlugin (or add new project). Under Solution, choose add to solution. Right-clicked SocketPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\SocketPlugin : SocketPlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\SocketPlugin : SocketPlugin.h
  • C:\VSSqueakVM\platforms\win32\plugins\SocketPlugin : sqWin32NewNet.c

Open SocketPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\SocketPlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Under Librarian -> General -> Additional Dependencies, choose Ws2_32.lib.
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check SocketPlugin.



JoystickTabletPlugin

Create a new empty project named JoystickTabletPlugin (or add new project). Under Solution, choose add to solution. Right-clicked JoystickTabletPlugin, choose Add -> Existing Item....

  • C:\VSSqueakVM\winbuild\src\JoystickTabletPlugin : JoystickTabletPlugin.c
  • C:\VSSqueakVM\platforms\Cross\plugins\JoystickTabletPlugin : JoystickTabletPlugin.h
  • C:\VSSqueakVM\platforms\win32\plugins\JoystickTabletPlugin : sqWin32Joystick.c

Open JoystickTabletPlugin Property Pages.

  • Under Configuration Properties -> General -> Configuration Type, choose Static Library (.lib).
  • Under Configuration Properties -> General -> Character Set, choose Use Unicode Character Set.
  • Under C/C++ -> General -> Additional Include Directories, fill in "$(SolutionDir)\platforms\Cross\plugins\JoystickTabletPlugin".
  • Under C/C++ -> Preprocessor -> Preprocessor Definition, fill in WIN32;_DEBUG;_LIB;SQUEAK_BUILTIN_PLUGIN.
  • Under C/C++ -> Advanced -> Compile As, choose Compile as C Code (/TC).
  • Click on Apply, then OK.
  • Right-click Squeak, choose Project Dependencies..., check JoystickTabletPlugin.


At this point, compilation should give no error. You can step through the code in debug mode and examine.

Personal tools
Navigation