Skip to content

Commit

Permalink
* speclib: Initial stab at cleaning up temp files. More work needed.
Browse files Browse the repository at this point in the history
* mkimport: Ditto.
  • Loading branch information
Christopher Faylor committed Apr 12, 2009
1 parent d129941 commit 73bd575
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions winsup/cygwin/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2009-04-12 Christopher Faylor <[email protected]>

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

2009-04-12 Christopher Faylor <[email protected]>

* Makefile.in (clean): Clean globals.h.
Expand Down
4 changes: 3 additions & 1 deletion winsup/cygwin/mkimport
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ for my $f (keys %text) {
}

unlink $libdll;
exec $ar, 'crus', $libdll, glob('*.o'), @ARGV;
system $ar, 'crus', $libdll, glob('*.o'), @ARGV;
unlink glob('*.o');
exit 1 if $?;
9 changes: 6 additions & 3 deletions winsup/cygwin/speclib
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl
use Getopt::Long;
use File::Temp qw'tempdir';
use File::Temp;
use File::Basename;
use File::Spec;
use strict;
Expand Down Expand Up @@ -43,11 +43,14 @@ close $nm_fd;

%extract or die "$0: couldn't find symbols for $lib\n";

my $dir = tempdir(CLEANUP => 1);
my $dir = File::Temp->newdir();

chdir $dir;
# print join(' ', '+', $ar, 'x', sort keys %extract), "\n";
my $res = system $ar, 'x', $libdll, sort keys %extract;
die "$0: $ar extraction exited with non-zero status\n" if $res;
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;

0 comments on commit 73bd575

Please sign in to comment.