1 ################################################################################
3 # PPPort_xs.PL -- generate RealPPPort.xs
5 ################################################################################
9 # $Date: 2009/01/18 14:10:48 +0100 $
11 ################################################################################
13 # Version 3.x, Copyright (C) 2004-2009, Marcus Holland-Moritz.
14 # Version 2.x, Copyright (C) 2001, Paul Marquess.
15 # Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
17 # This program is free software; you can redistribute it and/or
18 # modify it under the same terms as Perl itself.
20 ################################################################################
24 require "parts/ppptools.pl";
27 xshead => { code => '', header => "/* ---- code from __FILE__ ---- */" },
28 xsinit => { code => '', header => "/* ---- code from __FILE__ ---- */" },
29 xsmisc => { code => '', header => "/* ---- code from __FILE__ ---- */" },
30 xsboot => { code => '', header => "/* ---- code from __FILE__ ---- */", indent => "\t" },
31 xsubs => { code => '', header => <<ENDHEADER },
32 ##----------------------------------------------------------------------
33 ## XSUBs for testing the implementation in __FILE__
34 ##----------------------------------------------------------------------
38 if (exists $ENV{PERL_NO_GET_CONTEXT} && $ENV{PERL_NO_GET_CONTEXT}) {
39 $SECTION{xshead}{code} .= <<END;
40 #define PERL_NO_GET_CONTEXT
47 for $file (all_files_in_dir('parts/inc')) {
48 my $spec = parse_partspec($file);
51 for $sec (keys %SECTION) {
52 if (exists $spec->{$sec}) {
53 $msg++ or print "adding XS code from $file\n";
54 if (exists $SECTION{$sec}{header}) {
55 my $header = $SECTION{$sec}{header};
56 $header =~ s/__FILE__/$file/g;
57 $SECTION{$sec}{code} .= $header . "\n";
59 $SECTION{$sec}{code} .= $spec->{$sec} . "\n";
64 my $data = do { local $/; <DATA> };
66 for $sec (keys %SECTION) {
67 my $code = $SECTION{$sec}{code};
68 if (exists $SECTION{$sec}{indent}) {
69 $code =~ s/^/$SECTION{$sec}{indent}/gm;
71 $code =~ s/[\r\n]+$//;
72 $data =~ s/^__\U$sec\E__$/$code/m;
75 open FH, ">RealPPPort.xs" or die "RealPPPort.xs: $!\n";
82 /*******************************************************************************
84 * !!!!! Do NOT edit this file directly! -- Edit PPPort_xs.PL instead. !!!!!
86 * This file was automatically generated from the definition files in the
87 * parts/inc/ subdirectory by PPPort_xs.PL. To learn more about how all this
88 * works, please read the F<HACKERS> file that came with this distribution.
90 ********************************************************************************
92 * Perl/Pollution/Portability
94 ********************************************************************************
98 * $Date: 2009/01/18 14:10:48 +0100 $
100 ********************************************************************************
102 * Version 3.x, Copyright (C) 2004-2009, Marcus Holland-Moritz.
103 * Version 2.x, Copyright (C) 2001, Paul Marquess.
104 * Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
106 * This program is free software; you can redistribute it and/or
107 * modify it under the same terms as Perl itself.
109 *******************************************************************************/
111 /* ========== BEGIN XSHEAD ================================================== */
115 /* =========== END XSHEAD =================================================== */
121 /* ========== BEGIN XSINIT ================================================== */
125 /* =========== END XSINIT =================================================== */
129 /* ========== BEGIN XSMISC ================================================== */
133 /* =========== END XSMISC =================================================== */
135 MODULE = Devel::PPPort PACKAGE = Devel::PPPort