Developing Pike modules on Windows

3 views
Skip to first unread message

jyc

unread,
Jul 7, 2012, 7:03:55 PM7/7/12
to pi...@roxen.com
Hello,

Reading http://modules.gotpike.org/docs/PikeModule.html this documentt , it
seems like I would only be able to develop Pike modules on UN*X systems, and
then only those with specifically autoconf 2.13 or 2.52.

Does this restriction still apply to recent versions of Pike (the document
seems like it was last updated last year)?

Thanks.

--
View this message in context: http://pike.1058338.n5.nabble.com/Developing-Pike-modules-on-Windows-tp5709984.html
Sent from the Pike - User mailing list archive at Nabble.com.

H. William Welliver III

unread,
Jul 7, 2012, 8:04:24 PM7/7/12
to jyc, pi...@roxen.com
Hi,

The answer probably depends on what you're looking to do.

If you're interested in writing modules in pure pike, then you don't need to deal with any of the autoconf or make stuff at all.

If, however, you're looking to write modules in C or C++ (or use the C-based CMOD precompiler), then that's a different situation.

In theory, it's possible to build modules for windows using the typical pike build system (that is, the complicated cross-os compilation approach), but it's a lot of work. I just built a module I'd written on Solaris that provides a glue to the libxml2 library for the first time on Windows, and it pretty much worked out of the box, but it was a lot of work to get to that point. The biggest problem with this is that currently "pike -x module" doesn't know how to deal with the special windows setup, so it won't work at all. I had to drop my module source directory into the src/modules directory of pike and have it built as part of a full pike build. I think that's fixable without a lot of effort, but really only gets you to "really miserable" from "really really miserable" on the pain scale.

If you're just developing modules for your own internal use (and for Windows only), then you can probably just throw together a VC project that does the compilation. If you want to use CMOD, the command to compile a cmod file to a .c file is "pike -x compile". Include the pike headers and that gets you a lot of the way there. I can provide some of the cl command line options for compiling and linking later tonight, if you're interested (I'm in the middle of a build right now and can send you the commands that actually get run.

Hope this helps a little bit; if you need more info, please do let me know… I'm not really a windows expert, but would like to see this improved a bit.

Best,

Bill

jyc

unread,
Jul 8, 2012, 5:12:01 AM7/8/12
to pi...@roxen.com
Hello,

Thanks for the reply!

Hm, so I don't actually need to use that procedure? In that case, how should
I submit modules to the module repository (if at all)? Or is it that the
module repository is only used for installing modules which depend on C or
C++ components?

Thanks again for the help.

--
View this message in context: http://pike.1058338.n5.nabble.com/Developing-Pike-modules-on-Windows-tp5709984p5709986.html

Marcus Agehall (nu med K-m�rkt fastighet och ny elcentral) @ Pike (-) importm�te f�r mailinglistan

unread,
Sep 21, 2012, 4:10:02 AM9/21/12
to pi...@roxen.com
Building modules on Windows, in C, you will be restricted to use the
same type of build system as the original pike build.

Setting up the traditional Windows build system is *FAR* from trivial
and would discourage even the most seasoned developers in most cases.

I've managed to successfully compile Pike using MingW instead and this
gives you a much easier environment to work with. It isn't perfect and
there are a lot of things that needs to be worked out before it is
100% usable, but once this work is done, you should be able to develop
modules on Windows, just like you do in Unix.

Bill Welliver

unread,
Sep 21, 2012, 2:32:08 PM9/21/12
to Marcus Agehall (nu med K-märkt fastighet och ny elcentral) @ Pike (-) importmötef�r mailinglistan, pi...@roxen.com
I've managed to get the hybrid windows build process running on two or
three occasions, and it's not for the faint of heart, though it is doable
if you need to be able to build custom c-modules.

I've been able to get a few of my own modules to compile (libXML2, Xapian,
FCGI) from the same source that I use to build for *nix, and they're not
exactly trivial examples. If anyone's interested in playing around with
these, just let me know and I'll make them available.

A project that's on my list (but has not yet risen to the top) is to come
up with a way to host a compilation service so that users can submit
modules to be compiled for windows automatically. Of course, it would not
be as convenient as having a local build environment, but it's better than
nothing. The current obstacle is getting "pike -x module" to behave
properly in the hybrid environment.

Something that does exist that might be useful involves being able to
distribute and install modules once they've been compiled. The pmar_install
tool allows for automated download and install of packaged modules
including binaries, and it works well for distributing compiled modules for
Windows, including DLLs that might be needed. I can provide examples and
Makefile targets for anyone that might be interested.

Of course, it'd also be possible to come up with a visual studio project
that runs the same CL commands, but then you'd have a windows-only
solution. However, that might be okay for certain situations.

Best,

Bill

On 4:10:02 am 09/21/12 "Marcus Agehall (nu med K-märkt fastighet och ny
Reply all
Reply to author
Forward
0 new messages