summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-03-12 00:51:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-03-12 00:51:08 +0000
commit01f988be05578e1f4609174755be9d7b61543c58 (patch)
tree7ebcceb4314c8b249ec6cc249e699dc385acd199 /lib
parent3bd495df69b982704c59fc1ecbed71e5112e7da0 (diff)
downloadperl-01f988be05578e1f4609174755be9d7b61543c58.tar.gz
[asperl] added AS patch#12 with minor changes
p4raw-id: //depot/asperl@806
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/MM_Unix.pm80
-rw-r--r--lib/ExtUtils/MakeMaker.pm10
-rw-r--r--lib/ExtUtils/Mksymlists.pm6
-rwxr-xr-xlib/ExtUtils/xsubpp8
4 files changed, 98 insertions, 6 deletions
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 888e5396dc..e5c4786e0c 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -212,6 +212,7 @@ sub ExtUtils::MM_Unix::pm_to_blib ;
sub ExtUtils::MM_Unix::post_constants ;
sub ExtUtils::MM_Unix::post_initialize ;
sub ExtUtils::MM_Unix::postamble ;
+sub ExtUtils::MM_Unix::ppd ;
sub ExtUtils::MM_Unix::prefixify ;
sub ExtUtils::MM_Unix::processPL ;
sub ExtUtils::MM_Unix::realclean ;
@@ -2565,6 +2566,45 @@ sub parse_version {
return $result;
}
+=item parse_abstract
+
+parse a file and return what you think is the ABSTRACT
+
+=cut
+
+sub parse_abstract {
+ my($self,$parsefile) = @_;
+ my $result;
+ local *FH;
+ local $/ = "\n";
+ open(FH,$parsefile) or die "Could not open '$parsefile': $!";
+ my $inpod = 0;
+ my $package = $self->{DISTNAME};
+ $package =~ s/-/::/;
+ while (<FH>) {
+ $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
+ next if !$inpod;
+ chop;
+ next unless /^($package\s-\s)(.*)/;
+ $result = $2;
+# my $eval = qq{
+# package ExtUtils::MakeMaker::_version;
+# no strict;
+#
+# local $1$2;
+# \$$2=undef; do {
+# $_
+# }; \$$2
+# };
+# local($^W) = 0;
+# $result = eval($eval);
+# die "Could not eval '$eval' in $parsefile: $@" if $@;
+# $result = "undef" unless defined $result;
+ last;
+ }
+ close FH;
+ return $result;
+}
=item pasthru (o)
@@ -2664,6 +2704,46 @@ $(OBJECT) : $(PERL_HDRS)
join "\n", @m;
}
+=item ppd
+
+Defines target that creates a PPD (Perl Package Description) file
+for a binary distribution.
+
+=cut
+
+sub ppd {
+ my($self) = @_;
+ my(@m);
+ if ($self->{ABSTRACT_FROM}){
+ $self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or
+ Carp::carp "WARNING: Setting ABSTRACT via file '$self->{ABSTRACT_FROM}' failed\n"
+ }
+ my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0) x 4) [0 .. 3];
+ push(@m, "# Creates a PPD (Perl Package Description) for a binary distribution.\n");
+ push(@m, "ppd:\n");
+ push(@m, "\t\@\$(PERL) -e \"print qq{<SOFTPKG NAME=\\\"$self->{DISTNAME}\\\" VERSION=\\\"$pack_ver\\\">\\n}");
+ push(@m, ". qq{\\t<TITLE>$self->{DISTNAME}</TITLE>\\n}");
+ push(@m, ". qq{\\t<ABSTRACT>$self->{ABSTRACT}</ABSTRACT>\\n}");
+ my ($author) = $self->{AUTHOR};
+ $author =~ s/@/\\@/g;
+ push(@m, ". qq{\\t<AUTHOR>$author</AUTHOR>\\n}");
+ push(@m, ". qq{\\t<IMPLEMENTATION>\\n}");
+ my ($prereq);
+ foreach $prereq (sort keys %{$self->{PREREQ_PM}}) {
+ my $pre_req = $prereq;
+ $pre_req =~ s/::/-/g;
+ push(@m, ". qq{\\t\\t<DEPENDENCY NAME=\\\"$pre_req\\\" />\\n}");
+ }
+ push(@m, ". qq{\\t\\t<OS NAME=\\\"\$(OSNAME)\\\" />\\n}");
+ my ($bin_location) = $self->{BINARY_LOCATION};
+ $bin_location =~ s/\\/\\\\/g;
+ push(@m, ". qq{\\t\\t<CODEBASE HREF=\\\"$bin_location\\\" />\\n}");
+ push(@m, ". qq{\\t</IMPLEMENTATION>\\n}");
+ push(@m, ". qq{</SOFTPKG>\\n}\" > $self->{DISTNAME}.ppd");
+
+ join("", @m);
+}
+
=item pm_to_blib
Defines target that copies all files in the hash PM to their
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index f3b843f6f2..c86486ac1a 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -235,6 +235,7 @@ sub full_setup {
@Attrib_help = qw/
+ AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION LICENSE_HREF
C CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS
EXE_FILES EXCLUDE_EXT INCLUDE_EXT NO_VC FIRST_MAKEFILE FULLPERL H
INC INSTALLARCHLIB INSTALLBIN INSTALLDIRS INSTALLMAN1DIR
@@ -278,7 +279,7 @@ sub full_setup {
c_o xs_c xs_o top_targets linkext dlsyms dynamic dynamic_bs
dynamic_lib static static_lib manifypods processPL installbin subdirs
clean realclean dist_basics dist_core dist_dir dist_test dist_ci
- install force perldepend makefile staticmake test
+ install force perldepend makefile staticmake test ppd
); # loses section ordering
@@ -307,7 +308,7 @@ sub full_setup {
@Get_from_Config =
qw(
ar cc cccdlflags ccdlflags dlext dlsrc ld lddlflags ldflags libc
- lib_ext obj_ext ranlib sitelibexp sitearchexp so exe_ext
+ lib_ext obj_ext osname osvers ranlib sitelibexp sitearchexp so exe_ext
);
my $item;
@@ -381,8 +382,9 @@ sub ExtUtils::MakeMaker::new {
eval $eval;
if ($@){
warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found";
- } else {
- delete $self->{PREREQ_PM}{$prereq};
+# mjn
+# } else {
+# delete $self->{PREREQ_PM}{$prereq};
}
}
# if (@unsatisfied){
diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm
index 6bd49f2b73..2f2366a1c8 100644
--- a/lib/ExtUtils/Mksymlists.pm
+++ b/lib/ExtUtils/Mksymlists.pm
@@ -109,8 +109,10 @@ sub _write_win32 {
# put library name in quotes (it could be a keyword, like 'Alias')
if ($Config::Config{'cc'} !~ /^gcc/i) {
print DEF "LIBRARY \"$data->{DLBASE}\"\n";
- print DEF "CODE LOADONCALL\n";
- print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n";
+ if ($Config{'ccflags'} !~ /PERL_OBJECT/i) {
+ print DEF "CODE LOADONCALL\n";
+ print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n";
+ }
}
print DEF "EXPORTS\n ";
my @syms;
diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp
index b8ec042b41..58b3a08705 100755
--- a/lib/ExtUtils/xsubpp
+++ b/lib/ExtUtils/xsubpp
@@ -83,6 +83,8 @@ require 5.002;
use Cwd;
use vars '$cplusplus';
+use Config;
+
sub Q ;
# Global Constants
@@ -103,6 +105,8 @@ $FH = 'File0000' ;
$usage = "Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-s pattern] [-typemap typemap]... file.xs\n";
$proto_re = "[" . quotemeta('\$%&*@;') . "]" ;
+# mjn
+$OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
$except = "";
$WantPrototypes = -1 ;
@@ -714,6 +718,10 @@ print("#line 1 \"$filename\"\n")
while (<$FH>) {
last if ($Module, $Package, $Prefix) =
/^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/;
+
+ if ($OBJ) {
+ s/#if(?:def|\s+defined)\s+(\(__cplusplus\)|__cplusplus)/#if defined(__cplusplus) && !defined(PERL_OBJECT)/;
+ }
print $_;
}
&Exit unless defined $_;