Skip Menu |
 

This queue is for tickets about the Tcl CPAN distribution.

Report information
The Basics
Id: 27636
Status: resolved
Priority: 0/
Queue: Tcl

People
Owner: Nobody in particular
Requestors: unobe@cpan.org (no email address)
Cc:
AdminCc:

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



Subject: Tcl.xs error w/dmake on strawberry perl
Download (untitled) / with headers
text/plain 1.9k
I'm using Strawberry Perl to install the Tcl module (having installed ActiveTcl), and am running into an XS compilation problem. Searching briefly on Google makes it seem that it might be a gcc problem, but wanted to report it here to make sure it's something that can't be fixed in Tcl.xs. Here's the relevant output and any pointers would be appreciated: C:\DOCUME~1\Owner\LOCALS~1\Temp\cpan\build\Tcl-0.95>perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. C:\DOCUME~1\Owner\LOCALS~1\Temp\cpan\build\Tcl-0.95>perl Makefile.PL tclsh=C:/Tcl/bin/tclsh.exe tclConfig.sh=C:/Tcl/lib/tclConfig.sh tcl_library=C:/Tcl/lib/tcl8.4 tcl_version=8.4 LIBS = -LC:/Tcl/lib -ltcl84 INC = -IC:/Tcl/include DEFINE = Checking if your kit is complete... Looks good Note (probably harmless): No library found for -ltcl84 Writing Makefile for Tcl C:\DOCUME~1\Owner\LOCALS~1\Temp\cpan\build\Tcl-0.95>dmake cp Tcl.pm blib\lib\Tcl.pm C:\strawberry-perl\perl\bin\perl.exe C:\strawberry-perl\perl\lib\ExtUtils\xsubpp -typemap C:\strawberry-perl\perl\lib\ExtUtils\typemap -typemap typemap Tcl.xs > Tcl.xsc && C:\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e mv Tcl.xsc Tcl.c Please specify prototyping behavior for Tcl.xs (see perlxs manual) gcc -c -IC:/Tcl/include -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"0.95\" -DXS_VERSION=\"0.95\" "-IC:\strawberry-perl\perl\lib\CORE" Tcl.c Tcl.xs:127: error: initializer element is not constant dmake: Error code 129, while making 'Tcl.o'
Download (untitled) / with headers
text/plain 169b
I've attached a patch to fix the problem. (I had to use g++ as the compiler.) After copying C:\Tcl\lib\tcl84.lib to C:\Tcl\lib\tcl84.a, it builds and all the tests pass.
diff -u Tcl-0.95/Makefile.PL Tcl-0.95-patched/Makefile.PL --- Tcl-0.95/Makefile.PL 2007-05-11 23:52:30.000000000 -0700 +++ Tcl-0.95-patched/Makefile.PL 2007-06-19 14:09:47.875000000 -0700 @@ -182,6 +182,9 @@ if ($^O eq 'MSWin32') { $tclver=~s/\.//; $defs .= " -DTCL_LIB_FILE=\\\"tcl$tclver.dll\\\"" if $usestubs; + + # Use g++ if using strawberry perl + @extraargs = (CC => 'g++') if $^X =~ /strawberry/; } elsif ($^O eq 'freebsd') { $tclver=~s/\.//; @@ -247,8 +250,18 @@ } } -sub MY::libscan { +package MY; # so that "SUPER" works right +sub libscan { my($self, $path) =@_; return '' if $path =~ /\.pl$/i; return $path; } + +sub c_o { + my $inherited = shift->SUPER::c_o(@_); + + # Fix for strawberry perl build + $inherited =~ s/\bgcc\b/\$(CCCMD)/g if $^X =~ /strawberry/; + + $inherited; +} diff -u Tcl-0.95/Tcl.xs Tcl-0.95-patched/Tcl.xs --- Tcl-0.95/Tcl.xs 2007-05-11 11:07:50.000000000 -0700 +++ Tcl-0.95-patched/Tcl.xs 2007-06-19 13:06:54.906250000 -0700 @@ -591,7 +591,7 @@ STRLEN len; char *s = SvPV(sv, len); char *end = s + len; - while ((nul_start = memchr(s, '\300', len))) { + while ((nul_start = (char*)memchr(s, '\300', len))) { if (nul_start + 1 < end && nul_start[1] == '\200') { /* found it */ nul_start[0] = '\0'; @@ -681,7 +681,7 @@ char *s = SvPV(sv_copy, len); char *nul; - while ((nul = memchr(s, '\0', len))) { + while ((nul = (char*)memchr(s, '\0', len))) { STRLEN i = nul - SvPVX(sv_copy); s = SvGROW(sv_copy, SvCUR(sv_copy) + 2); nul = s + i; @@ -956,8 +956,8 @@ MODULE = Tcl PACKAGE = Tcl PREFIX = Tcl_ SV * -Tcl__new(class = "Tcl") - char * class +Tcl__new(Class = "Tcl") + char * Class CODE: RETVAL = newSV(0); /* @@ -972,7 +972,7 @@ (void) hv_store(hvInterps, (const char *) &interp, sizeof(Tcl), &PL_sv_undef, 0); } - sv_setref_pv(RETVAL, class, (void*)interp); + sv_setref_pv(RETVAL, Class, (void*)interp); } OUTPUT: RETVAL
Download (untitled) / with headers
text/plain 275b
On Tue Jun 19 17:20:11 2007, UNOBE wrote: Show quoted text
> I've attached a patch to fix the problem. (I had to use g++ as the > compiler.) After copying C:\Tcl\lib\tcl84.lib to C:\Tcl\lib\tcl84.a, it > builds and all the tests pass.
thanks, the patch will be applied in next release (1.03)


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.