]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - make/unit-cc.pl
Add directory change to unit-cc, to fix the immensely stupid BSD make behavior of...
[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 chdir $ENV{BUILDPATH};
8
9 my $out = shift;
10 my $verbose;
11
12 if ($out =~ /^-/) {
13         $_ = $out;
14         $out = shift;
15         $verbose = /v/;
16 }
17
18 my $file = shift;
19
20 my $cflags = $ENV{CXXFLAGS};
21 $cflags =~ s/ -pedantic// if nopedantic($file);
22 $cflags .= ' ' . getcompilerflags($file);
23
24 my $flags;
25 if ($out =~ /\.so$/) {
26         $flags = join ' ', $cflags, $ENV{PICLDFLAGS}, getlinkerflags($file);
27 } else {
28         $flags = "$cflags -c";
29 }
30
31 my $execstr = "$ENV{RUNCC} $flags -o $out $file";
32 print "$execstr\n" if $verbose;
33 exec $execstr;
34 exit 1;