* speclib: Initial stab at cleaning up temp files. More work needed.

* mkimport: Ditto.
This commit is contained in:
Christopher Faylor 2009-04-12 05:11:08 +00:00
parent d129941aef
commit 73bd57524a
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
* speclib: Initial stab at cleaning up temp files. More work needed.
* mkimport: Ditto.
2009-04-12 Christopher Faylor <me+cygwin@cgf.cx> 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
* Makefile.in (clean): Clean globals.h. * Makefile.in (clean): Clean globals.h.

View File

@ -77,4 +77,6 @@ for my $f (keys %text) {
} }
unlink $libdll; unlink $libdll;
exec $ar, 'crus', $libdll, glob('*.o'), @ARGV; system $ar, 'crus', $libdll, glob('*.o'), @ARGV;
unlink glob('*.o');
exit 1 if $?;

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
use Getopt::Long; use Getopt::Long;
use File::Temp qw'tempdir'; use File::Temp;
use File::Basename; use File::Basename;
use File::Spec; use File::Spec;
use strict; use strict;
@ -43,11 +43,14 @@ close $nm_fd;
%extract or die "$0: couldn't find symbols for $lib\n"; %extract or die "$0: couldn't find symbols for $lib\n";
my $dir = tempdir(CLEANUP => 1); my $dir = File::Temp->newdir();
chdir $dir; chdir $dir;
# print join(' ', '+', $ar, 'x', sort keys %extract), "\n"; # print join(' ', '+', $ar, 'x', sort keys %extract), "\n";
my $res = system $ar, 'x', $libdll, sort keys %extract; my $res = system $ar, 'x', $libdll, sort keys %extract;
die "$0: $ar extraction exited with non-zero status\n" if $res; die "$0: $ar extraction exited with non-zero status\n" if $res;
unlink $lib; unlink $lib;
exec $ar, 'crus', $lib, sort keys %extract; $res = system $ar, 'crus', $lib, sort keys %extract;
unlink keys %extract;
die "$0: ar creation of $lib exited with non-zero status\n" if $res;
exit 0;