Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 70141
Status: open
Priority: 0/
Queue: XML-LibXML

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

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



Subject: help XML-LibXML compile on Win32
I've just successfully compiled the latest version of XML::LibXML on Win32, with minimal changes and actions necessary. Using ActivePerl 5.12.4 and its bundled MinGW compiler, i only had to do these things: 1. add -llibgettextlib.dll to the Makefile.PL at line 288 ($ENV {ACTIVEPERL_MINGW} doesn't work for detection anyhow) 2. install libgettextpo-0.17-1 and gettext-0.17-1 from here: http:// sourceforge.net/projects/mingw/files/MinGW/gettext/gettext-0.17-1/ 3. install iconv-1.9.2, libxml2-2.7.8 and zlib-1.2.5 from here: ftp:// ftp.zlatkovic.com/libxml/ So, it would be nice if you could add the -l call to Makefile.PL, as well we mention those download locations and their necessity in the module POD. :)
Applied and hopefully fixed in XML-LibXML-1.85.
On Mon Aug 08 11:40:38 2011, MITHALDU wrote: Show quoted text
> I've just successfully compiled the latest version of XML::LibXML on > Win32, with minimal changes and actions necessary. > > Using ActivePerl 5.12.4 and its bundled MinGW compiler, i only had to > do these things: > > 1. add -llibgettextlib.dll to the Makefile.PL at line 288 ($ENV > {ACTIVEPERL_MINGW} doesn't work for detection anyhow)
This actually breaks the build for me when building with VC and my own versions of libxml and iconv. If you need an additional library for your local setup, then you should specify it explicitly in your LIBS option on the Makefile.PL commandline, e.g. perl Makefile.PL INC=-IC:\libs\include "LIBS=-LC:\libs\lib -llibgettextlib.dll" I've now added a patch via CPAN distroprefs to remove this lib to reenable building on the PPM build servers. Please send me email if this change ever gets removed from the CPAN releases, so I can remove the patch as well. Otherwise the patch will fail, and new releases won't build anymore again.
I am extemely impressed. Exactly how did that break anything?
Also, it sounds like the correct way to patch this then would be to add a check to only add this on gcc: Makefile.PL | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index 13da35d..8b19ad7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -305,7 +305,8 @@ if (!defined $config{LIBS} || $config{LIBS} !~ /\-l (?:lib)?xml2\b/) { $config_LIBS_alternatives = [ map { "$l $_" } q/ -lxml2 -lzlib/, - q/ -llibxml2 -lzlib -llibgettextlib.dll/ + q/ -llibxml2 -lzlib /, + ( $Config{cc} =~ /gcc/ ? "-llibgettextlib.dll" : () ) ]; $config{LIBS} = $config_LIBS_alternatives->[-1]; }
On Fri Mar 08 08:51:23 2013, MITHALDU wrote: Show quoted text
> I am extemely impressed. Exactly how did that break anything?
I don't have any libgettext libraries on my system, and I don't know why you would need them. I do build my own libxml2.lib, and I used win_iconv to use the native Unicode functionality on Windows. So I assume your dependency on gettext comes from one of the precompiled binaries that you are using. As such I feel that hard-coding a dependency on libgettext is still wrong, even just for gcc. I would rather add your specific build instructions to the documentation.
On Fri Mar 08 13:28:13 2013, JDB wrote: Show quoted text
> On Fri Mar 08 08:51:23 2013, MITHALDU wrote:
> > I am extemely impressed. Exactly how did that break anything?
> > I don't have any libgettext libraries on my system, and I don't know why > you would need them.
Sorry, didn't specify 'Exactly how', so here it is: Show quoted text
>>> C:\Perl\bin\perl.exe Makefile.PL INC=-I%FLY_LIBS%\include
"LIBS=-L%FLY_LIBS%\lib -liconv" enable native perl UTF8 Checking for ability to link against xml2...no Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found. Try setting LIBS and INC values on the command line Or get libxml2 from http://xmlsoft.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are. Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter to see the exact reason why the detection of libxml2 installation failed or why Makefile.PL was not able to compile a test program. No 'Makefile' created SHLOMIF/XML-LibXML-2.0014.tar.gz So unless you have the library installed and findable via LIBS you won't be able to generate a working Makefile. Which to me means "the build is broken".
I talked it over with Jan and apparently what happened was this: In August 2011, gettext was added as an optional lib suggestion for the linker. Somewhere between then and now, the lib list became a hard requirement, thus elevating the gettext suggestion as well. I will, over the weekend, provide a patch to make gettext a suggestion again. Additionally i talked with Joel Berger, and it seems we might be able to hammer together some alien libs, to help XML::LibXML compile via CPAN on windows all on its own.
A proper patch would probably be this: https://gist.github.com/wchristian/6c016d802b806923cd26 However i cannot fully confirm this, since Devel::CheckLib only creates binaries that crash with system popups. I'm running the latest Devel::CheckLib and have no idea what the hell is up with that.
On Sun Mar 10 13:43:42 2013, MITHALDU wrote: Show quoted text
> A proper patch would probably be this: > > https://gist.github.com/wchristian/6c016d802b806923cd26 > > However i cannot fully confirm this, since Devel::CheckLib only creates > binaries that crash with system popups. I'm running the latest > Devel::CheckLib and have no idea what the hell is up with that.
hi all! Any news? Please send a pull-req for https://github.com/shlomif/perl-XML-LibXML .
XML::LibXML now uses Alien::Libxml2 to find or link against libxml2. Please open an issue for that distribution if this problem still occurs.