Subject: | makemaker build doesn't work on solaris w/cc |
Date: | Mon, 8 Jan 2007 18:26:05 -0500 (EST) |
To: | bug-version [...] rt.cpan.org |
From: | Chaskiel Grundman <cg2v [...] andrew.cmu.edu> |
CPAN.pm: Going to build J/JP/JPEACOCK/version-0.68.tar.gz
Testing if you have a C compiler
ld: fatal: file test.o: unknown file type
ld: fatal: File processing errors. No output written to test.o
I cannot determine if you have a C compiler
so I will install a perl-only implementation
You can force installation of the XS version with
perl Makefile.PL --xs
Checking if your kit is complete...
Looks good
Writing Makefile for version
cp lib/version.pm blib/lib/version.pm
cp lib/version.pod blib/lib/version.pod
cp vperl/vpp.pm blib/lib/version/vpp.pm
Running Mkbootstrap for version ()
chmod 644 version.bs
rm -f blib/arch/auto/version/version.so
/opt/SUNWspro/bin/cc -G -L/opt/SUNWspro/prod/lib -L/usr/contributed/lib
-L/usr/local/lib version.o -o blib/arch/auto/version/version.so \
\
ld: fatal: file version.o: open failed: No such file or directory
ld: fatal: File processing errors. No output written to
blib/arch/auto/version/version.so
gmake: *** [blib/arch/auto/version/version.so] Error 1
There seem to be two problems.
One is that _check_for_compiler_manually uses $Config{obj_ext} instead of
$Config{exe_ext} (or that a '-c' is missing from the $cc command line)
The other is that no_cc() does not seem to do the right thing. if I 'perl
Makefile.PL --perl_only', then the bogus version.so stuff doesn't happen.
This seems to be because write_makefile() is called while test.c still
exists.
The following patch seems to fix both problems (I tested each
independently)
--- version-0.68y/Makefile.PL Mon Jan 8 18:18:57 2007
+++ version-0.68/Makefile.PL Mon Jan 8 18:21:52 2007
@@ -28,7 +28,7 @@
check_for_compiler()
or no_cc();
- map { unlink $_ if -f $_ } ('test.c',"test$Config{obj_ext}");
+ map { unlink $_ if -f $_ } ('test.c',"test$Config{exe_ext}");
}
@@
-101,8 +101,6 @@
EOF
- write_makefile();
- exit;
}
sub check_for_compiler
@@ -146,7 +144,7 @@
$cc .= ' -c'; # prevent it from calling the linker
}
- system( "$cc -o test$Config{obj_ext} test.c" ) and return 0;
+ system( "$cc -o test$Config{exe_ext} test.c" ) and return 0;
return 1;
}