Compiling modules for Windows?

Compiling modules for Windows?

am 08.07.2006 03:28:58 von Neil Cherry

I need to create a Perl module for use under Windows (I think I know
how to do it for linux). Are there any tutorials? Can I use Openwatcom
as the C compiler? Can I use Cygwin as the C compiler (I think I need
to create a dll) ?

Any pointers would be great, thanks.

--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
http://home.comcast.net/~ncherry/ Backup site

Re: Compiling modules for Windows?

am 08.07.2006 05:39:21 von Sisyphus

"Neil Cherry" wrote in message
news:slrneau2ip.q4j.njc@cookie.uucp...
> I need to create a Perl module for use under Windows (I think I know
> how to do it for linux).

Same process for both Windows and linux:

perl Makefile.PL
make test
make install

However, you generally need to replace "make" (in the above commands) with
whatever 'perl -V:make' reports.

> Are there any tutorials? Can I use Openwatcom
> as the C compiler? Can I use Cygwin as the C compiler (I think I need
> to create a dll) ?
>

Cygwin's compiler (gcc) will be quite satisfactory iff you're using Cygwin
perl.

Generally, you need to use the compiler that 'perl -V:cc' reports.

However, if 'perl -V:cc' reports 'cl' and you don't have Microsoft's Visual
Studio, you could install (in order) 'dmake' (from
http://search.cpan.org/dist/dmake/ ), MinGW (from
http://www.mingw.org/download.shtml ), and ExtUtils::FakeConfig (from
http://search.cpan.org/~mbarbon/ExtUtils-FakeConfig-0.06/ ) and build the
module with:

perl -MConfig_m Makefile.PL
dmake test
dmake install

Or, if you have ActiveState perl build 815 or 817 (or later), there's
probably no need for ExtUtils::FakeConfig. Just install MinGW and dmake, and
run:

perl Makefile.PL
dmake test
dmake install

If you have ActiveState build 816, replace it with build 817. You can check
by running:
perl -e "print $ActivePerl::VERSION"

If you need to reply, could you please provide the output of 'perl -V' so
that we can see the details of your perl.

(Yet another alternative ... if you want to use 'cl' but don't have it, you
can download a free command line version of Visual Studio from Microsoft.
Not sure of how much milage you get, and I don't have details at hand -
though someone else may well provide them. In any case you should be able to
Google up something ... or check the Readme.win32 in the perl source. Imho,
the 'dmake/MinGW' path is preferable - easier installation and uses the same
runtime as ActiveState's compiler.)

Cheers,
Rob

Re: Compiling modules for Windows?

am 09.07.2006 19:28:09 von Neil Cherry

On Sat, 8 Jul 2006 13:39:21 +1000, Sisyphus wrote:

> Rob

Rob, thanks that's a world of information that I couldn't find
easily. This will go a long way towards helping me create modules that
are portable for Linux, Mac and Windows.

Thanks again!

--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
http://home.comcast.net/~ncherry/ Backup site