]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - make/unit-cc.pl
Fix warnings from BSD build and work around the failures of BSD make
[user/henk/code/inspircd.git] / make / unit-cc.pl
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 BEGIN { push @INC, $ENV{SOURCEPATH}; }
5 use make::configure;
6
7 my $out = shift;
8 my $verbose;
9
10 if ($out =~ /^-/) {
11         $_ = $out;
12         $out = shift;
13         $verbose = /v/;
14 }
15
16 my $file = shift;
17
18 my $cflags = $ENV{CXXFLAGS};
19 $cflags =~ s/ -pedantic// if nopedantic($file);
20 $cflags .= ' ' . getcompilerflags($file);
21
22 my $flags;
23 if ($out =~ /\.so$/) {
24         $flags = join ' ', $cflags, $ENV{PICLDFLAGS}, getlinkerflags($file);
25 } else {
26         $flags = "$cflags -c";
27 }
28
29 my $execstr = "$ENV{RUNCC} $flags -o $out $file";
30 print "$execstr\n" if $verbose;
31 exec $execstr;
32 exit 1;