aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-05-02 13:59:42 +0000
committerDaniel Jacobowitz <drow@false.org>2006-05-02 13:59:42 +0000
commitb02e2fdabec1f0f18cab48f04ad6b1b8ce4f47bc (patch)
treed5d0d1d1f45c9ca1bdf5b2ba37d74c07b1c9013c /etc
parenta78d2a672f1305eab1502d603e1c5d3cf10d673d (diff)
downloadbinutils-b02e2fdabec1f0f18cab48f04ad6b1b8ce4f47bc.zip
binutils-b02e2fdabec1f0f18cab48f04ad6b1b8ce4f47bc.tar.gz
binutils-b02e2fdabec1f0f18cab48f04ad6b1b8ce4f47bc.tar.bz2
* texi2pod.pl: Handle -I.
Diffstat (limited to 'etc')
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/texi2pod.pl18
2 files changed, 18 insertions, 4 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 0d2b80c..09d002f 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2006-05-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * texi2pod.pl: Handle -I.
+
2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.in: Add install-html target. Add htmldir,
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
index 9696a12..57d1d5b 100644
--- a/etc/texi2pod.pl
+++ b/etc/texi2pod.pl
@@ -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;
};