r66266 - in /trunk/libpar-packer-perl: ./ debian/ inc/Test/Builder/IO/ lib/ lib/PAR/ myldr/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Dec 24 23:56:27 UTC 2010
Author: jawnsy-guest
Date: Fri Dec 24 23:56:21 2010
New Revision: 66266
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66266
Log:
* New upstream release
* Standards-Version 3.9.1 (no changes)
* Fix licensing for myldr/env.c (BSD license)
* Refresh copyright information
Added:
trunk/libpar-packer-perl/inc/Test/Builder/IO/
- copied from r66258, branches/upstream/libpar-packer-perl/current/inc/Test/Builder/IO/
trunk/libpar-packer-perl/t/90-rt59710.t
- copied unchanged from r66258, branches/upstream/libpar-packer-perl/current/t/90-rt59710.t
Modified:
trunk/libpar-packer-perl/ChangeLog
trunk/libpar-packer-perl/MANIFEST
trunk/libpar-packer-perl/MANIFEST.SKIP
trunk/libpar-packer-perl/META.yml
trunk/libpar-packer-perl/Makefile.PL
trunk/libpar-packer-perl/debian/changelog
trunk/libpar-packer-perl/debian/control
trunk/libpar-packer-perl/debian/copyright
trunk/libpar-packer-perl/lib/PAR/Packer.pm
trunk/libpar-packer-perl/lib/pp.pm
trunk/libpar-packer-perl/myldr/Makefile.PL
trunk/libpar-packer-perl/myldr/file2c.pl
trunk/libpar-packer-perl/myldr/main.c
trunk/libpar-packer-perl/myldr/mktmpdir.h
trunk/libpar-packer-perl/myldr/static.c
trunk/libpar-packer-perl/t/30-current_exec.t
Modified: trunk/libpar-packer-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/ChangeLog?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/ChangeLog (original)
+++ trunk/libpar-packer-perl/ChangeLog Fri Dec 24 23:56:21 2010
@@ -1,3 +1,47 @@
+[Changes for 1.008 - Nov 21, 2010]
+* Bug fixes, etc.
+
+ - RT #61528: bug similar to RT 55994
+ (Windows) relax heuristic to check whether the configured C compiler
+ is actually gcc (Ed Zagar)
+ - RT #61874: Windows: Packed executable handles wildcards different from script
+ myldr/static.c: turn off automatic globbing of process arguments when
+ building with MingW (Roderich)
+ - RT #62357: .cgi extension not taken as script
+ call into Module::ScanDeps with $Module::ScanDeps::ScanFileRE
+ set to qr/./ so that we don't discriminate against scripts that have
+ an extension other than .pl, .pm, .al or .t (or no extension at all)
+ (Roderich)
+ - RT #63083: pp: Undefined subroutine &DynaLoader::bootstrap called in pp-compiled bianry
+ fix the name where the shared perl DSO ($libperl in myldr/Makefile.PL)
+ is extracted to so that it matches the reference the linker wrote into
+ $par_exe; heuristic currently only available for Linux (assuming
+ we have GNU binutils installed), but might work on other ELF-based
+ systems, too (Roderich)
+ - t/30-current_exec.t: fix a test failure on Cygwin
+ (cygwin.dll was not on PATH) (Roderich)
+
+[Changes for 1.007 - Sep 9, 2010]
+* Bug fixes, etc.
+ - RT #56582: PAR-packer compilation on Windows XP32 box
+ applied patch from Jean-Michel Male to fix building with
+ Microsoft Visual Studio (Roderich)
+ - RT #50747: (no subject)
+ finally use permissions 0775 in my_mkfile() (Roderich)
+ - require modern Module::Install (chorny)
+ and update Module::Install et al. to version 1.00 (Roderich)
+ - RT #59710: Par-Packer not including all dependencies
+ When cleaning @INC at the end of bootstrapping (just before
+ we run the actual packed script) canonicalize $ENV{PAR_TEMP}
+ before we use it to match elements of @INC.
+ This works around non-canonicalized values (e.g. a trailing slash)
+ for $ENV{TMPDIR} or P_tmpdir (as #define'd in <stdio.h>)
+ (the latter seen on FreeBSD and OSX) (Roderich)
+ - RT #56020: PAR::Packer and PDF::API2 Unicode::UCD: failed to find UnicodeData.txt
+ that's actually a bug in Module::ScanDeps);
+ bump requirement on Module::ScanDeps to a versionthat has the fix
+ (correct %Preload rule for Unicode::UCD)
+
[Changes for 1.006 - Jun 26, 2010]
* Bug fixes, etc.
- RT #58266: fix "install PAR::Packer failed for strawberry perl 5.12.0.1
Modified: trunk/libpar-packer-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/MANIFEST?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/MANIFEST (original)
+++ trunk/libpar-packer-perl/MANIFEST Fri Dec 24 23:56:21 2010
@@ -30,6 +30,7 @@
inc/parent.pm
inc/PerlIO.pm
inc/Test/Builder.pm
+inc/Test/Builder/IO/Scalar.pm
inc/Test/Builder/Module.pm
inc/Test/More.pm
lib/App/Packer/PAR.pm
@@ -76,5 +77,6 @@
t/20-pp.t
t/30-current_exec.t
t/40-packer_cd_option.t
+t/90-rt59710.t
t/test-proc
TODO
Modified: trunk/libpar-packer-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/MANIFEST.SKIP?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/MANIFEST.SKIP (original)
+++ trunk/libpar-packer-perl/MANIFEST.SKIP Fri Dec 24 23:56:21 2010
@@ -22,5 +22,7 @@
^blibdirs
\B\.svn\b
^debian/
+^_Inline/
+^a\.out$
^nohup.out
^PAR-Packer-.*
Modified: trunk/libpar-packer-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/META.yml?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/META.yml (original)
+++ trunk/libpar-packer-perl/META.yml Fri Dec 24 23:56:21 2010
@@ -25,11 +25,11 @@
Compress::Zlib: 1.3
File::Temp: 0.05
Getopt::ArgvFile: 1.07
- Module::ScanDeps: 0.96
+ Module::ScanDeps: 0.98
PAR: 1.000
PAR::Dist: 0.22
perl: 5.6.1
resources:
license: http://dev.perl.org/licenses/
repository: http://svn.openfoundry.org/par/PAR-Packer/trunk
-version: 1.006
+version: 1.008
Modified: trunk/libpar-packer-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/Makefile.PL?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/Makefile.PL (original)
+++ trunk/libpar-packer-perl/Makefile.PL Fri Dec 24 23:56:21 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use 5.006001;
use strict;
-use inc::Module::Install;
+use inc::Module::Install 0.92;
name 'PAR-Packer';
abstract 'PAR Packager';
@@ -11,7 +11,7 @@
requires 'File::Temp' => 0.05;
requires 'Compress::Zlib' => ($^O eq 'MSWin32') ? 1.16 : 1.30;
requires 'Archive::Zip' => 1.00;
-requires 'Module::ScanDeps' => 0.96;
+requires 'Module::ScanDeps' => 0.98;
requires 'PAR::Dist' => 0.22;
requires 'PAR' => '1.000';
requires 'Getopt::ArgvFile' => 1.07;
@@ -110,8 +110,8 @@
clean_files(@bin) if $par or $cc;
# Do not run 10parl-generation tests in case of a pre built .par (doesn't work)
- my $pgentest = (!$par and $cc) ? ' t/10-parl-generation.t ' : '';
- my $tests = qq(t/00-pod.t$pgentest t/20-pp.t t/30-current_exec.t t/40-packer_cd_option.t);
+ my %tests = map { $_ => 1 } <t/*.t>;
+ delete $tests{'t/10-parl-generation.t'} unless (!$par and $cc);
makemaker_args(
MAN1PODS => {
@@ -139,7 +139,7 @@
) : (),
],
NEEDS_LINKING => 1,
- test => { TESTS => $tests },
+ test => { TESTS => join(" ", sort keys %tests) },
);
}
Modified: trunk/libpar-packer-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/debian/changelog?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/debian/changelog (original)
+++ trunk/libpar-packer-perl/debian/changelog Fri Dec 24 23:56:21 2010
@@ -1,3 +1,12 @@
+libpar-packer-perl (1.008-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Standards-Version 3.9.1 (no changes)
+ * Fix licensing for myldr/env.c (BSD license)
+ * Refresh copyright information
+
+ -- Jonathan Yu <jawnsy at cpan.org> Fri, 24 Dec 2010 19:07:39 -0500
+
libpar-packer-perl (1.006-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libpar-packer-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/debian/control?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/debian/control (original)
+++ trunk/libpar-packer-perl/debian/control Fri Dec 24 23:56:21 2010
@@ -5,7 +5,7 @@
libarchive-zip-perl (>= 1),
libgetopt-argvfile-perl (>= 1.07),
libinline-perl,
- libmodule-scandeps-perl (>= 0.96),
+ libmodule-scandeps-perl (>= 0.98),
libpar-perl (>= 1.000),
libperl-dev,
libtest-pod-perl,
@@ -15,7 +15,7 @@
gregor herrmann <gregoa at debian.org>, Niko Tyni <ntyni at debian.org>,
Ryan Niebur <ryan at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
Chris Butler <chrisb at debian.org>
-Standards-Version: 3.9.0
+Standards-Version: 3.9.1
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libpar-packer-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libpar-packer-perl/
Homepage: http://par.perl.org/
@@ -26,7 +26,7 @@
perl (>= ${perl:current}), perl (<< ${perl:next}),
libarchive-zip-perl (>= 1),
libgetopt-argvfile-perl (>= 1.07),
- libmodule-scandeps-perl (>= 0.96),
+ libmodule-scandeps-perl (>= 0.98),
libpar-dist-perl (>= 0.22),
libpar-perl (>= 1.000),
perl (>= 5.10) | libio-compress-perl | libcompress-zlib-perl (>= 1.3)
Modified: trunk/libpar-packer-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/debian/copyright?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/debian/copyright (original)
+++ trunk/libpar-packer-perl/debian/copyright Fri Dec 24 23:56:21 2010
@@ -32,24 +32,24 @@
License: Artistic or GPL-1+
Files: lib/PAR/Filter/Bleach.pm, lib/PAR/Filter/PatchContent.pm, lib/PAR/Filter/Obfuscate.pm
-Copyright: Copyright 2003-2009 by Audrey Tang <cpan at audreyt.org>.
+Copyright: 2003-2009, Audrey Tang <cpan at audreyt.org>.
License: Artistic or GPL-1+
Files: lib/PAR/Filter/PatchContent.pm
-Copyright: Copyright 2003, 2004, 2005, 2006, 2007, 2008 by Audrey Tang <cpan at audreyt.org>
+Copyright: 2003-2008, Audrey Tang <cpan at audreyt.org>
License: Artistic or GPL-1+
Files: lib/PAR/StrippedPARL/Dynamic.pm, lib/PAR/StrippedPARL/Static.pm, lib/PAR/StrippedPARL/Base.pm
-Copyright: Copyright 2006-2009 by Steffen Mueller <smueller at cpan.org>.
+Copyright: 2006-2009, Steffen Mueller <smueller at cpan.org>.
License: Artistic or GPL-1+
Files: myldr/encode_append.pl
-Copyright: copyright 2006-2009, Steffen Mueller
+Copyright: 2006-2009, Steffen Mueller
License: Artistic or GPL-1+
Files: myldr/Makefile.PL
-Copyright: Copyright 2002, 2003, 2004, 2005, 2006 by Audrey Tang,
- Copyright (c) 2002 Mattia Barbon.
+Copyright: 2002-2006, Audrey Tang
+ 2002, Mattia Barbon.
License: Artistic or GPL-1+
Files: myldr/utils.c
@@ -57,20 +57,20 @@
License: Artistic or GPL-1+
Files: myldr/file2c.pl
-Copyright Copyright (c) 2002 Mattia Barbon,
- Copyright (c) 2002 Audrey Tang.
+Copyright: 2002, Mattia Barbon
+ 2002, Audrey Tang.
License: Artistic or GPL-1+
Files: myldr/env.c
-Copyright: Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved.
-License: Artistic or GPL-1+
+Copyright: 1987-1993, The Regents of the University of California
+License: BSD
Files: script/par.pl, script/parl.pod
Copyright: Copyright 2002-2009 by Audrey Tang
License: Artistic or GPL-1+
Files: script/tkpp
-Copyright: Copyright 2003, 2004, 2005, 2006 by Doug Gruber <doug(a)dougthug.com>,
+Copyright: 2003-2006 by Doug Gruber <doug(a)dougthug.com>,
License: Artistic or GPL-1+
Files: inc/Module/*
@@ -97,25 +97,57 @@
License: Artistic or GPL-1+
Files: debian/*
-Copyright: 2007, 2008, 2010, Damyan Ivanov <dmn at debian.org>
+Copyright: 2007-2010, Damyan Ivanov <dmn at debian.org>
2007-2010, gregor herrmann <gregoa at debian.org>
+ 2009-2010, Jonathan Yu <jawnsy at cpan.org>
+ 2010, Chris Butler <chrisb at debian.org>
+ 2009, Ryan Niebur <ryanryan52 at gmail.com>
2008, Niko Tyni <ntyni at debian.org>
2008, Roberto C. Sanchez <roberto at debian.org>
- 2009, 2010, Jonathan Yu <jawnsy at cpan.org>
- 2009, Ryan Niebur <ryanryan52 at gmail.com>
- 2010, Chris Butler <chrisb at debian.org>
License: Artistic or GPL-1+
+License: BSD
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the University of
+ California, Berkeley and its contributors.
+ 4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
License: Artistic
- This program is free software; you can redistribute it and/or modify
- it under the terms of the Artistic License, which comes with Perl.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
- any later version.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of version 1 of the
+ General Public License can be found in `/usr/share/common-licenses/GPL-1'.
Modified: trunk/libpar-packer-perl/lib/PAR/Packer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/lib/PAR/Packer.pm?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/lib/PAR/Packer.pm (original)
+++ trunk/libpar-packer-perl/lib/PAR/Packer.pm Fri Dec 24 23:56:21 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
-our $VERSION = '1.006';
+our $VERSION = '1.008';
=head1 NAME
@@ -1684,17 +1684,22 @@
my $clean_inc = '';
if ($opt->{B}) { # bundle core modules
# weed out all @INC entries
+ # use a canonicalized $ENV{PAR_TEMP}: this path was created by C code
+ # and may not be in canonical form (so that the match below will
+ # fail); case inpoint: some versions of FreeBSD have
+ # #define P_tmpdir "/var/tmp/"
+ # in /usr/include/stdio.h (note the trailing slash)
$clean_inc = <<'__CLEAN_INC__';
# Remove everything but PAR hooks from @INC
my %keep = (
\&PAR::find_par => 1,
\&PAR::find_par_last => 1,
);
-my $par_temp_dir = quotemeta( $ENV{PAR_TEMP} );
+my $par_temp_dir = File::Spec->catdir( $ENV{PAR_TEMP} );
@INC =
grep {
exists($keep{$_})
- or $_ =~ /^$par_temp_dir/;
+ or $_ =~ /^\Q$par_temp_dir\E/;
}
@INC;
__CLEAN_INC__
Modified: trunk/libpar-packer-perl/lib/pp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/lib/pp.pm?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/lib/pp.pm (original)
+++ trunk/libpar-packer-perl/lib/pp.pm Fri Dec 24 23:56:21 2010
@@ -28,6 +28,8 @@
help() if $opt{h};
version() if $opt{V};
+ local $Module::ScanDeps::ScanFileRE = qr/./;
+
App::Packer::PAR->new(
frontend => 'Module::ScanDeps',
backend => 'PAR::Packer',
Modified: trunk/libpar-packer-perl/myldr/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/myldr/Makefile.PL?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/myldr/Makefile.PL (original)
+++ trunk/libpar-packer-perl/myldr/Makefile.PL Fri Dec 24 23:56:21 2010
@@ -95,7 +95,7 @@
$lddebug = $debug ? '-debug ' : '-release ';
$warn = $debug ? '-W3' : '';
$res = $Config{ivsize} == 4 ? 'win32.obj' : '';
- $long_literal = 0;
+ $long_literal = '';
# Embed the manifest file for VC 2005 (aka VC8) or higher, but not for the
# 64-bit Platform SDK compiler
if( $Config{ivsize} == 4 and $Config{ccversion} =~ /^(\d+)/ and $1 >= 14 ) {
@@ -103,13 +103,13 @@
} else {
$mt_cmd = '-$(NOOP)';
}
-} elsif ($cc =~ m/^gcc\b/i or ($cc =~ m/^cc\b/i and $gccversion)) {
+} elsif ($cc =~ m/\bgcc\b/i or ($cc =~ m/\bcc\b/i and $gccversion)) {
$out = '-o ';
$ccdebug = $debug ? '-g ' : '';
$lddebug = ($debug or $^O eq 'darwin') ? '' : '-s ';
$warn = $debug ? '-Wall -Wno-comments ' : '';
$res = ($^O =~ /^(?:MSWin|cygwin)/) ? 'win32.coff' : '';
- $long_literal = 1;
+ $long_literal = '-l';
$mt_cmd = '-$(NOOP)';
} else {
$out = '-o ';
@@ -117,7 +117,7 @@
$lddebug = '';
$warn = '';
$res = '';
- $long_literal = 0; # better safe than sorry
+ $long_literal = ''; # better safe than sorry
$mt_cmd = '-$(NOOP)';
}
@@ -159,7 +159,36 @@
undef $dynperl if !-e $libperl;
}
-if (not $dynperl) {
+# In the $dynperl case, we've already found the $libperl DSO.
+# The only problem is: when the linker links $par_exe against $libperl
+# we don't know what name is used to refer to $libperl in the executable
+# (e.g. on an ELF based system the DT_NEEDED tag). This is the name
+# the dynamic loader is looking for when $par_exe is executed.
+#
+# So we better make sure that $libperl is extracted using this name
+# during bootstrap of a packed executable. If we use the wrong name for
+# extraction, $libperl won't be considered by the dynamic loader.
+# This may cause the bootstrap to fail. Or the dynamic loader
+# might find a libperl DSO (e.g in /usr/lib using the built-in library
+# search path) from a Perl installation with the expected name.
+# However, this libperl may be ABI incompatible with $par_exe,
+# leading to hard to diagnose errors.
+#
+# Below we make a feeble attempt to determine this "link name" for some
+# well-known platforms. The fallback is always the basename of $libperl.
+# For ELF based systems the linker uses the DSO's DT_SONAME tag
+# as the link name if present. If the system uses the GNU binutils
+# toolchain we can use the objdump tool to find the DSO's soname.
+
+my $extract_libperl_as;
+if ($dynperl) {
+ $extract_libperl_as = basename($libperl);
+ if ($^O =~ /linux/i)
+ {
+ my ($soname) = qx(objdump -ax $libperl) =~ /^\s*SONAME\s+(\S+)/m;
+ $extract_libperl_as = $soname if $? == 0 && defined $soname;
+ }
+} else {
my $file = $Config{libperl};
$file = 'libperl.a' if $file eq 'libper'; # same redhat bug? Just making sure...
$libperl = find_file($file);
@@ -276,7 +305,7 @@
$mt_cmd
my_par_pl.c: $par_pl
- \$(PERL) $f2c $par_pl \$@ load_my_par_pl $long_literal
+ \$(PERL) $f2c -s $par_pl $long_literal \$@ load_my_par_pl
$parl_exe: $par
\$(PERL) run_with_inc.pl $par -I../blib/lib -q -B -O\$@
@@ -315,13 +344,13 @@
\$(PERL) parlsig.pl $static_exe $par_exe $dynperl $chunk_size
my_par.c: $par_exe
- \$(PERL) $f2c $par_exe \$@ load_my_par $long_literal $chunk_size
+ \$(PERL) $f2c $long_literal -c $chunk_size $par_exe \$@ load_my_par
my_libperl.c:
- \$(PERL) $f2c $libperl \$@ load_my_libperl $long_literal $chunk_size
+ \$(PERL) $f2c $long_literal -c $chunk_size -n $extract_libperl_as $libperl \$@ load_my_libperl
my_libgcc.c:
- \$(PERL) $f2c $libgcc \$@ load_my_libgcc $long_literal $chunk_size
+ \$(PERL) $f2c $long_literal -c $chunk_size $libgcc \$@ load_my_libgcc
strippedparldyn: $par_exe
\$(PERL) -e "chmod(oct('0600'), '$strippedparldyn_mod');"
Modified: trunk/libpar-packer-perl/myldr/file2c.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/myldr/file2c.pl?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/myldr/file2c.pl (original)
+++ trunk/libpar-packer-perl/myldr/file2c.pl Fri Dec 24 23:56:21 2010
@@ -9,85 +9,80 @@
use FindBin;
use lib "$FindBin::Bin/../lib";
use File::Basename;
+use Getopt::Long;
use PAR::Filter::PodStrip;
-my $give_help = 0;
-my $pl_file = shift;
-my $c_file = shift;
-my $c_var = shift;
-my $long_literal = shift;
-my $chunk_size = shift;
+my $chunk_size = 0;
+my $long_literal;
+my $strip_pod;
+my $name;
-$give_help ||= ( !defined $pl_file or
- !defined $c_file or
- !defined $c_var );
-$pl_file ||= '';
-$c_file ||= '';
-$give_help ||= !-e $pl_file;
-if( $give_help ) {
- print <<EOT;
-Usage: $0 file.pl file.c c_variable
-EOT
+GetOptions(
+ "c|chunk-size=i" => \$chunk_size,
+ "l|long-literal" => \$long_literal,
+ "s|strip_pod" => \$strip_pod,
+ "n|name=s" => \$name,
+) && @ARGV == 3
+ or die "Usage: $0 [-c chunk_size][-l][-n name][-s] file.pl file.c c_variable\n";
+my ($pl_file, $c_file, $c_var) = @ARGV;
+$name = basename($pl_file) unless defined $name;
- exit 1;
-}
+my $pl_text = do # NOTE: scalar ref
+{
+ open my $in, "<", $pl_file or die "open input file '$pl_file': $!";
+ binmode $in;
+ local $/ = undef;
+ my $slurp = <$in>;
+ close $in;
+ \$slurp;
+};
-open IN, "< $pl_file" or die "open '$pl_file': $!";
-open OUT, "> $c_file" or die "open '$c_file': $!";
-binmode IN; binmode OUT;
+PAR::Filter::PodStrip->new->apply($pl_text) if $strip_pod;
-# read perl file
-undef $/;
-my $pl_text = <IN>;
-close IN;
-
-PAR::Filter::PodStrip->new->apply(\$pl_text)
- if -e $pl_file and $pl_file =~ /\.p[lm]/i;
+open my $out, ">", $c_file or die "open output file '$c_file': $!";
+binmode $out;
# make a c-array
-print OUT "const char * name_$c_var = \"" . basename($pl_file) . "\";\n";
+print $out "const char * name_$c_var = \"$name\";\n";
-if (!$chunk_size) {
- print_chunk($pl_text, '');
- print OUT "#define WRITE_$c_var(i) write(i, $c_var, (size_t)size_$c_var);\n";
+if ($chunk_size) {
+ my $len = length $$pl_text;
+ my $chunk_count = int(( $len + $chunk_size - 1 ) / $chunk_size);
+ print $out "unsigned long size_$c_var = $len;\n";
+
+ for (my $i = 0; $i < $chunk_count; $i++) {
+ print_chunk( substr($$pl_text, $i * $chunk_size, $chunk_size), "_$i" );
+ }
+
+ print $out "#define WRITE_$c_var(i)";
+ for (my $i = 0; $i < $chunk_count; $i++) {
+ print $out " write(i, ${c_var}_$i, (size_t)size_${c_var}_$i);";
+ }
+ print $out "\n";
}
else {
- my $chunk_count = int(length($pl_text) / $chunk_size) + 1;
- print OUT "unsigned long size_$c_var = " . length($pl_text) . ";\n";
+ print_chunk( $$pl_text, '' );
+ print $out "#define WRITE_${c_var}(i) write(i, $c_var, (size_t)size_${c_var});\n";
+}
+close $out;
- for (1 .. $chunk_count) {
- print_chunk( substr($pl_text, ($_ - 1) * $chunk_size, $chunk_size), "_$_" );
+sub print_chunk {
+ my $chunk = reverse($_[0]);
+ my $suffix = $_[1];
+
+ my $len = length $chunk;
+ print $out "unsigned long size_${c_var}${suffix} = $len;\n";
+ print $out "const char ${c_var}${suffix}[] = ";
+ print $out $long_literal ? "\"" : "{";
+
+ my $fmt = $long_literal ? "\\x%02x" : "0x%02x,";
+ while ($len--) {
+ printf $out $fmt, ord(chop($chunk));
+ print $out $long_literal ? "\"\n\"" :"\n" unless $len % 16;
}
- print OUT "#define WRITE_$c_var(i)";
- for (1 .. $chunk_count) {
- print OUT " write(i, ${c_var}_$_, (size_t)size_${c_var}_$_);";
- }
- print OUT "\n";
-}
-close OUT;
-
-sub print_chunk {
- my $text = reverse($_[0]);
- my $suffix = $_[1];
-
- print OUT "unsigned long size_$c_var$suffix = " . length($text) . ";\n";
- print OUT "const char $c_var$suffix\[" . (length($text) + 1) . "] = ";
- print OUT $long_literal ? '"' : '{';
-
- my $i;
- for (1 .. length($text)) {
- if ($long_literal) {
- print OUT sprintf '\%03o', ord(chop($text));
- }
- else {
- print OUT sprintf "'\\%03o',", ord(chop($text));
- print OUT "\n" unless $i++ % 16;
- }
- }
-
- print OUT $long_literal ? "\";\n" : "0\n};\n";
+ print $out $long_literal ? "\";\n" : "\n};\n";
}
# local variables:
Modified: trunk/libpar-packer-perl/myldr/main.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/myldr/main.c?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/myldr/main.c (original)
+++ trunk/libpar-packer-perl/myldr/main.c Fri Dec 24 23:56:21 2010
@@ -57,6 +57,7 @@
{
int exitstatus;
int i;
+ int argno = 0;
#ifdef PERL_GPROF_MONCONTROL
PERL_GPROF_MONCONTROL(0);
@@ -112,7 +113,6 @@
#endif /* ALLOW_PERL_OPTIONS */
New(666, fakeargv, argc + EXTRA_OPTIONS + 1 + PROFILING_OPTION, char *);
- int argno = 0;
fakeargv[argno++] = argv[0];
#ifdef PERL_PROFILING
fakeargv[argno++] = "-d:DProf";
Modified: trunk/libpar-packer-perl/myldr/mktmpdir.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/myldr/mktmpdir.h?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/myldr/mktmpdir.h (original)
+++ trunk/libpar-packer-perl/myldr/mktmpdir.h Fri Dec 24 23:56:21 2010
@@ -1,3 +1,12 @@
+#ifdef _MSC_VER
+# define snprintf _snprintf
+# if _MSC_VER < 1500
+# define vsnprintf _vsnprintf
+# endif
+# define strncasecmp _strnicmp
+# define strcasecmp _stricmp
+#endif
+
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
Modified: trunk/libpar-packer-perl/myldr/static.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/myldr/static.c?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/myldr/static.c (original)
+++ trunk/libpar-packer-perl/myldr/static.c Fri Dec 24 23:56:21 2010
@@ -18,7 +18,7 @@
&& (unsigned long)statbuf.st_size == expected_size )
return -2;
- i = open(*file_p, O_CREAT | O_WRONLY | OPEN_O_BINARY, 0777);
+ i = open(*file_p, O_CREAT | O_WRONLY | OPEN_O_BINARY, 0755);
if (i == -1) {
fprintf(stderr, "%s: creation of %s failed - aborting with errno %i.\n", argv0, *file_p, errno);
@@ -27,6 +27,12 @@
return i;
}
+
+
+/* turn off automatic globbing of process arguments when using MingW */
+#if defined(WIN32) && defined(__MINGW32__)
+int _CRT_glob = 0;
+#endif
int main ( int argc, char **argv, char **env )
{
Modified: trunk/libpar-packer-perl/t/30-current_exec.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-packer-perl/t/30-current_exec.t?rev=66266&op=diff
==============================================================================
--- trunk/libpar-packer-perl/t/30-current_exec.t (original)
+++ trunk/libpar-packer-perl/t/30-current_exec.t Fri Dec 24 23:56:21 2010
@@ -16,7 +16,7 @@
# warn $@ if $@;
####
-my $EXEC = File::Spec->catfile( $FindBin::Bin, "test-10.exec" );
+my $EXEC = File::Spec->catfile( $FindBin::Bin, "test-10$Config{_exe}" );
my $TEMP = join '-', $FindBin::Bin, "tmp";
my $SCRIPT = File::Spec->catdir( $FindBin::Bin, File::Spec->updir, "blib", "script" );
my $PP = File::Spec->catfile( $SCRIPT, 'pp' );
@@ -50,7 +50,7 @@
my( $file, $path ) = fileparse( $EXEC );
-my $out_path = do { local $ENV{PATH} = $path; qx($file); };
+my $out_path = do { local $ENV{PATH} = join($sep, $path, File::Spec->path()); qx($file); };
is( $out_path, $out_full, "Found the same file via PATH and full path" );
More information about the Pkg-perl-cvs-commits
mailing list