PGTS Humble Blog
Thread: Tips/Tricks For Programming etc
|When you have eliminated the impossible, whatever remains, however improbable, must be the truth.|
Building CPAN Module for Strawberry in Windows 7
Chronogical Blog Entries:
Date: Wed, 26 Feb 2014 22:53:49 +1000
Several of these blog items were left empty, during an extended period of inactivity. This formerly empty item has been filled with some notes made during an installation of Strawbery perl on Windows 7.
The following is an extract of some notes:
Configuring Firefox for proxy
Copy the proxy settings from Internet Explorer:
- Click on the Gear in the top right hand corner.
- Tools->Internet Options
- Click Connections
- Click Lan Settings
Make Windows 7 display folder extensions
The location of this item changes with every version of Windows ... Why isn't the default to show extensions rather than hide them?
- Control Panel->Appearance->Folder Options
- Click on "View"
- Clear the checkbox that says "Hide extensions for known file types"
Building CPAN modules for Strawberry Perl
Windows uses NTLM authentication and this causes difficulties with LWP. There is a package that might fix this problem but it requires a connection to CPAN in order to get it.
You can build the packages by hand, using the Makefile.PL. For UNIX (including) CYGWIN, the tried and true way of doing this is to download the package tarball, unpack it, change directory to the unpacked contents and then use make commands to build the package ... e.g.:
tar xvfz Mail-Sender-0.8.23.tar.gz cd Mail-Sender-0.8.23 perl Makefile.PL make make install
Usually the make command is a link to "gmake" (GNU make)
As it happens, Strawberry perl ships with gmake. I tried to do this in Windows 7 by building a module more or less as above and the build failed with the following error:
to undefined at C:/Perl/perl/lib/ExtUtils/Install.pm line 1187. make: *** [pm_to_blib] Error 2
It seems that many people have tried this ... You'll find plenty of matches for the above error ... But not many answers.
The problem is that Windows doesn't play nicely with gmake. Even though gmake is the stock standard "make" utility on Linux systems, it doesn't work so well in the Strawberry/Windows environment.
The solution is to use an alternative make utility dmake, which also ships with Strawberry. According to its original authors, dmake differs from other versions of "make" by being optimised for processing on a distributed platform ... I'm not sure why this means that it works better in Windows? ... The version that ships with Strawberry has been created by the Apache Open Office Group.
I was able to install the Mail-Sender strawberry perl module with the following commands:
ptar -xvzf Mail-Sender-0.8.23.tar.gz cd Mail-Sender-0.8.23 perl Makefile.PL dmake dmake install
Note: Some packages use Build.PL rather than Makefile.PL
Note: This assumes you have setup PATH and PATHEXT to find ptar.pl (a handy little perl utility that does the work of the Unix tar command in Windows).