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
.
Message body not shown because it is not plain text.