summaryrefslogtreecommitdiff
path: root/win32/create_perllibst_h.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-01-26 22:49:19 +0000
committerNicholas Clark <nick@ccl4.org>2009-01-26 22:49:19 +0000
commitc6d234b82f2f6387f4a8ddb73277519b5bca93fc (patch)
tree7c40eb9ab0f179609a172a224ee2f76b77ee516a /win32/create_perllibst_h.pl
parent4497a157d1131e07b218838ce27e77bd3ed118d0 (diff)
downloadperl-c6d234b82f2f6387f4a8ddb73277519b5bca93fc.tar.gz
Break the --create-perllibst-h and --list-static-libs options out of buildext.pl
into separate scripts.
Diffstat (limited to 'win32/create_perllibst_h.pl')
-rw-r--r--win32/create_perllibst_h.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/win32/create_perllibst_h.pl b/win32/create_perllibst_h.pl
new file mode 100644
index 0000000000..37fd3a49c1
--- /dev/null
+++ b/win32/create_perllibst_h.pl
@@ -0,0 +1,17 @@
+#!perl -w
+use strict;
+
+# creates perllibst.h file for inclusion from perllib.c
+
+use Config;
+
+my @statics = split /\s+/, $Config{static_ext};
+open my $fh, '>', 'perllibst.h' or die "Failed to write to perllibst.h:$!";
+
+my @statics1 = map {local $_=$_;s/\//__/g;$_} @statics;
+my @statics2 = map {local $_=$_;s/\//::/g;$_} @statics;
+print $fh "/*DO NOT EDIT\n this file is included from perllib.c to init static extensions */\n";
+print $fh "#ifdef STATIC1\n",(map {" \"$_\",\n"} @statics),"#undef STATIC1\n#endif\n";
+print $fh "#ifdef STATIC2\n",(map {" EXTERN_C void boot_$_ (pTHX_ CV* cv);\n"} @statics1),"#undef STATIC2\n#endif\n";
+print $fh "#ifdef STATIC3\n",(map {" newXS(\"$statics2[$_]::bootstrap\", boot_$statics1[$_], file);\n"} 0 .. $#statics),"#undef STATIC3\n#endif\n";
+close $fh;