r62493 - in /trunk/libmodule-install-xsutil-perl: Changes META.yml debian/changelog debian/copyright example/MyMakefile.PL example/src/Foo.xs example/src/bar.c lib/Module/Install/XSUtil.pm
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Sun Sep 12 15:29:48 UTC 2010
Author: angelabad-guest
Date: Sun Sep 12 15:29:33 2010
New Revision: 62493
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62493
Log:
* New upstream release
* debian/copyright: Update license information
Modified:
trunk/libmodule-install-xsutil-perl/Changes
trunk/libmodule-install-xsutil-perl/META.yml
trunk/libmodule-install-xsutil-perl/debian/changelog
trunk/libmodule-install-xsutil-perl/debian/copyright
trunk/libmodule-install-xsutil-perl/example/MyMakefile.PL
trunk/libmodule-install-xsutil-perl/example/src/Foo.xs
trunk/libmodule-install-xsutil-perl/example/src/bar.c
trunk/libmodule-install-xsutil-perl/lib/Module/Install/XSUtil.pm
Modified: trunk/libmodule-install-xsutil-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/Changes?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/Changes (original)
+++ trunk/libmodule-install-xsutil-perl/Changes Sun Sep 12 15:29:33 2010
@@ -1,4 +1,7 @@
Revision history for Perl extension Module::Install::XSUtil
+
+0.30 Sat Sep 11 14:17:06 2010
+ - Add use_xshelper() command to create xshelper.h
0.27 Sun Sep 5 11:47:03 2010
- c99_available() should not have any side effects (reported by makamaka)
Modified: trunk/libmodule-install-xsutil-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/META.yml?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/META.yml (original)
+++ trunk/libmodule-install-xsutil-perl/META.yml Sun Sep 12 15:29:33 2010
@@ -1,7 +1,7 @@
---
abstract: 'Utility functions for XS modules'
author:
- - 'Goro Fuji (gfx) <gfuji(at)cpan.org>.'
+ - ':'
build_requires:
B::Hooks::OP::Annotation: 0.43
Devel::PPPort: 3.19
@@ -31,4 +31,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/gfx/Perl-Module-Install-XSUtil.git
-version: 0.27
+version: 0.30
Modified: trunk/libmodule-install-xsutil-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/debian/changelog?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/debian/changelog (original)
+++ trunk/libmodule-install-xsutil-perl/debian/changelog Sun Sep 12 15:29:33 2010
@@ -1,3 +1,10 @@
+libmodule-install-xsutil-perl (0.30-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/copyright: Update license information
+
+ -- Angel Abad <angelabad at gmail.com> Sun, 12 Sep 2010 17:29:05 +0200
+
libmodule-install-xsutil-perl (0.27-1) unstable; urgency=low
[ Angel Abad ]
Modified: trunk/libmodule-install-xsutil-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/debian/copyright?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/debian/copyright (original)
+++ trunk/libmodule-install-xsutil-perl/debian/copyright Sun Sep 12 15:29:33 2010
@@ -23,8 +23,8 @@
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 systems, the complete text of the Artistic License can be
- found in `/usr/share/common-licenses/Artistic'.
+ 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
@@ -32,5 +32,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian systems, the complete text of version 1 of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL-1'.
+ 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/libmodule-install-xsutil-perl/example/MyMakefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/example/MyMakefile.PL?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/example/MyMakefile.PL (original)
+++ trunk/libmodule-install-xsutil-perl/example/MyMakefile.PL Sun Sep 12 15:29:33 2010
@@ -18,6 +18,7 @@
requires_xs 'B::Hooks::OP::Annotation'; # for testing only
use_ppport 3.19;
+use_xshelper;
cc_warnings;
Modified: trunk/libmodule-install-xsutil-perl/example/src/Foo.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/example/src/Foo.xs?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/example/src/Foo.xs (original)
+++ trunk/libmodule-install-xsutil-perl/example/src/Foo.xs Sun Sep 12 15:29:33 2010
@@ -1,9 +1,4 @@
-#define PERL_NO_GET_CONTEXT
-#include <EXTERN.h>
-#include <perl.h>
-#include <XSUB.h>
-
-#include "ppport.h"
+#include "xshelper.h"
#include "foo.h"
#include "foo/bar.h"
@@ -20,7 +15,7 @@
#endif
}
-STATIC OPAnnotationGroup MYMODULE_ANNOTATIONS;
+STATIC OPAnnotationGroup MYMODULE_ANNOTATIONS;
MODULE = Foo PACKAGE = Foo
Modified: trunk/libmodule-install-xsutil-perl/example/src/bar.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/example/src/bar.c?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/example/src/bar.c (original)
+++ trunk/libmodule-install-xsutil-perl/example/src/bar.c Sun Sep 12 15:29:33 2010
@@ -1,9 +1,4 @@
-#define PERL_NO_GET_CONTEXT
-#include <EXTERN.h>
-#include <perl.h>
-#include <XSUB.h>
-
-#include "ppport.h"
+#include "xshelper.h"
#include "foo.h"
#include "foo/bar.h"
Modified: trunk/libmodule-install-xsutil-perl/lib/Module/Install/XSUtil.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-install-xsutil-perl/lib/Module/Install/XSUtil.pm?rev=62493&op=diff
==============================================================================
--- trunk/libmodule-install-xsutil-perl/lib/Module/Install/XSUtil.pm (original)
+++ trunk/libmodule-install-xsutil-perl/lib/Module/Install/XSUtil.pm Sun Sep 12 15:29:33 2010
@@ -2,7 +2,7 @@
use 5.005_03;
-$VERSION = '0.27';
+$VERSION = '0.30';
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
@@ -110,6 +110,7 @@
sub use_ppport{
my($self, $dppp_version) = @_;
+ return if $self->{_ppport_ok}++;
$self->_xs_initialize();
@@ -141,10 +142,25 @@
return;
}
+sub use_xshelper {
+ my($self) = @_;
+ $self->_xs_initialize();
+ $self->use_ppport();
+
+ my $file = 'xshelper.h';
+ open my $fh, '>', $file or die "Cannot open $file for writing: $!";
+ print $fh $self->_xshelper_h();
+ close $fh or die "Cannot close $file: $!";
+
+ $self->clean_files($file);
+ return;
+}
+
sub _gccversion {
my $res = `$Config{cc} --version`;
my ($version) = $res =~ /\(GCC\) ([0-9.]+)/;
- return $version || 0;
+ no warnings 'numeric', 'uninitialized';
+ return sprintf '%g', $version;
}
sub cc_warnings{
@@ -153,23 +169,23 @@
$self->_xs_initialize();
if(_is_gcc()){
- # Note: MSVC++ doesn't support C99, so -Wdeclaration-after-statement helps ensure C89 specs.
$self->cc_append_to_ccflags(qw(-Wall));
- no warnings 'numeric';
my $gccversion = _gccversion();
if($gccversion >= 4.0){
- $self->cc_append_to_ccflags('-Wextra -Wdeclaration-after-statement');
- if($gccversion >= 4.1){
- $self->cc_append_to_ccflags('-Wc++-compat');
+ # Note: MSVC++ doesn't support C99, so -Wdeclaration-after-statement helps
+ # ensure C89 specs.
+ $self->cc_append_to_ccflags(qw(-Wextra -Wdeclaration-after-statement));
+ if($gccversion >= 4.1) {
+ $self->cc_append_to_ccflags(qw(-Wc++-compat));
}
}
else{
- $self->cc_append_to_ccflags('-W -Wno-comment');
+ $self->cc_append_to_ccflags(qw(-W -Wno-comment));
}
}
elsif(_is_msvc()){
- $self->cc_append_to_ccflags('-W3');
+ $self->cc_append_to_ccflags(qw(-W3));
}
else{
# TODO: support other compilers
@@ -593,6 +609,111 @@
return;
}
+sub _xshelper_h {
+ my $h = <<'XSHELPER_H';
+:/*
+:=head1 NAME
+:
+:perlxs.h - Helper C header file for XS modules
+:
+:=head1 DESCRIPTION
+:
+: // This includes all the perl header files and ppport.h
+: #include "perlxs.h"
+:
+:=head1 SEE ALSO
+:
+:L<Module::Install::XSUtil>, where this file is distributed as a part of
+:
+:=head1 AUTHOR
+:
+:Fuji, Goro (gfx)
+:
+:=head1 LISENCE
+:
+:Copyright (c) 2010, Fuji, Goro (gfx). All rights reserved.
+:
+:This library is free software; you can redistribute it and/or modify
+:it under the same terms as Perl itself.
+:
+:=cut
+:*/
+:
+:#ifdef __cplusplus
+:extern "C" {
+:#endif
+:
+:#define PERL_NO_GET_CONTEXT /* we want efficiency */
+:#include <EXTERN.h>
+:
+:#include <perl.h>
+:#define NO_XSLOCKS /* for exceptions */
+:#include <XSUB.h>
+:
+:#ifdef __cplusplus
+:} /* extern "C" */
+:#endif
+:
+:#include "ppport.h"
+:
+:/* portability stuff not supported by ppport.h yet */
+:
+:#ifndef STATIC_INLINE /* from 5.13.4 */
+:# if defined(__GNUC__) || defined(__cplusplus__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
+:# define STATIC_INLINE static inline
+:# else
+:# define STATIC_INLINE static
+:# endif
+:#endif /* STATIC_INLINE */
+:
+:#ifndef __attribute__format__
+:#define __attribute__format__(a,b,c) /* nothing */
+:#endif
+:
+:#ifndef LIKELY /* they are just a compiler's hint */
+:#define LIKELY(x) (x)
+:#define UNLIKELY(x) (x)
+:#endif
+:
+:#ifndef newSVpvs_share
+:#define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(s), 0U)
+:#endif
+:
+:#ifndef get_cvs
+:#define get_cvs(name, flags) get_cv(name, flags)
+:#endif
+:
+:#ifndef GvNAME_get
+:#define GvNAME_get GvNAME
+:#endif
+:#ifndef GvNAMELEN_get
+:#define GvNAMELEN_get GvNAMELEN
+:#endif
+:
+:#ifndef CvGV_set
+:#define CvGV_set(cv, gv) (CvGV(cv) = (gv))
+:#endif
+:
+:/* general utility */
+:
+:#if PERL_BCDVERSION >= 0x5008005
+:#define LooksLikeNumber(x) looks_like_number(x)
+:#else
+:#define LooksLikeNumber(x) (SvPOKp(x) ? looks_like_number(x) : (I32)SvNIOKp(x))
+:#endif
+:
+:#define newAV_mortal() (AV*)sv_2mortal((SV*)newAV())
+:#define newHV_mortal() (HV*)sv_2mortal((SV*)newHV())
+:
+:#define DECL_BOOT(name) EXTERN_C XS(CAT2(boot_, name))
+:#define CALL_BOOT(name) STMT_START { \
+: PUSHMARK(SP); \
+: CALL_FPTR(CAT2(boot_, name))(aTHX_ cv); \
+: } STMT_END
+XSHELPER_H
+ $h =~ s/^://xmsg;
+ return $h;
+}
package
MY;
@@ -625,7 +746,6 @@
return $cccmd
}
-
1;
__END__
@@ -637,7 +757,7 @@
=head1 VERSION
-This document describes Module::Install::XSUtil version 0.27.
+This document describes Module::Install::XSUtil version 0.30.
=head1 SYNOPSIS
@@ -708,10 +828,18 @@
=head2 use_ppport ?$version
-Create F<ppport.h> using C<Devel::PPPort::WriteFile()>.
+Creates F<ppport.h> using C<Devel::PPPort::WriteFile()>.
This command calls C<< configure_requires 'Devel::PPPort' => $version >>
and adds C<-DUSE_PPPORT> to C<MakeMaker>'s C<DEFINE>.
+
+=head2 use_xshelper
+
+Create sF<xshelper.h>, which is a helper header file to include
+F<EXTERN.h>, F<perl.h>, F<XSUB.h> and F<ppport.h>, and defines
+some portability stuff which are not supported by F<ppport.h>.
+
+This command includes C<use_ppport>.
=head2 cc_warnings
More information about the Pkg-perl-cvs-commits
mailing list