]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/unit-cc.pl
Fix linker flags being in the wrong place on static builds.
[user/henk/code/inspircd.git] / make / unit-cc.pl
index a06d7b10f44692fc5fab1b4249b728877cf50f27..f04423ce3cf20920223bc14d5fc5634dc2c8c846 100755 (executable)
@@ -80,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;
 }