#!/usr/bin/perl
use strict;



my $DPRINT = 0;
sub dprint
{
    if($DPRINT)
    {
        print ("dbg: ",@_);
    }
    
}

sub getLibraries($)
{
    my ($lib) = (@_);
    my $out = `otool -L "$lib"`;

    my @lines = split(/\n/,$out);
    my $lineCount = scalar(@lines);
    my @libraries;

    # +------------
    # | pull the library paths out of the
    # | output of otool
    # |

    for(my $i = 1; $i < $lineCount; $i++)
    {
        my $line = $lines[$i];
        if($line =~ /^\s*(.*?) \(.*$/)
        {
            my $library = $1;
            push(@libraries,$library);
            #print "library: $library\n";
        }
    }
    return @libraries;
}

return 1; # success on the import
