summaryrefslogtreecommitdiffstats
path: root/src/makedef.pl
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-01-16 02:36:01 +0000
committermental <mental@users.sourceforge.net>2006-01-16 02:36:01 +0000
commit179fa413b047bede6e32109e2ce82437c5fb8d34 (patch)
treea5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/makedef.pl
downloadinkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz
inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/makedef.pl')
-rw-r--r--src/makedef.pl61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/makedef.pl b/src/makedef.pl
new file mode 100644
index 000000000..42ae3b08a
--- /dev/null
+++ b/src/makedef.pl
@@ -0,0 +1,61 @@
+#! perl
+
+&doMakeDef();
+exit(0);
+
+sub doMakeDef()
+{
+ print "####### Generating 'inkscape.def' #######\n";
+
+ my $nmlines = (); #store lines read in hash, to remove dupes
+ my @lines; #output lines
+ my $line; #single line of input
+ my $datestr; #current date
+ local(*PIPE); #output of the 'nm' command
+ local(*OUTFILE); #output file - inkscape.def
+
+ open (PIPE, "nm libinkscape.a |");
+ while(<PIPE>)
+ {
+ if ($_ =~ /\./)
+ {
+ next;
+ }
+ elsif ($_ =~ /T _/)
+ {
+ $line = $_;
+ $line =~ s/.* T _//;
+ $nmlines->{$line} = 1;
+ }
+ elsif ($_ =~ /B _/)
+ {
+ $line = $_;
+ $line =~ s/.* B _//;
+ $nmlines->{$line} = 1;
+ }
+ }
+ close (PIPE);
+
+ foreach (keys(%{$nmlines}))
+ {
+ push @lines, $_;
+ }
+
+ @lines = sort(@lines);
+
+ $datestr = gmtime();
+ open (OUTFILE, ">inkscape.def");
+ print OUTFILE ";########################################################\n";
+ print OUTFILE ";## File: inkscape.def\n";
+ print OUTFILE ";## Purpose: Used by dllwrap to make inkscape.dll\n";
+ print OUTFILE ";## Generated by makedef.pl at :$datestr\n";
+ print OUTFILE ";########################################################\n\n";
+ print OUTFILE "LIBRARY\tinkscape.dll\n";
+ print OUTFILE "EXPORTS\n";
+ foreach (<@lines>)
+ {
+ # print $_, "\n";
+ print OUTFILE " ", $_, "\n";
+ }
+ close (OUTFILE);
+}