aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2014-04-23 10:50:27 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-25 04:23:46 +0000
commitbd38b3152d12584b9cd31d0c49706f1cebaa087a (patch)
treedd9ffd4b9f64647e9c683085b0fb73337132a7ab /tools
parent748e0d4221eabab207a350640ce3f526c73afde9 (diff)
Support out-of-source checkapi
Always call $(top_srcdir)/tools/checkAPIs.pl with -sourcedir=$(srcdir) from Makefile.am to allow out-of-source 'make checkapi'. Change-Id: I60d7e0079984a8ededdacf4517a0738486fa7973 Reviewed-on: https://code.wireshark.org/review/1294 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index de48d6d3ee..4847408ad5 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1855,6 +1855,7 @@ sub print_usage
{
print "Usage: checkAPIs.pl [-M] [-h] [-g group1] [-g group2] ... \n";
print " [--build] [-s group1] [-s group2] ... \n";
+ print " [--sourcedir=srcdir] \n";
print " [--nocheck-value-string-array] \n";
print " [--nocheck-addtext] [--nocheck-hf] [--debug] file1 file2 ...\n";
print "\n";
@@ -1999,6 +2000,7 @@ my $check_hf = 1; # default: enabled
my $check_addtext = 1; # default: enabled
my $debug_flag = 0; # default: disabled
my $buildbot_flag = 0;
+my $source_dir = "";
my $help_flag = 0;
my $pre_commit = 0;
@@ -2010,6 +2012,7 @@ my $result = GetOptions(
'check-hf!' => \$check_hf,
'check-addtext!' => \$check_addtext,
'build' => \$buildbot_flag,
+ 'sourcedir=s' => \$source_dir,
'debug' => \$debug_flag,
'pre-commit' => \$pre_commit,
'help' => \$help_flag
@@ -2048,6 +2051,9 @@ while ($_ = $ARGV[0])
my @foundAPIs = ();
my $line;
+ if ($source_dir and ! -e $filename) {
+ $filename = $source_dir . '/' . $filename;
+ }
if (! -e $filename) {
warn "No such file: \"$filename\"";
next;