Subject: | Compilation failure on Windows |
ActiveState's compilation for Windows fails with
cp Shapelib/contrib/makefile.vc blib\lib\Geo\Shapelib/contrib/makefile.vc
cp Shapelib/ChangeLog blib\lib\Geo\Shapelib/ChangeLog
cmakefile(314) : fatal error U1033: syntax error : '$(AR)' unexpected
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
It seems that nmake is whinging about an extra space after the libshp line.
I've also added a runtime check to use either "lib" or "ar"
Makefile attached (compiles under Visual Studio 2005 - not tested under
linux)
Subject: | Makefile.PL |
use ExtUtils::MakeMaker;
$Verbose = 1;
my @incdirs = ('/usr/include','/usr/local/include');
my $incs = '';
foreach (@incdirs) {
$incs .= " -I$_";
}
WriteMakefile(
NAME => 'Geo::Shapelib::shputils',
INC => $incs,
# for GNU Linux use this:
DEFINE => '-ggdb -Wall -DDEBUG',
# for W2k Visual Studio 6 use this:
# DEFINE => '-ggdb -DDEBUG',
clean => {'FILES' => 'libshp$(LIB_EXT)'},
);
sub MY::top_targets {
my $libcmd;
if ($^O =~ /win32/i) {
# for W2k Visual Studio 6 use this:
$libcmd = '$(AR) /OUT:libshp$(LIB_EXT) $(O_FILES)';
} else {
# for GNU Linux use this:
$libcmd = '$(AR) /OUT:libshp$(LIB_EXT) $(O_FILES)';
}
'
pure_all ::
all :: static
static :: libshp$(LIB_EXT)
'.
'libshp$(LIB_EXT) :: $(O_FILES)
'. $libcmd . '
$(RANLIB) libshp$(LIB_EXT)
';
}