Skip to content
Snippets Groups Projects
Commit a858b117 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

build script: Fix recursive header inclusion.

parent 083a445b
No related branches found
No related tags found
No related merge requests found
...@@ -310,7 +310,7 @@ sub parseSource($$$;$) ...@@ -310,7 +310,7 @@ sub parseSource($$$;$)
$sys_incs = []; $sys_incs = [];
$prg_incs = []; $prg_incs = [];
print(STDERR 'Opening ', $srcfile, "\n") if $debug > 2; print(STDERR 'Opening ', $srcfile, "\n") if $debug > 2;
open($fh, $srcfile) or die('Cannot open ', $srcfile, ': ', $!); open($fh, '<', $srcfile) or die('Cannot open ', $srcfile, ': ', $!);
print(STDERR 'Parsing ', $srcfile, "\n") if $debug > 1; print(STDERR 'Parsing ', $srcfile, "\n") if $debug > 1;
my @predicateLevels = ({'ignored' => 0}); my @predicateLevels = ({'ignored' => 0});
my $ignored = 0; my $ignored = 0;
...@@ -457,15 +457,16 @@ sub parseSource($$$;$) ...@@ -457,15 +457,16 @@ sub parseSource($$$;$)
my $moduleName = lc($1); my $moduleName = lc($1);
pushUnique(\@moduleProvide, $moduleName); pushUnique(\@moduleProvide, $moduleName);
} elsif (/^\s*#*include\s+(?:(")(.+)?"|(<)(.+)?>)/) { } elsif (/^\s*#*include\s+(?:(")(.+)?"|(<)(.+)?>)/) {
pushUnique($1 eq '"' ? ($prg_incs, $2) my ($sigil, $headerSpec) = defined($1) ? ($1, $2) : ($3, $4);
: ($sys_incs, $2)); pushUnique($sigil eq '"' ? ($prg_incs, $headerSpec)
: ($sys_incs, $headerSpec));
my ($incfile) = searchIncludes($srcfile, my ($incfile) = searchIncludes($srcfile,
[$1 eq '<' ? $2 : () ], [$sigil eq '<' ? $headerSpec : () ],
[$1 eq '"' ? $2 : () ], [$sigil eq '"' ? $headerSpec : () ],
@$incDirs); @$incDirs);
parseSource($incfile, $defines, $incDirs, $preprocOutFh); parseSource($incfile, $defines, $incDirs, $preprocOutFh);
print(STDERR 'Unsupported preprocessor include "', print(STDERR 'Unsupported preprocessor include "',
defined $1 ? $1 : $2, $headerSpec,
'" found while writing preprocessor output!') '" found while writing preprocessor output!')
if (defined($preprocOutFh)); if (defined($preprocOutFh));
} elsif (/^\s*include\s+(["'])(.+)?\1/i) { } elsif (/^\s*include\s+(["'])(.+)?\1/i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment