Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 7286
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: corion [...] cpan.org
Cc:
AdminCc:

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



Subject: Makefile.PL / make fails if spaces are in paths (Win32)
If the library search paths contain spaces (as is the case with the MSVC7 default install), Makefile.PL does not find the referenced libraries and creates invalid Makefile commands because the parameters are not quoted properly. The following diff is what I had to do to get "nmake" to work. On an aside, it seems that Imager does not build properly if no imaging library out of jpeg/tiff/png/gif is available. This could be detected in Makefile.PL ... Anyway, here's the diff: 53,54c53,54 < $F_INC = join(" ",map { (exists $definc{$_})?'':'-I'.$_ } @incs); < $F_LIBS = join(" ",map { '-L'.$_ } @libs).' '.$F_LIBS; --- Show quoted text
> $F_INC = join(" ",map { (exists $definc{$_})?'': do {/ / ? qq{"-I$_"} : '-I'.$_} } @incs); > $F_LIBS = join(" ",map { / / ? qq{"-L$_"} : qq{-L$_} } @libs).' '.$F_LIBS;
267c267 < @libs=(qw(/sw/lib), split(/\Q$Config{path_sep}/,$LIBPATH) , split(/ /, $Config{'libpth'})); --- Show quoted text
> @libs=(qw(/sw/lib), split(/\Q$Config{path_sep}/,$LIBPATH) , split(/\Q$Config{'path_sep'}/, $Config{'libpth'}));
269,270c269,270 < push(@incs, split /;/, $ENV{INCLUDE}) if exists $ENV{INCLUDE}; < push(@libs, split /;/, $ENV{LIB}) if exists $ENV{LIB}; --- Show quoted text
> push(@incs, split /\Q$Config{path_sep}\E/, $ENV{INCLUDE}) if exists $ENV{INCLUDE}; > push(@libs, split /\Q$Config{path_sep}\E/, $ENV{LIB}) if exists $ENV{LIB};
Summary of my perl5 (revision 5 version 8 subversion 5) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DE S_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl\5.8.5\lib\CORE " -machine:x86' libpth=C:\Programme\Microsoft Visual C++ Toolkit 2003\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib sh ell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib o dbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.li b shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.l ib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl\5.8 .5\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT PERL_IMPLICI T_SYS Built under MSWin32 Compiled at Aug 6 2004 13:59:40 @INC: c:/perl/5.8.5/lib c:/perl/site/5.8.5/lib .
Download Makefile.PL.win32
application/octet-stream 12.1k

Message body not shown because it is not plain text.

From: Tony Cook <tony [...] develop-help.com>
Date: Sun, 8 Aug 2004 14:00:03 +1000
To: via RT <bug-Imager [...] rt.cpan.org>
Subject: Re: [cpan #7286] Makefile.PL / make fails if spaces are in paths (Win32)
RT-Send-Cc:
On Sat, Aug 07, 2004 at 12:43:16PM -0400, via RT wrote: Show quoted text
> > This message about Imager was sent to you by CORION <CORION@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=7286 > > > If the library search paths contain spaces (as is the case with the MSVC7 default install), Makefile.PL does not find the referenced libraries and creates invalid Makefile commands because the parameters are not quoted properly. The following diff is what I had to do to get "nmake" to work.
Thanks for this, I'll look at integrating it in the next few days. Show quoted text
>On an aside, it seems that Imager does not build properly if no imaging library out of jpeg/tiff/png/gif is available. This could be detected in Makefile.PL ... Anyway, here's the diff:
I've built and tested Imager with not image format libraries available a few times. You will see it skip tests for the image format libraries it can't find but it still builds and tests correctly. If you're seeing a build failure with Imager under those circumstances please give me a log of the failure. If you can, please try the version currently in CVS: cvs -d :pserver:anoncvs@cvs.imager.perl.org:/u02/cvsroot co Imager Tony Show quoted text
> > 53,54c53,54 > < $F_INC = join(" ",map { (exists $definc{$_})?'':'-I'.$_ } @incs); > < $F_LIBS = join(" ",map { '-L'.$_ } @libs).' '.$F_LIBS; > ---
> > $F_INC = join(" ",map { (exists $definc{$_})?'': do {/ / ? qq{"-I$_"} : '-I'.$_} } @incs); > > $F_LIBS = join(" ",map { / / ? qq{"-L$_"} : qq{-L$_} } @libs).' '.$F_LIBS;
> 267c267 > < @libs=(qw(/sw/lib), split(/\Q$Config{path_sep}/,$LIBPATH) , split(/ /, $Config{'libpth'})); > ---
> > @libs=(qw(/sw/lib), split(/\Q$Config{path_sep}/,$LIBPATH) , split(/\Q$Config{'path_sep'}/, $Config{'libpth'}));
> 269,270c269,270 > < push(@incs, split /;/, $ENV{INCLUDE}) if exists $ENV{INCLUDE}; > < push(@libs, split /;/, $ENV{LIB}) if exists $ENV{LIB}; > ---
> > push(@incs, split /\Q$Config{path_sep}\E/, $ENV{INCLUDE}) if exists $ENV{INCLUDE}; > > push(@libs, split /\Q$Config{path_sep}\E/, $ENV{LIB}) if exists $ENV{LIB};
> > Summary of my perl5 (revision 5 version 8 subversion 5) configuration: > Platform: > osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread > uname='' > config_args='undef' > hint=recommended, useposix=true, d_sigaction=undef > usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define > useperlio=define d_sfio=undef uselargefiles=define usesocks=undef > use64bitint=undef use64bitall=undef uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DE > S_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', > optimize='-MD -Zi -DNDEBUG -O1', > cppflags='-DWIN32' > ccversion='', gccversion='', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 > d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 > ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl\5.8.5\lib\CORE > " -machine:x86' > libpth=C:\Programme\Microsoft Visual C++ Toolkit 2003\lib > libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib sh > ell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib o > dbc32.lib odbccp32.lib msvcrt.lib > perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.li > b shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.l > ib odbc32.lib odbccp32.lib msvcrt.lib > libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib > gnulibc_version='undef' > Dynamic Linking: > dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' > cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl\5.8 > .5\lib\CORE" -machine:x86' > > > Characteristics of this binary (from libperl): > Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT PERL_IMPLICI > T_SYS > Built under MSWin32 > Compiled at Aug 6 2004 13:59:40 > @INC: > c:/perl/5.8.5/lib > c:/perl/site/5.8.5/lib > .
I've applied a change similar to your to current CVS. If you want to give it a go, please try building from CVS: cvs -d :pserver:anoncvs@cvs.imager.perl.org:/u02/cvsroot co Imager Let me know if you have any problems. -- Thanks Tony Cook