X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Funit-cc.pl;h=fbe36c4d2926674d5f57917bab1490d3f330dfc8;hb=eac05f8d05ce2e3878ac4a51675b11e64831adac;hp=30b5363430ec190e7094a394f92119518f2e6bfc;hpb=df347edbdbb6d1d0f81795214674da8a4007850a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 30b536343..fbe36c4d2 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -41,7 +41,7 @@ sub do_static_find { } sub do_static_link { - my $execstr = "$ENV{RUNLD} -o $out $ENV{CORELDFLAGS} $ENV{LDLIBS}"; + my $execstr = "$ENV{RUNLD} -o $out $ENV{CORELDFLAGS}"; for (@ARGV) { if (/\.cmd$/) { open F, '<', $_; @@ -53,12 +53,13 @@ sub do_static_link { $execstr .= ' '.$_; } } + $execstr .= ' '.$ENV{LDLIBS}; print "$execstr\n" if $verbose; exec $execstr; } sub do_core_link { - my $execstr = "$ENV{RUNLD} -o $out $ENV{CORELDFLAGS} $ENV{LDLIBS} @_"; + my $execstr = "$ENV{RUNLD} -o $out $ENV{CORELDFLAGS} @_ $ENV{LDLIBS}"; print "$execstr\n" if $verbose; exec $execstr; } @@ -73,6 +74,7 @@ sub do_compile { my ($do_compile, $do_link, $file) = @_; my $flags = ''; + my $libs = ''; my $binary = $ENV{RUNCC}; if ($do_compile) { $flags = $ENV{CXXFLAGS}; @@ -87,12 +89,13 @@ sub do_compile { } if ($do_link) { - $flags = join ' ', $flags, $ENV{PICLDFLAGS}, getlinkerflags($file); + $flags = join ' ', $flags, $ENV{PICLDFLAGS}; + $libs = join ' ', getlinkerflags($file); } else { $flags .= ' -c'; } - my $execstr = "$binary -o $out $flags $file"; + my $execstr = "$binary -o $out $flags $file $libs"; print "$execstr\n" if $verbose; exec $execstr; }