Building Text::Iconv on Windows
Building Text::Iconv on Windows
am 30.09.2007 15:58:11 von Michael Piotrowski
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
--
Michael Piotrowski, M.A.
Public key at (ID 0x1614A044)
Re: Building Text::Iconv on Windows
am 01.10.2007 10:35:23 von sisyphus359
On Sep 30, 11:58 pm, Michael Piotrowski wrote:
> 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\5-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
Re: Building Text::Iconv on Windows
am 09.10.2007 11:16:06 von Michael Piotrowski
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\5-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
--
Michael Piotrowski, M.A.
Public key at (ID 0x1614A044)
Re: Building Text::Iconv on Windows
am 10.10.2007 12:53:10 von sisyphus359
On Oct 9, 7:16 pm, Michael Piotrowski 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.
>
> > 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
Re: Building Text::Iconv on Windows
am 13.10.2007 00:33:25 von Michael Piotrowski
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
--
Michael Piotrowski, M.A.
Public key at (ID 0x1614A044)