Building perl modules from source on windows

| No Comments | No TrackBacks
Building perl modules from source on windows


This guide is to cover building and installing Pure Perl modules on Windows for use with ActivePerl. It doesn't cover XS Perl modules that use C libraries. I'll leave that for another post :)

You'll want UnxUtils from sourceforge and nmake from Microsoft. If you haven't already installed these, follow these steps:-
1. Download UnxUtils.zip

2. Unzip to a temp folder, for some reason the folder you want is in temp\usr\local\wbin. Move this wbin folder into your c:\ root to make c:\wbin, then rename to something sensible like c:\UnixUtils. (yes I added the 'i').

3. Update your path environment variable to include this folder on the end. In Vista32 in go Start->(Right click on)Computer->Properties->Advanced System Settings, then click the Advanced tab at the top of the window, then the Environment Variables button near the bottom. Finally under 'System Variables' scroll  to find Path, select then click the edit button. Scroll to the end of the list and add ";c:\UnixUtils". Click Ok and Ok again. You may need to reboot for this to take full effect.

4. Now you need to grab nmake from Microsoft.
(this link is subject to change, you may need to search their site). Move the downloaded nmake15.exe file to c:\windows, then run it. It'll extract the nmake.exe executable.


Now we've got everything we need to build and install the Perl module sources.

From my last post I'll use CGI::Kwiki as an example.

Grab the CGI::Kwiki sources from CPAN, extract them to a temp folder, such as c:\temp. (If you find you can't extract this, get hold of WinRAR)

Open a command prompt, navigate to the temp Kwiki folder you extracted eariler ("cd \temp").
Now run Makefile.PL to create the makefile ("perl Makefile.PL").
Now run "nmake" to build it, then "nmake test" to run the modules test suite.

Hmm... Seems CGI::Kwiki 0.18 fails on some tests. That'll be why ActiveState don't have it as a ppm.
Looking closer at the tests it's failing because the test is trying to set a Linux style environment variable.

I think all that's needed is the test to be updated to check if the OS is windows, and set the environment variable Windows style.

I'm going to run "nmake install" to install this module as it does look like it's actually working, the problem is with the tests.

Although I would like to fix this problem so that Kwiki gets automatically built into a ppm by ActiveState. Which brings me onto my next blog post...


Lyle

No TrackBacks

TrackBack URL: http://perl.bristolbath.org/cgi-bin/mt/mt-tb.cgi/12

Leave a comment

About this Entry

This page contains a single entry by Lyle published on January 24, 2009 6:25 AM.

Taking a look at Kwiki was the previous entry in this blog.

How to submit Perl patches? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.