Commits

Brian Kearns committed c729af9

use DYLD_LIBRARY_PATH on darwin

  • Participants
  • Parent commits b585e6c

Comments (0)

Files changed (3)

File rpython/translator/c/gcc/test/test_asmgcroot.py

             else:
                 redirect = ''
             if config.translation.shared and os.name == 'posix':
-                env = 'LD_LIBRARY_PATH="%s" ' % (exe_name.dirpath(),)
+                library_path = exe_name.dirpath()
+                if sys.platform == 'darwin':
+                    env = 'DYLD_LIBRARY_PATH="%s" ' % library_path
+                else:
+                    env = 'LD_LIBRARY_PATH="%s" ' % library_path
             else:
                 env = ''
             cwd = os.getcwd()

File rpython/translator/c/test/test_standalone.py

         t, cbuilder = self.compile(entry_point, shared=True)
         assert cbuilder.shared_library_name is not None
         assert cbuilder.shared_library_name != cbuilder.executable_name
-        monkeypatch.setenv('LD_LIBRARY_PATH',
-                           cbuilder.shared_library_name.dirpath())
+        if os.name == 'posix':
+            library_path = cbuilder.shared_library_name.dirpath()
+            if sys.platform == 'darwin':
+                monkeypatch.setenv('DYLD_LIBRARY_PATH', library_path)
+            else:
+                monkeypatch.setenv('LD_LIBRARY_PATH', library_path)
         out, err = cbuilder.cmdexec("a b")
         assert out == "3"
 

File rpython/translator/platform/__init__.py

 
         # Set LD_LIBRARY_PATH on posix platforms
         if os.name == 'posix' and compilation_info is not None:
-            env['LD_LIBRARY_PATH'] = ':'.join(
-                [str(i) for i in compilation_info.library_dirs])
+            library_path = ':'.join([str(i) for i in compilation_info.library_dirs])
+            if sys.platform == 'darwin':
+                env['DYLD_LIBRARY_PATH'] = library_path
+            else:
+                env['LD_LIBRARY_PATH'] = library_path
 
         returncode, stdout, stderr = _run_subprocess(str(executable), args,
                                                      env)