Click here to get back home

Building Text::Iconv on Windows

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Building Text::Iconv on Windows Michael Piotrowski 09-30-2007
Posted by Michael Piotrowski on September 30, 2007, 9:58 am
Please log in for more thread options
Hi,

I'm the author of the Text::Iconv module. Quite often I'm getting
requests from Windows users about building Text::Iconv on Windows,
probably because a binary version is not available from ActiveState.

I'd like to help, but since I don't have access to a Windows system, I
can't say much. It does seem that people have succeeded in building
Text::Iconv on Windows, unfortunately I've never gotten feedback, so I
don't know whether there are any issues.

So, I'd like to ask people who've built Text::Iconv to please help me
out here. What tools did you use? Where can you get them? Did you
need to make any changes in the Makefile.PL or in Iconv.xs?

Thanks and greetings

--
Public key at <http://www.dynalabs.de/mxp/pubkey.txt> (ID 0x1614A044)

Posted by sisyphus359 on October 1, 2007, 4:35 am
Please log in for more thread options
> Hi,
>
> I'm the author of the Text::Iconv module. Quite often I'm getting
> requests from Windows users about building Text::Iconv on Windows,
> probably because a binary version is not available from ActiveState.

There is a binary of version 1.4 available from the Uwinnipeg rep:
ppm install http://theoryx5.uwinnipeg.ca/ppms/Text-Iconv.ppd

(That binary would probably be updated to 1.5 if requested.)

Looks like the ActiveState build (which is an automated procedure)
fails because the iconv lib can't be found. At
http://ppm.activestate.com/BuildStatus/5.8-windows/windows-5.8/Text-Iconv-1.5.txt
we find:

Checking for iconv ... The system cannot find the path specified.
The system cannot find the path specified.
fail
Failed to find iconv, please check your settings and re-run as:
D:\cpanrun\build-8-0\bin\perl.exe Makefile.PL LIBS='-L/path/to/lib'
INC='-I/path/to/include'

(It's quite likely that ActiveState don't have iconv installed,
anyway.)

>
> I'd like to help, but since I don't have access to a Windows system, I
> can't say much. It does seem that people have succeeded in building
> Text::Iconv on Windows, unfortunately I've never gotten feedback, so I
> don't know whether there are any issues.

There's a problem in the Makefile.PL with linktest(). It's easy to
fix. On Win32 '/dev/null' does not exist - you want simply 'nul'.
Portably, you would use File::Spec->devnull.

use File::Spec;
my $devnull = File::Spec->devnull();
my $compile_line = "$compile -o $file $file.c $libs 2> $devnull";

With that change in place the following command worked fine for me
(with Text-Iconv-1.5):

perl Makefile.PL INC="-IC:/_32/msys/1.0/local/include" LIBS="-LC:/_32/
msys/1.0/local/lib -liconv"

And the 'dmake test' and 'dmake install' steps also proceeded without
error.

>
> So, I'd like to ask people who've built Text::Iconv to please help me
> out here. What tools did you use? Where can you get them? Did you
> need to make any changes in the Makefile.PL or in Iconv.xs?
>

My method of getting the iconv library is probably not a very common
one. I built (using the MinGW port of gcc) from libiconv-1.11.tar.gz
source in the msys shell by running './configure --disable-shared --
enable-static', 'make' and 'make install'.

More commonly, folk will probably use an iconv library built using MS
Visual Studio. There's probably a dynamic (shared) Visual Studio built
library available on the web - and perhaps a static build, too.

The make utility (dmake) and the compiler that I use (MinGW port of
gcc) to build perl extensions are both freely available and work
seamlessly with the latest build of ActivePerl.

In general, irrespective of how Win32 folk get hold of the iconv
library and irrespective of the compiler/make they use to build their
perl extensions, it should make no difference to the Makefile.PL
that's needed. (It would be possible to construct exceptions ... but
that's not really your responsibility, imo.) All you really need to do
is attend to the /dev/null issue in the Makefile.PL.

Cheers,
Rob


Posted by Michael Piotrowski on October 9, 2007, 5:16 am
Please log in for more thread options
Hi,

On 2007-10-01, sisyphus359@gmail.com wrote:

>> I'm the author of the Text::Iconv module. Quite often I'm getting
>> requests from Windows users about building Text::Iconv on Windows,
>> probably because a binary version is not available from ActiveState.
>
> There is a binary of version 1.4 available from the Uwinnipeg rep:
> ppm install http://theoryx5.uwinnipeg.ca/ppms/Text-Iconv.ppd
>
> (That binary would probably be updated to 1.5 if requested.)

Ok, that's good to know.

> Looks like the ActiveState build (which is an automated procedure)
> fails because the iconv lib can't be found. At
>
http://ppm.activestate.com/BuildStatus/5.8-windows/windows-5.8/Text-Iconv-1.5.txt
> we find:
>
> Checking for iconv ... The system cannot find the path specified.
> The system cannot find the path specified.
> fail
> Failed to find iconv, please check your settings and re-run as:
> D:\cpanrun\build-8-0\bin\perl.exe Makefile.PL LIBS='-L/path/to/lib'
> INC='-I/path/to/include'
>
> (It's quite likely that ActiveState don't have iconv installed,
> anyway.)

Yes, that's not unlikely.

>> I'd like to help, but since I don't have access to a Windows system, I
>> can't say much. It does seem that people have succeeded in building
>> Text::Iconv on Windows, unfortunately I've never gotten feedback, so I
>> don't know whether there are any issues.
>
> There's a problem in the Makefile.PL with linktest(). It's easy to
> fix. On Win32 '/dev/null' does not exist - you want simply 'nul'.
> Portably, you would use File::Spec->devnull.
>
> use File::Spec;
> my $devnull = File::Spec->devnull();
> my $compile_line = "$compile -o $file $file.c $libs 2> $devnull";
>
> With that change in place the following command worked fine for me
> (with Text-Iconv-1.5):
>
> perl Makefile.PL INC="-IC:/_32/msys/1.0/local/include" LIBS="-LC:/_32/
> msys/1.0/local/lib -liconv"
>
> And the 'dmake test' and 'dmake install' steps also proceeded without
> error.

Ah, great. Thanks for the information! I'll make the necessary change; I
wanted to release a new version anyway.

>> So, I'd like to ask people who've built Text::Iconv to please help me
>> out here. What tools did you use? Where can you get them? Did you
>> need to make any changes in the Makefile.PL or in Iconv.xs?
>
> My method of getting the iconv library is probably not a very common
> one. I built (using the MinGW port of gcc) from libiconv-1.11.tar.gz
> source in the msys shell by running './configure --disable-shared --
> enable-static', 'make' and 'make install'.
>
> More commonly, folk will probably use an iconv library built using MS
> Visual Studio. There's probably a dynamic (shared) Visual Studio built
> library available on the web - and perhaps a static build, too.
>
> The make utility (dmake) and the compiler that I use (MinGW port of
> gcc) to build perl extensions are both freely available and work
> seamlessly with the latest build of ActivePerl.

Just curious, isn't ActivePerl built wich Visual Studio?

> In general, irrespective of how Win32 folk get hold of the iconv
> library and irrespective of the compiler/make they use to build their
> perl extensions, it should make no difference to the Makefile.PL
> that's needed. (It would be possible to construct exceptions ... but
> that's not really your responsibility, imo.) All you really need to do
> is attend to the /dev/null issue in the Makefile.PL.

Ok, that's very useful information. Again, thank you very much!

Greetings

--
Public key at <http://www.dynalabs.de/mxp/pubkey.txt> (ID 0x1614A044)

Posted by sisyphus359 on October 10, 2007, 6:53 am
Please log in for more thread options
.
.
>
> Just curious, isn't ActivePerl built wich Visual Studio?

Yes (version 6.0, to be precise) - but to successfully build modules
with the MinGW compiler on ActivePerl merely requires that a number of
%Config values be altered.
ActiveState have now put in place a mechanism (for want of a better
word) that detects the presence of the MinGW compiler, and then alters
those %Config values appropriately. So, for example, although
ActivePerl was built using the 'cl' compiler, if the MinGW compiler is
found, 'perl -V:cc' will then report that cc = `gcc`.

Part of the reason this works out so well is that the MinGW port of
gcc uses the same C runtime as Visual Studio 6.0.

>
> > All you really need to do
> > is attend to the /dev/null issue in the Makefile.PL.
>
> Ok, that's very useful information.

Without going back to check, I think that use of File::Spec->devnull()
would also remove the need for some VMS-specific code (that I think I
saw in the Makefile.PL).

I'm not sure if File::Spec was part of Core with perl 5.6 (and
earlier). You might want to check on that if you're wanting to retain
buildability on older versions of perl (and add File::Spec to
PREREQ_PM if need be ... or just code in your own File::Spec-
>devnull() replacement).

Cheers,
Rob


Posted by Michael Piotrowski on October 12, 2007, 6:33 pm
Please log in for more thread options
On 2007-10-10, sisyphus359@gmail.com wrote:

>> Just curious, isn't ActivePerl built wich Visual Studio?
>
> Yes (version 6.0, to be precise) - but to successfully build modules
> with the MinGW compiler on ActivePerl merely requires that a number of
> %Config values be altered.
> ActiveState have now put in place a mechanism (for want of a better
> word) that detects the presence of the MinGW compiler, and then alters
> those %Config values appropriately. So, for example, although
> ActivePerl was built using the 'cl' compiler, if the MinGW compiler is
> found, 'perl -V:cc' will then report that cc = `gcc`.
>
> Part of the reason this works out so well is that the MinGW port of
> gcc uses the same C runtime as Visual Studio 6.0.

Ah, I see.

>>> All you really need to do is attend to the /dev/null issue in the
>>> Makefile.PL.
>>
>> Ok, that's very useful information.

And it'll be in 1.6.

> Without going back to check, I think that use of File::Spec->devnull()
> would also remove the need for some VMS-specific code (that I think I
> saw in the Makefile.PL).

Unfortunately not, since on VMS you need to use the PIPE utility for
UNIX-style output redirection. So this is a special case anyway.

> I'm not sure if File::Spec was part of Core with perl 5.6 (and
> earlier). You might want to check on that if you're wanting to retain
> buildability on older versions of perl (and add File::Spec to
> PREREQ_PM if need be ... or just code in your own File::Spec-
>> devnull() replacement).

For 1.6 I'm simply using File::Spec. If that's a problem for anybody,
they'll certainly speak up ;-)

Thanks again and greetings

--
Public key at <http://www.dynalabs.de/mxp/pubkey.txt> (ID 0x1614A044)

Similar ThreadsPosted
ANNOUNCE: Text::Iconv 1.4 July 18, 2004, 1:41 am
Building Perl module GD::Text on Solaris 10 August 3, 2007, 3:37 pm
Question about building modules on W2K September 24, 2004, 7:09 am
Problem building DBD::Oracle on 64 bit solaris April 13, 2005, 2:51 pm
ld synbol errors building XML::Parser on AIX 5.2 June 30, 2005, 2:10 pm
Building Math::Pari using Sun Studio 11 October 16, 2006, 11:46 am
Win32::GUI newbie question re dynamic GUI building October 6, 2005, 8:44 pm
Problems building Javascript-1.00 on Win32 system November 11, 2006, 9:59 pm
Building module Encode::Detect on solaris 10 platform February 21, 2008, 9:13 am
building GD using a locally-installed libgd (old libgd also present on system) November 10, 2006, 11:54 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap