use "otool -L" instead of "ldd" on Darwin
authorAlexey Zakhlestin <indeyets@gmail.com>
Fri, 4 Jun 2010 10:44:01 +0000 (14:44 +0400)
committerJohan Dahlin <johan@gnome.org>
Fri, 4 Jun 2010 12:46:12 +0000 (09:46 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=606686

giscanner/shlibs.py

index cac4fdf..563a55e 100644 (file)
@@ -21,6 +21,7 @@
 
 import re
 import subprocess
+import platform
 
 from .utils import get_libtool_command, extract_libtool_shlib
 
@@ -71,7 +72,10 @@ def _resolve_non_libtool(options, binary, libraries):
     if libtool:
         args.extend(libtool)
         args.append('--mode=execute')
-    args.extend(['ldd', binary.args[0]])
+    if platform.system() == 'Darwin':
+        args.extend(['otool', '-L', binary.args[0]])
+    else:
+        args.extend(['ldd', binary.args[0]])
     proc = subprocess.Popen(args, stdout=subprocess.PIPE)
     patterns = {}
     for library in libraries: