GameMonkey Script
http://www.gmscript.com/gamemonkey/forum/

Mingw32/gcc 3.4.x, how to build gm as part of my app?
http://www.gmscript.com/gamemonkey/forum/viewtopic.php?f=6&t=612
Page 1 of 1

Author:  mrbarrysoftware [ Sat Sep 01, 2012 3:27 am ]
Post subject:  Mingw32/gcc 3.4.x, how to build gm as part of my app?

Hello GM Community,

I've been thinking of a project to use gamemonkey script in for a long time, and finally have one, so I nabbed a copy, and took a peek.

Well, I have no idea what to compile - I searched for a readme or something that would actually explain what files I need to compile into my project or what folders to use for including files. Then I'd also need to know if there are any dependencies.

I'm sure there is a pile of similar posts, and I'm happy to be linked to those, but I think there should be a readme and/or some sort of sample makefile in the download, as it would probably save this forum from a handful of posts.

I noticed in the src directory there is a pile of different gm* directories, none of which have any sort of readme or some sort of direction.

Thanks for any help,
-MrBarry

Author:  Greg [ Sat Sep 01, 2012 6:10 am ]
Post subject:  Re: Mingw32/gcc 3.4.x, how to build gm as part of my app?

Hi mrbarrysoftware and welcome to the forum :) There is some info on building GM in the FAQ. I'll describe it below as well...

1) Copy all the files from src\gm (not sub folders yet) to your project.
2) Delete gmDebugger.cpp or don't include it in your project.
3) Copy gmConfig_p.h from one of the platform folders. win32msvc is the only one I maintain.
4) Compile as you like, as static lib or directly as part of your project.

You may need to modify the gmconfig_p.h for your platform. This is mostly to map GM types to appropriate compiler types. You may need to set endian and perhaps map some standard library functions.

After that...
5) Add some src\binds files that you need or grab some bindings and extensions from elsewhere.

If you have Windows and a Express copy of Visual Studio or better it can be helpful to browse the example projects.

Let us know how you go.

Author:  mrbarrysoftware [ Sat Sep 01, 2012 3:56 pm ]
Post subject:  Re: Mingw32/gcc 3.4.x, how to build gm as part of my app?

Alright, that's what I started doing, and I guess I missed that in the FAQ.

Have you thought of moving things to cmake or something similar? And also maybe implementing some sort of community wiki?

Also, if GameMonkey supports threading, do I need to link to any additional libraries, or is threading something I'd have to implement myself? I'm not actually interested in threading, at least from my current goals, but I just want to make sure I've got all the dependencies worked out.

Take care, and thanks for pointing that out,
-MrBarry

Author:  Greg [ Sat Sep 08, 2012 12:06 am ]
Post subject:  Re: Mingw32/gcc 3.4.x, how to build gm as part of my app?

No other libs are required for GM. With OS threading there are 2 important things to consider:
1) The compiler itself is not thread safe due to legacy use of Flex. So if running multiple VMs in different threads, mutex the compile call.
2) GM objects cannot be shared between VMs in the same or different thread. Each GM object belongs to the VM that created it. You may freely create multiple VMs in the same or different threads, just keep the data separate or communicate via a different channel.

As for GM internal threading, it is entirely a single threaded cooperative model. This works well when scripts behave nicely, performing small amounts of work before exiting or yielding. Because GM is not natively compiled, heavy lifting should be done in native code.

I don't care to maintain make files, though I'm happy for others to do so. As of this year, I host the GM website so I could host a wiki, otherwise it may be best to move everything to a code sharing or hosting service like GitHub. I am not current with which is the most popular or featured.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/