X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Funit-cc.pl;h=66e9b15dcc2356b4c035fc42042f1c5d039198eb;hb=2d97be1d32cb518b104583239c9483410b268fac;hp=df718cdb82785b0b8b2d248dd7e571868d1d6807;hpb=27ae66eb3fb7056570936e7f4655ec3128bac2a7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/unit-cc.pl b/make/unit-cc.pl index df718cdb8..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') { @@ -52,7 +68,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; @@ -97,12 +113,10 @@ sub do_compile { my $libs = ''; my $binary = $ENV{RUNCC}; if ($do_compile) { - $flags = $ENV{CORECXXFLAGS}; - $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}; @@ -110,7 +124,7 @@ sub do_compile { if ($do_link) { $flags = join ' ', $flags, $ENV{PICLDFLAGS}; - $libs = join ' ', getlinkerflags($file); + $libs = get_property($file, 'LinkerFlags'); } else { $flags .= ' -c'; }