s4-script: added a --waf option to minimal_includes.pl
authorAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 08:30:39 +0000 (10:30 +0200)
committerAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 09:45:43 +0000 (11:45 +0200)
This takes advantage of the new waf target syntax

source4/script/minimal_includes.pl

index 990ff00025f5aeb5e0d058212ba3e447ecb1e11f..4203d00ac0df721548663979853f120dd5823e4b 100755 (executable)
@@ -11,6 +11,7 @@ use Getopt::Long;
 my $opt_help = 0;
 my $opt_remove = 0;
 my $opt_skip_system = 0;
+my $opt_waf = 0;
 
 #####################################################################
 # write a string into a file
@@ -43,6 +44,10 @@ sub test_compile($)
 {
        my $fname = shift;
        my $obj;
+       if ($opt_waf) {
+               my $ret = `../buildtools/bin/waf $fname 2>&1`;
+               return $ret
+       }
        if ($fname =~ s/(.*)\..*$/$1.o/) {
                $obj = "$1.o";
        } else {
@@ -142,6 +147,7 @@ sub ShowHelp()
                  --help         show help
                  --remove       remove includes, don't just list them
                  --skip-system  don't remove system/ includes
+                 --waf          use waf target conventions
 ";
 }
 
@@ -151,6 +157,7 @@ GetOptions (
            'h|help|?' => \$opt_help,
            'remove' => \$opt_remove,
            'skip-system' => \$opt_skip_system,
+           'waf' => \$opt_waf,
            );
 
 if ($opt_help) {