helper.pl: don't use sed, support CC variable for preprocessing

This commit is contained in:
Daniel Mendler 2019-06-07 00:18:51 +02:00 committed by Steffen Jaeckel
parent 8cf4363992
commit f5b2106a63
No known key found for this signature in database
GPG Key ID: AF0CB17621EDAD72

View File

@ -363,8 +363,9 @@ EOS
read $src, $content, -s $src;
close $src;
} else {
my $cmd = "gcc -E -x c -DLTM_ALL $filename | sed '/# 1 \"$filename\"/,/# 2 \"$filename\"/d'";
$content = qx/$cmd/;
my $cc = $ENV{'CC'} || 'gcc';
$content = `$cc -E -x c -DLTM_ALL $filename`;
$content =~ s/^# 1 "$filename".*?^# 2 "$filename"//ms;
}
# convert filename to upper case so we can use it as a define