]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/unit-cc.pl
Merge insp20
[user/henk/code/inspircd.git] / make / unit-cc.pl
index aba14a0bc461b5dd338d59ae91cf31e98abee6c0..f04423ce3cf20920223bc14d5fc5634dc2c8c846 100755 (executable)
@@ -36,7 +36,6 @@ chdir $ENV{BUILDPATH};
 
 my $type = shift;
 my $out = shift;
-my $verbose = ($type =~ s/-v$//);
 
 our %config = read_configure_cache();
 
@@ -61,7 +60,7 @@ exit 1;
 
 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";
@@ -81,18 +80,19 @@ sub do_static_find {
 
 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;
 }