Also check include dirs for IDL files.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 15 Oct 2008 00:06:41 +0000 (02:06 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 15 Oct 2008 00:06:41 +0000 (02:06 +0200)
pidl/lib/Parse/Pidl/ODL.pm

index c49cdfb..b323a6a 100644 (file)
@@ -57,11 +57,18 @@ sub ODL2IDL
                if ($x->{TYPE} eq "IMPORT") {
                        foreach my $idl_file (@{$x->{PATHS}}) {
                                $idl_file = unmake_str($idl_file);
-                               unless (-f "$basedir/$idl_file") {
+                               my $idl_path = undef;
+                               foreach ($basedir, @$opt_incdirs) {
+                                       if (-f "$_/$idl_file") {
+                                               $idl_path = "$_/$idl_file";
+                                               last;
+                                       }
+                               }
+                               unless ($idl_path) {
                                        error($x, "Unable to open include file `$idl_file'");
                                        next;
                                }
-                               my $podl = Parse::Pidl::IDL::parse_file("$basedir/$idl_file", $opt_incdirs);
+                               my $podl = Parse::Pidl::IDL::parse_file($idl_path, $opt_incdirs);
                                if (defined(@$podl)) {
                                        require Parse::Pidl::Typelist;
 
@@ -74,7 +81,7 @@ sub ODL2IDL
                                                }
                                        }
                                } else {
-                                       error($x, "Failed to parse $idl_file");
+                                       error($x, "Failed to parse $idl_path");
                                }
                        }
                }