Skip to content

Commit 62b65af

Browse files
committed
helper.pl: don't use sed, support CC variable for preprocessing
1 parent 982fa1a commit 62b65af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

helper.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,9 @@ sub update_dep
363363
read $src, $content, -s $src;
364364
close $src;
365365
} else {
366-
my $cmd = "gcc -E -x c -DLTM_ALL $filename | sed '/# 1 \"$filename\"/,/# 2 \"$filename\"/d'";
367-
$content = qx/$cmd/;
366+
my $cc = $ENV{'CC'} || 'gcc';
367+
$content = `$cc -E -x c -DLTM_ALL $filename`;
368+
$content =~ s/^# 1 "$filename".*?^# 2 "$filename"//ms;
368369
}
369370

370371
# convert filename to upper case so we can use it as a define

0 commit comments

Comments
 (0)