Apr 2, 2011

Compile a Vanilla Perl on Windows with MinGW


Compiling Perl on Unix is really straight forward, but on Windows you need to pay some extra effort.

Read the procedure below if you want to build a default (a.k.a. Vanilla) Perl distribution with no pain.

All the informations you need can be found on the Internet but if you just don't want to waste your time around, this is the right place.

Here we go !
  1. Create a folder C:\MinGW
  2. download mingw-get from www.mingw.org and uncompress it under C:\MinGW
  3. Create a folder C:\Perl
  4. download latest Perl source and uncompress it under C:\Perl, for instance I got the folder C:\Perl\perl-5.12.3
  5. Download dmake from here, uncompress it and put the dmake.exe and the "startup" directory under C:\MinGW\bin
  6. Open a cmd prompt and type
set PATH=C:\MinGW\bin;%PATH%
cd C:\MinGW\bin
mingw-get install gcc g++
cd C:\Perl\perl-5.12.3\win32
dmake
dmake test
dmake install
The dmake and dmake test commands will take some time, depending on your pc perfomances.
Now you can remove the folder containing Perl sources, i.e. C:\Perl\perl-5.12.3 and ...
That's all !
For those who want to customize start with the
C:\Perl\perl-5.12.3\win32\makefile.mk
file where you can choose, for example, the destination directories for your installation which can be different from C:\MinGW and C:\Perl, but, should not contain spaces.
Don't forget to add
C:\MinGW\bin;C:\Perl\bin
to your PATH environment variable in order to use your Perl distribution without problems.

No comments:

Post a Comment