This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bump Data::Dumper version
[perl5.git] / win32 / create_perllibst_h.pl
CommitLineData
c6d234b8
NC
1#!perl -w
2use strict;
3
4# creates perllibst.h file for inclusion from perllib.c
5
6use Config;
7
8my @statics = split /\s+/, $Config{static_ext};
9open my $fh, '>', 'perllibst.h' or die "Failed to write to perllibst.h:$!";
10
11my @statics1 = map {local $_=$_;s/\//__/g;$_} @statics;
12my @statics2 = map {local $_=$_;s/\//::/g;$_} @statics;
13print $fh "/*DO NOT EDIT\n this file is included from perllib.c to init static extensions */\n";
14print $fh "#ifdef STATIC1\n",(map {" \"$_\",\n"} @statics),"#undef STATIC1\n#endif\n";
15print $fh "#ifdef STATIC2\n",(map {" EXTERN_C void boot_$_ (pTHX_ CV* cv);\n"} @statics1),"#undef STATIC2\n#endif\n";
16print $fh "#ifdef STATIC3\n",(map {" newXS(\"$statics2[$_]::bootstrap\", boot_$statics1[$_], file);\n"} 0 .. $#statics),"#undef STATIC3\n#endif\n";
17close $fh;