*** build-farm-4.11/run_build.pl~	Fri Jun 14 09:05:52 2013
--- build-farm-4.11/run_build.pl	Wed Apr  2 23:31:27 2014
***************
*** 1506,1520 ****
      my $objdump = $host || 'objdump';
      my @err = `$objdump -W 2>&1`;
      my @readelferr = `readelf -w 2>&1`;
      my %syms;
      my @dumpout;
      my @flds;
  
!     foreach my $bin (
!         glob("$installdir/bin/*"),
!         glob("$installdir/lib/*"),
!         glob("$installdir/lib/postgresql/*")
!       )
      {
          next if $bin =~ m!bin/(ipcclean|pltcl_)!;
          next unless -f $bin;
--- 1506,1536 ----
      my $objdump = $host || 'objdump';
      my @err = `$objdump -W 2>&1`;
      my @readelferr = `readelf -w 2>&1`;
+     my $using_osx = (`uname` eq "Darwin\n");
+     my @testfiles;
      my %syms;
      my @dumpout;
      my @flds;
  
!     if ($using_osx)
!     {
!         # On OS X, we need to examine the .o files
!         my $obj_wanted = sub {
!             /^.*\.o\z/s && push(@testfiles, $File::Find::name);
!         };
! 
!         File::Find::find($obj_wanted,$pgsql);
!     }
!     else
!     {
!         # Elsewhere, look at the installed executables and shared libraries
!         @testfiles = (
!             glob("$installdir/bin/*"),
!             glob("$installdir/lib/*"),
!             glob("$installdir/lib/postgresql/*")
!         );
!     }
!     foreach my $bin (@testfiles)
      {
          next if $bin =~ m!bin/(ipcclean|pltcl_)!;
          next unless -f $bin;
***************
*** 1534,1540 ****
          }
          elsif ( @readelferr > 10 )
          {
- 
              # FreeBSD, similar output to Linux
              @dumpout =
  `readelf -w $bin 2>/dev/null | egrep -A3 DW_TAG_typedef 2>/dev/null`;
--- 1550,1555 ----
***************
*** 1546,1551 ****
--- 1561,1579 ----
                  $syms{$flds[-1]} =1;
              }
          }
+         elsif ($using_osx)
+         {
+             @dumpout =
+ `dwarfdump $bin 2>/dev/null | egrep -A2 TAG_typedef 2>/dev/null`;
+             foreach (@dumpout)
+             {
+                 @flds = split;
+                 next unless (@flds == 3);
+                 next unless ($flds[0] eq "AT_name(");
+                 next unless ($flds[1] =~ m/^"(.*)"$/);
+                 $syms{$1} =1;
+             }
+         }
          else
          {
              @dumpout = `$objdump --stabs $bin 2>/dev/null`;
