Skip Menu |
 

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

Report information
The Basics
Id: 80229
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: desmond.daignault [...] oneil.com
Cc:
AdminCc:

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



Subject: Fails to create Makefile on windows due to include path having spaces
Date: Tue, 16 Oct 2012 20:44:37 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Download (untitled) / with headers
text/plain 3.6k
On Windows, check_lib_or_exit always fails. No matter what I set INC= to be on the command line. When using Visual Studio, it looks at the environment variable INCLUDE to find include headers and the environment variable LIB to find library files. eg: INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include; LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\P rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; In the example above, the libxml2 library was installed in c:\project\win32\install\lib and c:\project\win32\install\include. If I remove the check_lib_or_exit function from Makefile.PL it builds just fine when the environment has INCLUDE and LIB set correctly. Additionally a warning can be removed when checking to see if LIBS was passed on the command line. patch follows: *** Makefile.PL.orig 2012-10-13 16:30:39.000000000 -0400 --- Makefile.PL 2012-10-16 15:06:28.347500000 -0400 *************** *** 286,292 **** # -------------------------------------------------------------------------- # # fix the ld flags # -------------------------------------------------------------------------- # ! if ($config{LIBS} !~ /\-l(?:lib)?xml2\b/) { # in this case we are not able to run xml2-config. therefore we need to # expand the libz as well. if ($is_Win32) { --- 286,292 ---- # -------------------------------------------------------------------------- # # fix the ld flags # -------------------------------------------------------------------------- # ! if (!defined $config{LIBS} || $config{LIBS} !~ /\-l(?:lib)?xml2\b/) { # in this case we are not able to run xml2-config. therefore we need to # expand the libz as well. if ($is_Win32) { *************** *** 356,365 **** $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " }; } ! my $incpath = $config{INC}; ! $incpath =~ s#(\A|\s)\s*-I#$1#g; ! check_lib_or_exit( # fill in what you prompted the user for here lib => [qw(xml2)], incpath => [split(/\s/,$incpath)], --- 356,366 ---- $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " }; } ! unless ($^O =~ /MSWin/) { ! my $incpath = $config{INC}; ! $incpath =~ s#(\A|\s)\s*-I#$1#g; ! check_lib_or_exit( # fill in what you prompted the user for here lib => [qw(xml2)], incpath => [split(/\s/,$incpath)], *************** *** 389,395 **** 'libxml/xpath.h', 'libxml/xpathInternals.h', ], ! ); WriteMakefile( %INFOS, --- 390,397 ---- 'libxml/xpath.h', 'libxml/xpathInternals.h', ], ! ); ! } WriteMakefile( %INFOS, -- Sincerely, Desmond Daignault Senior Software Engineer   O'NEIL & ASSOCIATES, INC. 495 Byers Rd. Miamisburg, Ohio 45342-3662 Office: (937) 865-0846 ext. 3504 Fax: (937) 865-5858 E-mail: desmond.daignault@oneil.com REVOLUTIONIZING DOCUMENTATION >>> POWERING PRODUCT SUPPORT ********************************************************************** Confidentiality Notice The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited. **********************************************************************
Download (untitled) / with headers
text/plain 2.5k
Hi Desmond, On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote: Show quoted text
> On Windows, check_lib_or_exit always fails. No matter what I set INC= > to be on the command line. >
Devel::CheckLib should support Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where this is going wrong and fix it. You can use perl -d (the perl debugger) to assist you. Show quoted text
> When using Visual Studio, it looks at the environment variable INCLUDE > to find include headers and the environment variable LIB to find > library files.
Well, UNIX compilers are using different variables (see the gcc man page). The question is which env vars CL.EXE supports. Show quoted text
> > eg: > INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft > Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft > Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft > SDKs\Windows\v6.0A\include; > LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual > Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio > 9.0\VC\LIB;C:\P > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > In the example above, the libxml2 library was installed in > c:\project\win32\install\lib and c:\project\win32\install\include. > > If I remove the check_lib_or_exit function from Makefile.PL it builds > just fine when the environment has INCLUDE and LIB set correctly. > > Additionally a warning can be removed when checking to see if LIBS was > passed on the command line. >
the check_lib_or_exit call was added to prevent cases where the shared library can be found, but the headers cannot be found, which makes the build fails later. I'd rather not avoid it anywhere. Show quoted text
> > patch follows: >
The patch has two issues: 1. It is not in unified format - use diff -u next time (you can also send us a bitbucket pull request). 2. The second is: Show quoted text
> > ********************************************************************** > Confidentiality Notice > The information contained in this e-mail is confidential and intended > for use only by the person(s) or organization listed in the > address. If you have received this communication in error, please > contact the sender at O'Neil & Associates, Inc., immediately. Any > copying, dissemination, or distribution of this communication, > other than by the intended recipient, is strictly prohibited. > ********************************************************************** >
this disclaimer prevents us from using the patch for our FOSS project. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces
Date: Wed, 17 Oct 2012 13:34:57 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Download (untitled) / with headers
text/plain 3.1k
Went through it with the debugger, and it is failing on checking the LIB, even though you already checked it in the Makefile.PL and it passed. How should I call Makefile.PL so that it doesn't fail the 2nd check of linking to xml2? -- Dez. Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXML@rt.cpan.org] Sent: Tuesday, October 16, 2012 6:03 PM To: Desmond Daignault Subject: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces <URL: https://rt.cpan.org/Ticket/Display.html?id=80229 > Hi Desmond, On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote:
> On Windows, check_lib_or_exit always fails. No matter what I set INC= > to be on the command line. >
Devel::CheckLib should support Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where this is going wrong and fix it. You can use perl -d (the perl debugger) to assist you.
> When using Visual Studio, it looks at the environment variable INCLUDE > to find include headers and the environment variable LIB to find > library files.
Well, UNIX compilers are using different variables (see the gcc man page). The question is which env vars CL.EXE supports.
> > eg: > INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft > Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft > Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft > SDKs\Windows\v6.0A\include; > LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual > Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio > 9.0\VC\LIB;C:\P > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > In the example above, the libxml2 library was installed in > c:\project\win32\install\lib and c:\project\win32\install\include. > > If I remove the check_lib_or_exit function from Makefile.PL it builds > just fine when the environment has INCLUDE and LIB set correctly. > > Additionally a warning can be removed when checking to see if LIBS was > passed on the command line. >
the check_lib_or_exit call was added to prevent cases where the shared library can be found, but the headers cannot be found, which makes the build fails later. I'd rather not avoid it anywhere.
> > patch follows: >
The patch has two issues: 1. It is not in unified format - use diff -u next time (you can also send us a bitbucket pull request). 2. The second is:
> > ********************************************************************** > Confidentiality Notice > The information contained in this e-mail is confidential and intended > for use only by the person(s) or organization listed in the > address. If you have received this communication in error, please > contact the sender at O'Neil & Associates, Inc., immediately. Any > copying, dissemination, or distribution of this communication, > other than by the intended recipient, is strictly prohibited. > ********************************************************************** >
this disclaimer prevents us from using the patch for our FOSS project. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces
Date: Wed, 17 Oct 2012 13:44:10 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Ok. I got it to work by commenting out line 364 of Makefile.PL. You are already checking to see if linking works so there is no need to do it again in the check_lib_or_exit call. -- Dez. Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXML@rt.cpan.org] Sent: Tuesday, October 16, 2012 6:03 PM To: Desmond Daignault Subject: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces <URL: https://rt.cpan.org/Ticket/Display.html?id=80229 > Hi Desmond, On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote:
> On Windows, check_lib_or_exit always fails. No matter what I set INC= > to be on the command line. >
Devel::CheckLib should support Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where this is going wrong and fix it. You can use perl -d (the perl debugger) to assist you.
> When using Visual Studio, it looks at the environment variable INCLUDE > to find include headers and the environment variable LIB to find > library files.
Well, UNIX compilers are using different variables (see the gcc man page). The question is which env vars CL.EXE supports.
> > eg: > INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft > Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft > Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft > SDKs\Windows\v6.0A\include; > LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual > Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio > 9.0\VC\LIB;C:\P > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > In the example above, the libxml2 library was installed in > c:\project\win32\install\lib and c:\project\win32\install\include. > > If I remove the check_lib_or_exit function from Makefile.PL it builds > just fine when the environment has INCLUDE and LIB set correctly. > > Additionally a warning can be removed when checking to see if LIBS was > passed on the command line. >
the check_lib_or_exit call was added to prevent cases where the shared library can be found, but the headers cannot be found, which makes the build fails later. I'd rather not avoid it anywhere.
> > patch follows: >
The patch has two issues: 1. It is not in unified format - use diff -u next time (you can also send us a bitbucket pull request). 2. The second is:
> > ********************************************************************** > Confidentiality Notice > The information contained in this e-mail is confidential and intended > for use only by the person(s) or organization listed in the > address. If you have received this communication in error, please > contact the sender at O'Neil & Associates, Inc., immediately. Any > copying, dissemination, or distribution of this communication, > other than by the intended recipient, is strictly prohibited. > ********************************************************************** >
this disclaimer prevents us from using the patch for our FOSS project. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces
Date: Wed, 17 Oct 2012 13:56:16 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Download (untitled) / with headers
text/plain 3.4k
Also, it works if I change line 364 to show qw(libxml2). Not sure how to fix this so that it works all the time for everybody. If you want to use check_lib_or_exit to check linking too, and deprecate your own have_library function, it needs to check for both xml2 and libxml2 as well. I tried putting both xml2 and libxml2 in the libs[] for check_lib_or_exit but it fails on xml2. So it needs to be wrapped in an eval and called twice, once for xml2 and once for libxml2. This will allow you to deprecate your have_library function. -- Dez. Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXML@rt.cpan.org] Sent: Tuesday, October 16, 2012 6:03 PM To: Desmond Daignault Subject: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces <URL: https://rt.cpan.org/Ticket/Display.html?id=80229 > Hi Desmond, On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote:
> On Windows, check_lib_or_exit always fails. No matter what I set INC= > to be on the command line. >
Devel::CheckLib should support Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where this is going wrong and fix it. You can use perl -d (the perl debugger) to assist you.
> When using Visual Studio, it looks at the environment variable INCLUDE > to find include headers and the environment variable LIB to find > library files.
Well, UNIX compilers are using different variables (see the gcc man page). The question is which env vars CL.EXE supports.
> > eg: > INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft > Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft > Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft > SDKs\Windows\v6.0A\include; > LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual > Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio > 9.0\VC\LIB;C:\P > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > In the example above, the libxml2 library was installed in > c:\project\win32\install\lib and c:\project\win32\install\include. > > If I remove the check_lib_or_exit function from Makefile.PL it builds > just fine when the environment has INCLUDE and LIB set correctly. > > Additionally a warning can be removed when checking to see if LIBS was > passed on the command line. >
the check_lib_or_exit call was added to prevent cases where the shared library can be found, but the headers cannot be found, which makes the build fails later. I'd rather not avoid it anywhere.
> > patch follows: >
The patch has two issues: 1. It is not in unified format - use diff -u next time (you can also send us a bitbucket pull request). 2. The second is:
> > ********************************************************************** > Confidentiality Notice > The information contained in this e-mail is confidential and intended > for use only by the person(s) or organization listed in the > address. If you have received this communication in error, please > contact the sender at O'Neil & Associates, Inc., immediately. Any > copying, dissemination, or distribution of this communication, > other than by the intended recipient, is strictly prohibited. > ********************************************************************** >
this disclaimer prevents us from using the patch for our FOSS project. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces
Date: Wed, 17 Oct 2012 14:24:23 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Download (untitled) / with headers
text/plain 9.5k
Sorry for all the spam. Here is a patch that doesn't use your have_library function and only uses Devel-CheckLib. It should work for everybody. *** Makefile.PL.orig 2012-10-13 16:30:39.000000000 -0400 --- Makefile.PL 2012-10-17 09:13:57.972500000 -0400 *************** *** 286,292 **** # -------------------------------------------------------------------------- # # fix the ld flags # -------------------------------------------------------------------------- # ! if ($config{LIBS} !~ /\-l(?:lib)?xml2\b/) { # in this case we are not able to run xml2-config. therefore we need to # expand the libz as well. if ($is_Win32) { --- 286,292 ---- # -------------------------------------------------------------------------- # # fix the ld flags # -------------------------------------------------------------------------- # ! if (!defined $config{LIBS} || $config{LIBS} !~ /\-l(?:lib)?xml2\b/) { # in this case we are not able to run xml2-config. therefore we need to # expand the libz as well. if ($is_Win32) { *************** *** 327,365 **** # if the Build Target is set correctly. Otherwise we have to set it by # hand - # -------------------------------------------------------------------------- # - - # -------------------------------------------------------------------------- # - # test if the libraries are really installed! - unless (have_library("xml2") or have_library("libxml2")) { - print STDERR <<"DEATH"; - 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. - DEATH - exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors) - } - # -------------------------------------------------------------------------- # - - # -------------------------------------------------------------------------- # - # _NOW_ write the Makefile - my $ldflags = delete $config{LDFLAGS}; if ($ldflags) { $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " }; } ! my $incpath = $config{INC}; $incpath =~ s#(\A|\s)\s*-I#$1#g; ! check_lib_or_exit( # fill in what you prompted the user for here lib => [qw(xml2)], incpath => [split(/\s/,$incpath)], --- 327,344 ---- # if the Build Target is set correctly. Otherwise we have to set it by # hand my $ldflags = delete $config{LDFLAGS}; if ($ldflags) { $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " }; } ! my $incpath = $config{INC} || ""; $incpath =~ s#(\A|\s)\s*-I#$1#g; ! ! print "Checking for ability to link against xml2..."; ! if( ! check_lib( # fill in what you prompted the user for here lib => [qw(xml2)], incpath => [split(/\s/,$incpath)], *************** *** 389,395 **** 'libxml/xpath.h', 'libxml/xpathInternals.h', ], ! ); WriteMakefile( %INFOS, --- 368,430 ---- 'libxml/xpath.h', 'libxml/xpathInternals.h', ], ! )) { ! print "yes\n"; ! } else { ! print "no\n"; ! print "Checking for ability to link against libxml2..."; ! if( ! check_lib( ! # fill in what you prompted the user for here ! lib => [qw(libxml2)], ! incpath => [split(/\s/,$incpath)], ! header => ! [ ! 'libxml/c14n.h', ! 'libxml/catalog.h', ! 'libxml/entities.h', ! 'libxml/globals.h', ! 'libxml/HTMLparser.h', ! 'libxml/HTMLtree.h', ! 'libxml/parser.h', ! 'libxml/parserInternals.h', ! 'libxml/pattern.h', ! 'libxml/relaxng.h', ! 'libxml/tree.h', ! 'libxml/uri.h', ! 'libxml/valid.h', ! 'libxml/xinclude.h', ! 'libxml/xmlerror.h', ! 'libxml/xmlIO.h', ! 'libxml/xmlmemory.h', ! 'libxml/xmlreader.h', ! 'libxml/xmlregexp.h', ! 'libxml/xmlschemas.h', ! 'libxml/xmlversion.h', ! 'libxml/xpath.h', ! 'libxml/xpathInternals.h', ! ], ! )) { ! print "yes\n"; ! } else { ! print STDERR <<"DEATH"; ! 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. ! DEATH ! exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors) ! } ! } ! ! # -------------------------------------------------------------------------- # ! # _NOW_ write the Makefile WriteMakefile( %INFOS, *************** *** 681,732 **** return $result; } - sub have_library { - my ($lib, $func) = (@_, "blank"); - printf("checking for %s() in -l%s... ", $func, $lib) if $func ne "blank"; - printf("looking for -l%s... ", $lib) if $func eq "blank"; - - my $result; - if ($func) { - my $libs = $is_Win32 ? " $lib.lib " : "-l$lib"; - # my $libs = "-l$lib"; - if ($is_Win32) { - $result = try_link(<<"SRC", undef); - #include <windows.h> - #include <winsock.h> - blank() { return 0; } - int t() { ${func}(); return 0; } - SRC - unless ($result) { - $result = try_link(<<"SRC", undef); - #include <windows.h> - #include <winsock.h> - blank() { return 0; } - int t() { void ((*p)()); p = (void ((*)()))${func}; return 0; } - SRC - } - } - else { - $result = try_link(<<"SRC", undef); - blank() { return 0; } - int t() { ${func}(); return 0; } - SRC - } - } - - unless ($result) { - print "no\n"; - return 0; - } - - if ($func ne "main") { - $config{DEFINE} .= uc(" -Dhave_$func"); - } - - print "yes\n"; - return 1; - } - # -------------------------------------------------------------------------- # # try_libconfig class a generic config file and requests --version, --libs and # --cflags --- 716,721 ---- -- Dez. Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXML@rt.cpan.org] Sent: Tuesday, October 16, 2012 6:03 PM To: Desmond Daignault Subject: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces <URL: https://rt.cpan.org/Ticket/Display.html?id=80229 > Hi Desmond, On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote:
> On Windows, check_lib_or_exit always fails. No matter what I set INC= > to be on the command line. >
Devel::CheckLib should support Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where this is going wrong and fix it. You can use perl -d (the perl debugger) to assist you.
> When using Visual Studio, it looks at the environment variable INCLUDE > to find include headers and the environment variable LIB to find > library files.
Well, UNIX compilers are using different variables (see the gcc man page). The question is which env vars CL.EXE supports.
> > eg: > INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft > Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft > Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft > SDKs\Windows\v6.0A\include; > LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual > Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio > 9.0\VC\LIB;C:\P > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > In the example above, the libxml2 library was installed in > c:\project\win32\install\lib and c:\project\win32\install\include. > > If I remove the check_lib_or_exit function from Makefile.PL it builds > just fine when the environment has INCLUDE and LIB set correctly. > > Additionally a warning can be removed when checking to see if LIBS was > passed on the command line. >
the check_lib_or_exit call was added to prevent cases where the shared library can be found, but the headers cannot be found, which makes the build fails later. I'd rather not avoid it anywhere.
> > patch follows: >
The patch has two issues: 1. It is not in unified format - use diff -u next time (you can also send us a bitbucket pull request). 2. The second is:
> > ********************************************************************** > Confidentiality Notice > The information contained in this e-mail is confidential and intended > for use only by the person(s) or organization listed in the > address. If you have received this communication in error, please > contact the sender at O'Neil & Associates, Inc., immediately. Any > copying, dissemination, or distribution of this communication, > other than by the intended recipient, is strictly prohibited. > ********************************************************************** >
this disclaimer prevents us from using the patch for our FOSS project. Regards, -- Shlomi Fish
Download (untitled) / with headers
text/plain 10.4k
On Wed Oct 17 10:24:38 2012, desmond.daignault@oneil.com wrote: Show quoted text
> Sorry for all the spam. Here is a patch that doesn't use your > have_library function and only uses Devel-CheckLib. > > It should work > for everybody.
Thanks! However this patch is not in unfied diff format, and so I find it delightfully hard to follow. Please include a patch in that format - you can use gnudiff -u to generate it. You can find gnudiff in cygwin or in http://gnuwin32.sourceforge.net/packages/diffutils.htm (old version, but should work fine). As an alternative, you can send me a Bitbcuket pull request. Finally, I should note that it is possible you are listing all the headers and other parameters for check_lib() twice. If os, please extract them into a function or a variable. Regards, Shlomi Fish Show quoted text
> > > *** Makefile.PL.orig 2012-10-13 16:30:39.000000000 > -0400 > --- Makefile.PL 2012-10-17 09:13:57.972500000 -0400 > *************** > *** 286,292 **** > # > -------------------------------------------------------------------------- > # > # fix the ld flags > # > -------------------------------------------------------------------------- > # > ! if ($config{LIBS} !~ /\-l(?:lib)?xml2\b/) { > # in this case > we are not able to run xml2-config. therefore we need to > # > expand the libz as well. > if ($is_Win32) { > --- 286,292 ---- > # > -------------------------------------------------------------------------- > # > # fix the ld flags > # > -------------------------------------------------------------------------- > # > ! if (!defined $config{LIBS} || $config{LIBS} !~ /\- > l(?:lib)?xml2\b/) { > # in this case we are not able to run xml2- > config. therefore we need to > # expand the libz as well. > if > ($is_Win32) { > *************** > *** 327,365 **** > # if the Build > Target is set correctly. Otherwise we have to set it by > # hand > - # > -------------------------------------------------------------------------- > # > - > - # > -------------------------------------------------------------------------- > # > - # test if the libraries are really installed! > - unless > (have_library("xml2") or have_library("libxml2")) { > - print > STDERR <<"DEATH"; > - 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. > - DEATH > - exit 0; # 0 > recommended by http://cpantest.grango.org (Notes for CPAN Authors) > - > } > - # > -------------------------------------------------------------------------- > # > - > - # > -------------------------------------------------------------------------- > # > - # _NOW_ write the Makefile > - > my $ldflags = delete > $config{LDFLAGS}; > if ($ldflags) { > $config{dynamic_lib} = { > OTHERLDFLAGS => " $ldflags " }; > } > > ! my $incpath = > $config{INC}; > $incpath =~ s#(\A|\s)\s*-I#$1#g; > > ! > check_lib_or_exit( > # fill in what you prompted the user for > here > lib => [qw(xml2)], > incpath => > [split(/\s/,$incpath)], > --- 327,344 ---- > # if the Build Target is > set correctly. Otherwise we have to set it by > # hand > > my > $ldflags = delete $config{LDFLAGS}; > if ($ldflags) { > $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " }; > } > > ! > my $incpath = $config{INC} || ""; > $incpath =~ s#(\A|\s)\s*-I#$1#g; > ! > ! print "Checking for ability to link against xml2..."; > ! if( > ! > check_lib( > # fill in what you prompted the user for here > lib => [qw(xml2)], > incpath => [split(/\s/,$incpath)], > *************** > *** 389,395 **** > 'libxml/xpath.h', > 'libxml/xpathInternals.h', > ], > ! ); > > WriteMakefile( > %INFOS, > --- 368,430 ---- > 'libxml/xpath.h', > 'libxml/xpathInternals.h', > ], > ! )) { > ! print "yes\n"; > ! > } else { > ! print "no\n"; > ! print "Checking for ability to link > against libxml2..."; > ! if( > ! check_lib( > ! # fill in > what you prompted the user for here > ! lib => [qw(libxml2)], > ! > incpath => [split(/\s/,$incpath)], > ! header => > ! [ > ! > 'libxml/c14n.h', > ! 'libxml/catalog.h', > ! > 'libxml/entities.h', > ! 'libxml/globals.h', > ! > 'libxml/HTMLparser.h', > ! 'libxml/HTMLtree.h', > ! > 'libxml/parser.h', > ! 'libxml/parserInternals.h', > ! > 'libxml/pattern.h', > ! 'libxml/relaxng.h', > ! > 'libxml/tree.h', > ! 'libxml/uri.h', > ! > 'libxml/valid.h', > ! 'libxml/xinclude.h', > ! > 'libxml/xmlerror.h', > ! 'libxml/xmlIO.h', > ! > 'libxml/xmlmemory.h', > ! 'libxml/xmlreader.h', > ! > 'libxml/xmlregexp.h', > ! 'libxml/xmlschemas.h', > ! > 'libxml/xmlversion.h', > ! 'libxml/xpath.h', > ! > 'libxml/xpathInternals.h', > ! ], > ! )) { > ! print > "yes\n"; > ! } else { > ! print STDERR <<"DEATH"; > ! 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. > ! DEATH > ! exit 0; # 0 recommended by > http://cpantest.grango.org (Notes for CPAN Authors) > ! } > ! } > ! > ! > # > -------------------------------------------------------------------------- > # > ! # _NOW_ write the Makefile > > WriteMakefile( > %INFOS, > *************** > *** 681,732 **** > return $result; > } > - sub have_library { > - my ($lib, $func) = (@_, "blank"); > - > printf("checking for %s() in -l%s... ", $func, $lib) if $func ne > "blank"; > - printf("looking for -l%s... ", $lib) if $func eq > "blank"; > - > - my $result; > - if ($func) { > - my > $libs = $is_Win32 ? " $lib.lib " : "-l$lib"; > - # my $libs = > "-l$lib"; > - if ($is_Win32) { > - $result = > try_link(<<"SRC", undef); > - #include <windows.h> > - #include > <winsock.h> > - blank() { return 0; } > - int t() { ${func}(); return 0; > } > - SRC > - unless ($result) { > - $result > = try_link(<<"SRC", undef); > - #include <windows.h> > - #include > <winsock.h> > - blank() { return 0; } > - int t() { void ((*p)()); p = > (void ((*)()))${func}; return 0; } > - SRC > - } > - > } > - else { > - $result = try_link(<<"SRC", undef); > - blank() { return 0; } > - int t() { ${func}(); return 0; } > - SRC > - > } > - } > - > - unless ($result) { > - print "no\n"; > - > return 0; > - } > - > - if ($func ne "main") { > - > $config{DEFINE} .= uc(" -Dhave_$func"); > - } > - > - print > "yes\n"; > - return 1; > - } > - > # > -------------------------------------------------------------------------- > # > # try_libconfig class a generic config file and requests > --version, --libs and > # --cflags > --- 716,721 ---- > > > -- > Dez. > -----Original Message----- > From: Shlomi Fish via RT [mailto:bug-XML- > LibXML@rt.cpan.org] > Sent: Tuesday, October 16, 2012 6:03 PM > To: > Desmond Daignault > Subject: [rt.cpan.org #80229] Fails to create > Makefile on windows due to include path having spaces > > <URL: > https://rt.cpan.org/Ticket/Display.html?id=80229 > > > Hi Desmond, > On Tue Oct 16 16:44:49 2012, desmond.daignault@oneil.com wrote:
> > On
> Windows, check_lib_or_exit always fails. No matter what I set INC=
> >
> to be on the command line.
> >
> > Devel::CheckLib should support > Microsoft Visual C++ (CL.EXE) pretty well, and so you should see where > this is going wrong and fix it. You can use perl -d (the perl > debugger) to assist you. >
> > When using Visual Studio, it looks at
> the environment variable INCLUDE
> > to find include headers and the
> environment variable LIB to find
> > library files.
> > Well, UNIX > compilers are using different variables (see the gcc man page). The > question is which env vars CL.EXE supports. >
> > > > eg: > >
> INCLUDE=C:\project\win32\install\include;C:\Program Files\Microsoft
> >
> Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft
> >
> Visual Studio 9.0\VC\INCLUDE;C:\Program Files\\Microsoft
> >
> SDKs\Windows\v6.0A\include;
> >
> LIB=C:\project\win32\install\lib;C:\Program Files\Microsoft Visual
> >
> Studio 9.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio
> >
> 9.0\VC\LIB;C:\P
> > rogram Files\\Microsoft SDKs\Windows\v6.0A\lib; > > > > In the example above, the libxml2 library was installed in > >
> c:\project\win32\install\lib and c:\project\win32\install\include.
> > > > If I remove the check_lib_or_exit function from Makefile.PL it
> builds
> > just fine when the environment has INCLUDE and LIB set
> correctly.
> > > > Additionally a warning can be removed when checking
> to see if LIBS was
> > passed on the command line. > >
> > the > check_lib_or_exit call was added to prevent cases where the shared > library can be found, but the headers cannot be found, which makes the > build fails later. I'd rather not avoid it anywhere. >
> > > > patch
> follows:
> >
> > The patch has two issues: > > 1. It is not in unified > format - use diff -u next time (you can also send us a bitbucket pull > request). > > 2. The second is: >
> > > >
> **********************************************************************
> > Confidentiality Notice > > The information contained in this e-mail
> is confidential and intended
> > for use only by the person(s) or
> organization listed in the
> > address. If you have received this
> communication in error, please
> > contact the sender at O'Neil &
> Associates, Inc., immediately. Any
> > copying, dissemination, or
> distribution of this communication,
> > other than by the intended
> recipient, is strictly prohibited.
> >
> **********************************************************************
> >
> > this disclaimer prevents us from using the patch for our FOSS > project. > > Regards, > > -- Shlomi Fish
Subject: RE: [rt.cpan.org #80229] Fails to create Makefile on windows due to include path having spaces
Date: Wed, 17 Oct 2012 15:13:43 +0000
To: "bug-XML-LibXML [...] rt.cpan.org" <bug-XML-LibXML [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Download (untitled) / with headers
text/plain 17.1k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 248b
Hi, I applied a modified version of this patch and released it as XML-LibXML-2.0007. Thanks for the report and the patch. A few notes: 1. You should have avoided the duplicate code. I fixed it. 2. Please use 4-whitespace indents instead of 2.


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.