]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* texi2pod.pl: Handle -I.
authorDaniel Jacobowitz <dan@codesourcery.com>
Tue, 2 May 2006 13:50:58 +0000 (13:50 +0000)
committerDaniel Jacobowitz <drow@gcc.gnu.org>
Tue, 2 May 2006 13:50:58 +0000 (13:50 +0000)
From-SVN: r113462

contrib/ChangeLog
contrib/texi2pod.pl

index 829bdea71a5da268d6b60dce8cc6c1434fe2541e..57e9dd54782cd120f031be780d0d2c1d81548246 100644 (file)
@@ -1,3 +1,7 @@
+2006-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * texi2pod.pl: Handle -I.
+
 2006-02-28  Mark Mitchell  <mark@codesourcery.com>
 
        * gennews (files): Update for GCC 4.1.
index 9696a12f3610a10d9579ea12cc6a6680a8d0905c..57d1d5bcd63202ec8d9358863f7fdf39249900d9 100755 (executable)
@@ -36,6 +36,7 @@ $shift = "";
 $fnno = 1;
 $inf = "";
 $ibase = "";
+@ipath = ();
 
 while ($_ = shift) {
     if (/^-D(.*)$/) {
@@ -51,6 +52,13 @@ while ($_ = shift) {
        die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
            unless $flag =~ /^[a-zA-Z0-9_-]+$/;
        $defs{$flag} = $value;
+    } elsif (/^-I(.*)$/) {
+       if ($1 ne "") {
+           $flag = $1;
+       } else {
+           $flag = shift;
+       }
+        push (@ipath, $flag);
     } elsif (/^-/) {
        usage();
     } else {
@@ -229,10 +237,12 @@ while(<$inf>) {
        $inf = gensym();
        $file = postprocess($1);
 
-       # Try cwd and $ibase.
-       open($inf, "<" . $file) 
-           or open($inf, "<" . $ibase . "/" . $file)
-               or die "cannot open $file or $ibase/$file: $!\n";
+       # Try cwd and $ibase, then explicit -I paths.
+       $done = 0;
+       foreach $path (".", $ibase, @ipath) {
+           open($inf, "<" . $path . "/" . $file) and ($done = 1, last);
+       }
+       die "cannot find $file" if !$done;
        next;
     };