]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/unit-cc.pl
m_passforward: Don't forward password if the connect block required a password to...
[user/henk/code/inspircd.git] / make / unit-cc.pl
index 30b5363430ec190e7094a394f92119518f2e6bfc..77f97a3f2183d0b3c2f917eeb28652b25478da20 100755 (executable)
@@ -1,4 +1,24 @@
 #!/usr/bin/env perl
+
+#
+# InspIRCd -- Internet Relay Chat Daemon
+#
+#   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+#
+# This file is part of InspIRCd.  InspIRCd is free software: you can
+# redistribute it and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation, version 2.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+
 use strict;
 use warnings;
 BEGIN { push @INC, $ENV{SOURCEPATH}; }
@@ -32,7 +52,7 @@ exit 1;
 sub do_static_find {
        my @flags;
        for my $file (@ARGV) {
-               push @flags, getlinkerflags($file);
+               push @flags, get_property($file, 'LinkerFlags');
        }
        open F, '>', $out;
        print F join ' ', @flags;
@@ -41,7 +61,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 +73,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,26 +94,26 @@ sub do_compile {
        my ($do_compile, $do_link, $file) = @_;
 
        my $flags = '';
+       my $libs = '';
        my $binary = $ENV{RUNCC};
        if ($do_compile) {
-               $flags = $ENV{CXXFLAGS};
-               $flags =~ s/ -pedantic// if nopedantic($file);
-               $flags .= ' ' . getcompilerflags($file);
+               $flags = $ENV{CORECXXFLAGS} . ' ' . get_property($file, 'CompileFlags');
 
-               if ($file =~ m#(?:^|/)((?:m|cmd)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) {
-                       $flags .= ' -DMODNAME='.$1.'.so';
+               if ($file =~ m#(?:^|/)((?:m|core)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) {
+                       $flags .= ' -DMODNAME=\\"'.$1.'\\"';
                }
        } else {
                $binary = $ENV{RUNLD};
        }
 
        if ($do_link) {
-               $flags = join ' ', $flags, $ENV{PICLDFLAGS}, getlinkerflags($file);
+               $flags = join ' ', $flags, $ENV{PICLDFLAGS};
+               $libs = get_property($file, 'LinkerFlags');
        } 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;
 }