Skip Menu |
 

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 48765
Status: resolved
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Ext-lib: libiconv, libintl - change proposal
Download (untitled) / with headers
text/plain 2.9k
Hi, I have an idea concerning libiconv included in strawberry perl. The main reason for posting this proposal is the fact that it is not possible to install perl module Text::Iconv from cpan even if we already have iconv library included in strawberry. The problem is that you have included both: - static lib "libiconv.a" - dynamic lib "libiconv.dll.a" However libiconv headers are unfortunately designed in the following way: - for using static lib you need to use: gcc -DLIBICONV_STATIC example.c c:/strawberry/lib/libiconv.a -o e1.exe - for using dynamic lib you need to use: gcc example.c -liconv -o e2.exe So libiconv.a expects the source to be compiled with defined LIBICONV_STATIC whereas libiconv.dll.a not (it seems to be a sort of Win32 specific hack). Another issue - if a perl module has Makefile.PL like this: *** use ExtUtils::MakeMaker; WriteMakefile( LIBS => '-liconv' ); *** ExtUtils::MakeMaker converts '-liconv' option specified in INC param of WriteMakefile into full paths to corresponding *.a file - in this case c:/strawberry/lib/libiconv.a. However libiconv.a is a static lib but ExtUtils::MakeMaker does not add necessary -DLIBICONV_STATIC (as it is Win32 specific) to gcc command in generated Makefile. So in the end: 1) if you try "cpan Text::Iconv" with clean strawberry you will experience an error like this: Iconv.o:Iconv.c:(.text+0xb2): undefined reference to `_imp__libiconv' Iconv.o:Iconv.c:(.text+0x135): undefined reference to `_imp__libiconv' Iconv.o:Iconv.c:(.text+0x54d): undefined reference to `_imp__libiconvctl' Iconv.o:Iconv.c:(.text+0x934): undefined reference to `_imp__libiconv_open' Iconv.o:Iconv.c:(.text+0xaca): undefined reference to `_imp__libiconv_open' Iconv.o:Iconv.c:(.text+0x191b): undefined reference to `_imp__libiconv_close' collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Text\Iconv\Iconv.dll' 2) after renaming c:\strawberry\c\lib\libiconv.dll.a to c:\strawberry\c\lib\libiconv.a Text::Iconv compiles OK and pass all tests. SUGGESTION 1) - ICONV (libiconv) - I propose to remove currently installed c:/strawberry/lib/libiconv.a - and rename c:/strawberry/lib/libiconv.dll.a => libiconv.a - so all '-liconv' or direct 'libiconv.a' linking will always be dynamic (the result will have a dependency to libiconv2.dll) SUGGESTION 2) - ICONV (libcharset) - exactly the same *.a vs. *.dll.a issue - I propose to remove currently installed c:/strawberry/lib/libcharset.a - and rename c:/strawberry/lib/libcharset.dll.a => libcharset.a SUGGESTION 3) - ICONV (libiconv2.dll) - what was the reason to duplicate libiconv2.dll into iconv.dll? - I am not sure if iconv.dll is really required by something. SUGGESTION 4) - LIBINTL - we have just libintl3.dll in strawberry (no dev files *.a/*.h) - I propose an upgrade to the latest version (0.14.4) of libintl3.dll from http://gnuwin32.sourceforge.net/packages/libintl.htm - but maybe there were some reason for keeping slightly old version 0.14.1 -- kmx
Download (untitled) / with headers
text/plain 3.5k
On Mon Aug 17 05:33:55 2009, KMX wrote: Show quoted text
> Hi, > > I have an idea concerning libiconv included in strawberry perl. > > The main reason for posting this proposal is the fact that it is not > possible to install perl module Text::Iconv from cpan even if we already > have iconv library included in strawberry. > > The problem is that you have included both: > - static lib "libiconv.a" > - dynamic lib "libiconv.dll.a" > However libiconv headers are unfortunately designed in the following way: > - for using static lib you need to use: > gcc -DLIBICONV_STATIC example.c c:/strawberry/lib/libiconv.a -o e1.exe > - for using dynamic lib you need to use: > gcc example.c -liconv -o e2.exe > > So libiconv.a expects the source to be compiled with defined > LIBICONV_STATIC whereas libiconv.dll.a not (it seems to be a sort of > Win32 specific hack). > > Another issue - if a perl module has Makefile.PL like this: > *** > use ExtUtils::MakeMaker; > WriteMakefile( LIBS => '-liconv' ); > *** > ExtUtils::MakeMaker converts '-liconv' option specified in INC param of > WriteMakefile into full paths to corresponding > *.a file - in this case c:/strawberry/lib/libiconv.a. However libiconv.a > is a static lib but ExtUtils::MakeMaker does not add necessary > -DLIBICONV_STATIC (as it is Win32 specific) to gcc command in generated > Makefile. > > So in the end: > > 1) if you try "cpan Text::Iconv" with clean strawberry you will > experience an error like this: > Iconv.o:Iconv.c:(.text+0xb2): undefined reference to `_imp__libiconv' > Iconv.o:Iconv.c:(.text+0x135): undefined reference to `_imp__libiconv' > Iconv.o:Iconv.c:(.text+0x54d): undefined reference to `_imp__libiconvctl' > Iconv.o:Iconv.c:(.text+0x934): undefined reference to
`_imp__libiconv_open' Show quoted text
> Iconv.o:Iconv.c:(.text+0xaca): undefined reference to
`_imp__libiconv_open' Show quoted text
> Iconv.o:Iconv.c:(.text+0x191b): undefined reference to > `_imp__libiconv_close' > collect2: ld returned 1 exit status > dmake.exe: Error code 129, while making > 'blib\arch\auto\Text\Iconv\Iconv.dll' > > 2) after renaming c:\strawberry\c\lib\libiconv.dll.a to > c:\strawberry\c\lib\libiconv.a Text::Iconv compiles OK and pass all tests. > > SUGGESTION 1) - ICONV (libiconv) > - I propose to remove currently installed c:/strawberry/lib/libiconv.a > - and rename c:/strawberry/lib/libiconv.dll.a => libiconv.a > - so all '-liconv' or direct 'libiconv.a' linking will always be dynamic > (the result will have a dependency to libiconv2.dll)
OK. We can do that with the current libraries. Show quoted text
> SUGGESTION 2) - ICONV (libcharset) > - exactly the same *.a vs. *.dll.a issue > - I propose to remove currently installed c:/strawberry/lib/libcharset.a > - and rename c:/strawberry/lib/libcharset.dll.a => libcharset.a
Same here. Show quoted text
> SUGGESTION 3) - ICONV (libiconv2.dll) > - what was the reason to duplicate libiconv2.dll into iconv.dll? > - I am not sure if iconv.dll is really required by something.
Because the version of libxml2 we used requires it using that name, so the answer to your second point is yes, it is required for something at the moment. We could remove the copy when we get the libxml2 situation fixed. Show quoted text
> SUGGESTION 4) - LIBINTL > - we have just libintl3.dll in strawberry (no dev files *.a/*.h) > - I propose an upgrade to the latest version (0.14.4) of libintl3.dll > from http://gnuwin32.sourceforge.net/packages/libintl.htm > - but maybe there were some reason for keeping slightly old version 0.14.1
Not that I know of - be worth trying. The dependency situation looks good on it (it doesn't require versioned C runtime, etc.) so including it would be fine.
Download (untitled) / with headers
text/plain 579b
Show quoted text
> > SUGGESTION 4) - LIBINTL > > - we have just libintl3.dll in strawberry (no dev files *.a/*.h) > > - I propose an upgrade to the latest version (0.14.4) of libintl3.dll > > from http://gnuwin32.sourceforge.net/packages/libintl.htm > > - but maybe there were some reason for keeping slightly old version
0.14.1 It turns out that 0.14.1 is what was provided in the libiconv..-deps.zip file. I'll replace it. Show quoted text
> Not that I know of - be worth trying. > > The dependency situation looks good on it (it doesn't require versioned > C runtime, etc.) so including it would be fine.
Download (untitled) / with headers
text/plain 229b
I'm sending this up in an hour or so, (uploading -RC2 right now): http://strawberryperl.com/packages/libiconv-08192009.zip is the reconstituted libiconv pack I'll use for the next build (not 5.10.1-RC2) that will do all of this.
Download (untitled) / with headers
text/plain 164b
Show quoted text
> http://strawberryperl.com/packages/libiconv-08192009.zip is the > reconstituted libiconv pack I'll use for the next build
The link does not work for me. -- kmx
Subject: Oct2009-beta-2: iconv cosmetics
Download (untitled) / with headers
text/plain 774b
Hi, I would like to propose a little cleaning as I think that the following files related to iconv pack can be removed: c:\strawberry\c\lib\charset.alias c:\strawberry\c\lib\libcharset1.def c:\strawberry\c\lib\libiconv2.def c:\strawberry\c\lib\libintl.def c:\strawberry\c\lib\libcharset.la c:\strawberry\c\lib\libiconv.la I have removed these files from your: http://strawberryperl.com/package/libiconv-08192009.zip and prepared a new version here: http://svn.ali.as/cpan/users/kmx/strawberry_packs/libiconv-1.9.2-1-bin_20090831.zip It is not crucial but would be nice to have as for example *.la files contain some non-existing paths which confuse some of my scripts I am using for building external libraries (common strawberry user is not affected by that). -- kmx
Added as of svn.ali.as r9349.
Resolving since October release happened.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.