1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/EN7526G_3.18Kernel_SDK/apps/public/linux-atm/qgen/incl.pl
2024-07-22 01:58:46 -03:00

32 lines
766 B
Perl
Executable File

#!/usr/bin/perl
#
# Find include files.
#
# usage: incl.pl ... [-nostdinc] ... [-I dir] ... file ...
#
# -Idir and -I dir are equivalent, argument order doesn't matter, but
# file may be mis-detected if other options follow.
#
@STD = ("/usr/include","/usr/local/include");
while (@ARGV) {
$arg = shift @ARGV;
if ($arg eq "-nostdinc") {
undef @STD;
}
if ($arg =~ /-I/) {
if ($' ne "") { push(@USR,$'); }
else { push(@USR,shift @ARGV); }
next;
}
next if $arg =~ /^-/;
next if $arg =~ /\.h$/ && defined $last;
$last = $arg;
}
die "no include file specified" unless defined $last;
for (@STD,@USR) {
next unless defined stat $_."/".$last;
print $_."/".$last."\n" || die "print STDOUT: $!";
exit 0;
}
die "$last not found";