my $type = shift;
my $out = shift;
-my $verbose = ($type =~ s/-v$//);
our %config = read_configure_cache();
sub message($$$) {
my ($type, $file, $command) = @_;
- if ($verbose) {
+ if ($ENV{INSPIRCD_VERBOSE}) {
print "$command\n";
} else {
print_format "\t<|GREEN $type:|>\t\t$file\n";
sub do_static_link {
my $execstr = "$ENV{CXX} -o $out $ENV{CORELDFLAGS}";
+ my $link_flags = '';
for (@ARGV) {
if (/\.cmd$/) {
open F, '<', $_;
my $libs = <F>;
chomp $libs;
- $execstr .= ' '.$libs;
+ $link_flags .= ' '.$libs;
close F;
} else {
$execstr .= ' '.$_;
}
}
- $execstr .= ' '.$ENV{LDLIBS};
+ $execstr .= ' '.$ENV{LDLIBS}.' '.$link_flags;
message 'LINK', $out, $execstr;
exec $execstr;
}
}
sub do_link_dir {
- my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} @_";
+ my ($dir, $link_flags) = (shift, '');
+ for my $file (<$dir/*.cpp>) {
+ $link_flags .= get_property($file, 'LinkerFlags') . ' ';
+ }
+ my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} $link_flags @_";
message 'LINK', $out, $execstr;
exec $execstr;
}