X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Funit-cc.pl;h=8006afe9b4072b1aa9a8ce7018bd11589fcdea43;hb=da7cba69389c3c90cb9e02ac2d18f62d3e83a944;hp=1cf6cf86601f2cd0d1b34001d4f7f07148c7d94a;hpb=a3e0768758ca68429a29d9c78ce672f2d938c6e7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 1cf6cf866..8006afe9b 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -1,8 +1,11 @@ #!/usr/bin/env perl - # # InspIRCd -- Internet Relay Chat Daemon # +# Copyright (C) 2019 iwalkalone +# Copyright (C) 2014 Attila Molnar +# Copyright (C) 2013, 2015-2016, 2018 Sadie Powell +# Copyright (C) 2012 Robby # Copyright (C) 2009-2010 Daniel De Graaf # # This file is part of InspIRCd. InspIRCd is free software: you can @@ -37,11 +40,7 @@ chdir $ENV{BUILDPATH}; my $type = shift; my $out = shift; -if ($type eq 'gen-ld') { - do_static_find(@ARGV); -} elsif ($type eq 'static-ld') { - do_static_link(@ARGV); -} elsif ($type eq 'core-ld') { +if ($type eq 'core-ld') { do_core_link(@ARGV); } elsif ($type eq 'link-dir') { do_link_dir(@ARGV); @@ -71,36 +70,6 @@ sub rpath($) { return $message; } -sub do_static_find { - my @flags; - for my $file (@ARGV) { - push @flags, rpath(get_directive($file, 'LinkerFlags', '')); - } - open F, '>', $out; - print F join ' ', @flags; - close F; - exit 0; -} - -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; - $link_flags .= ' '.$libs; - close F; - } else { - $execstr .= ' '.$_; - } - } - $execstr .= ' '.$ENV{LDLIBS}.' '.$link_flags; - message 'LINK', $out, $execstr; - exec $execstr; -} - sub do_core_link { my $execstr = "$ENV{CXX} -o $out $ENV{CORELDFLAGS} @_ $ENV{LDLIBS}"; message 'LINK', $out, $execstr; @@ -112,7 +81,7 @@ sub do_link_dir { for my $file (<$dir/*.cpp>) { $link_flags .= rpath(get_directive($file, 'LinkerFlags', '')) . ' '; } - my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} $link_flags @_"; + my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} @_ $link_flags"; message 'LINK', $out, $execstr; exec $execstr; }