On Fri, Feb 11, 2011 at 5:48 PM, Michael Miller <[email protected]> wrote:
> I'm still having trouble and need some more advice. I created a simple
> testy.pl script with the following in it:
>
> use Digest::SHA;
> print "Hello world";
>
> When I run "perl testy.pl" I get "Hello world" printed to the console. So it
> works fine.
>
> Then I try:
>
> pp -o testy testy.pl
Can you run
$ unzip -l testy | grep Digest
This should print something like (the last line is crucial)
3599 2011-02-12 16:15 lib/Digest/SHA.pm
1160 2011-02-12 16:15 lib/Digest/base.pm
52560 2011-02-06 16:39 lib/auto/Digest/SHA/SHA.so
> I was able to get 1.008 to compile on my box after altering the following
> line of perl in file2c.pl inside the myldr directory of the PAR-Packer
> project from SVN :
>
> print $out "const char ${c_var}${suffix}[] = ";
> to
> print $out "const char ${c_var}${suffix} [] = ";
> (there's a space between ${suffix} and the [])
>
> Without the space my gcc compiler on my SCO VM failed to compile with the
> following error:
> make[1]: Entering directory `/LDM/packages/PAR-Packer-1.008/myldr'
> perl ./file2c.pl -s ../script/par.pl -l my_par_pl.c load_my_par_pl
> Global symbol "@suffix" requires explicit package name at ./file2c.pl line 76.
> Execution of ./file2c.pl aborted due to compilation errors.
Err, that error is not from gcc, but from Perl. Apparently a bug in
your bronze-age Perl (5.8.0) -
all Perl versions I could easily try out (5.8.8, 5.10.1, 5.12.3)
correctly stop variable
interpolation of "...${suffix}..." at the closing brace. But the
inserted blank shouldn't hurt
the generated C source.
> Also note that Digest::SHA is installed and up to date. From cpan I ran
> "install Digest::SHA" and I got a message that Digest::SHA is up to date
> (5.50).
OK, let's try if your problem is really the same as
http://markmail.org/thread/ec4x27uqd6ujtnjq
First apply the following patch to PAR, then build and install it:
--- PAR/lib/PAR/SetupTemp.pm~ 2010-07-28 21:17:15.978076303 +0200
+++ PAR/lib/PAR/SetupTemp.pm 2011-02-12 17:05:02.016431954 +0100
@@ -48,7 +48,7 @@
my $ctx = _get_digester();
# Workaround for bug in Digest::SHA 5.38 and 5.39
- my $sha_version = eval { $Digest::SHA::VERSION } || 0;
+ my $sha_version = 0;
if ($sha_version eq '5.38' or $sha_version eq '5.39') {
$ctx->addfile($PAR::SetupProgname::Progname, "b") if ($ctx);
Then apply the following patch to PAR::Packer, then build and install it:
--- PAR-Packer/script/par.pl~ 2011-02-09 18:09:39.281196177 +0100
+++ PAR-Packer/script/par.pl 2011-02-12 17:03:49.990387919 +0100
@@ -619,7 +619,7 @@
|| eval { require Digest::MD5; Digest::MD5->new };
# Workaround for bug in Digest::SHA 5.38 and 5.39
- my $sha_version = eval { $Digest::SHA::VERSION } || 0;
+ my $sha_version = 0;
if ($sha_version eq '5.38' or $sha_version eq '5.39') {
$ctx->addfile($out, "b") if ($ctx);
}
@@ -805,7 +805,7 @@
|| eval { require Digest::MD5; Digest::MD5->new };
# Workaround for bug in Digest::SHA 5.38 and 5.39
- my $sha_version = eval { $Digest::SHA::VERSION } || 0;
+ my $sha_version = 0;
if ($sha_version eq '5.38' or $sha_version eq '5.39') {
$ctx->addfile($progname, "b") if ($ctx);
}
Finally, re-pack testy.pl and try testy.
Only if that doesn't work: there's a diagnostic script,
contrib/extract_embedded/extract-embedded.pl, in the PAR::Packer sources.
Can you run it on testy like this:
$ mkdir testy.embedded
$ perl .../contrib/extract_embedded/extract-embedded.pl testy testy.embedded
I'm interested in the files
testy.embedded/XSLoader.pm
testy.embedded/DynaLoader.pm
testy.embedded/auto/DynaLoader/*.al
Cheers, Roderich