Shrink wrapping in PEI:
[oota-llvm.git] / utils / GenLibDeps.pl
index 21853d5350b021aa6c88c879f7e628c6944add4c..73f3e71491a7ac6717d525ad19c1be1156094208 100755 (executable)
@@ -48,7 +48,7 @@ if (!defined($nmPath) || $nmPath eq "") {
 opendir DIR,$Directory;
 my @files = readdir DIR;
 closedir DIR;
-my @libs = grep(/libLLVM.*\.a$/,sort(@files));
+my @libs = grep(/libLLVM.*\.(dylib|so|a)$/,sort(@files));
 my @objs = grep(/LLVM.*\.o$/,sort(@files));
 
 # Declare the hashes we will use to keep track of the library and object file
@@ -66,7 +66,7 @@ foreach my $lib (@libs ) {
                    # this strips both LF and CRLF.
     $libdefs{$_} = $lib;
   }
-  close DEFS;
+  close DEFS or die "nm failed";
 }
 
 # Gather definitions from the object files.
@@ -79,7 +79,7 @@ foreach my $obj (@objs ) {
                    # this strips both LF and CRLF.    
     $objdefs{$_} = $obj;
   }
-  close DEFS;
+  close DEFS or die "nm failed";
 }
 
 # Generate one entry in the <dl> list. This generates the <dt> and <dd> elements
@@ -113,7 +113,7 @@ sub gen_one_entry {
       }
     }
   }
-  close UNDEFS;
+  close UNDEFS or die "nm failed";
   unless(keys %DepLibs) {
     # above failed
     open UNDEFS, "$nmPath -g -u $Directory/$lib |";
@@ -138,6 +138,7 @@ sub gen_one_entry {
         }
       }
     }
+    close UNDEFS or die "nm failed";
   }
 
   for my $key (sort keys %DepLibs) {