X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Funit-cc.pl;h=66e9b15dcc2356b4c035fc42042f1c5d039198eb;hb=bdefe32944c2fa2d27dd00ba6eec8863d72d2dbd;hp=5b0c50021406af4112bf54ce67f145174430ba6d;hpb=68afa315fccf5d741103137cb65d613a4e9bfef1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 5b0c50021..66e9b15dc 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -30,6 +30,22 @@ my $type = shift; my $out = shift; my $verbose = ($type =~ s/-v$//); +## BEGIN HACK: REMOVE IN 2.2! +sub read_config_cache { + my %cfg = (); + open(CACHE, '../.config.cache') or return %cfg; + while (my $line = ) { + next if $line =~ /^\s*($|\#)/; + my ($key, $value) = ($line =~ /^(\S+)="(.*)"$/); + $cfg{$key} = $value; + } + close(CACHE); + return %cfg; +} + +our %config = read_config_cache(); +## END HACK + if ($type eq 'gen-ld') { do_static_find(@ARGV); } elsif ($type eq 'static-ld') { @@ -99,7 +115,7 @@ sub do_compile { if ($do_compile) { $flags = $ENV{CORECXXFLAGS} . ' ' . get_property($file, 'CompileFlags'); - if ($file =~ m#(?:^|/)((?:m|cmd)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) { + if ($file =~ m#(?:^|/)((?:m|core)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) { $flags .= ' -DMODNAME=\\"'.$1.'\\"'; } } else {