X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=inline;f=make%2Funit-cc.pl;h=f04423ce3cf20920223bc14d5fc5634dc2c8c846;hb=5267fb9d362aeb326c9e64f7171c957f76776f90;hp=0a20738db0232dd22c720773924e347b3ac7aaff;hpb=6d5169671560a20cf0ae11300766e6de073f5b7b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 0a20738db..f04423ce3 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -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 = ; 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; } @@ -104,7 +104,11 @@ sub do_core_link { } 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; }