Salome HOME
typo-fix by Kunda
[modules/yacs.git] / bin / server.py
index dcb9488f4068787b081217c6ee680cfe783a58e8..75b6b16e011967c10ce6a6d2410774834559de30 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -62,15 +62,19 @@ class Server:
         myargs=self.ARGS
         if self.args.get('xterm'):
             # (Debian) send LD_LIBRARY_PATH to children shells (xterm)
-            if sys.platform != "win32":
+          if sys.platform == "darwin":
+              env_ld_library_path=['env', 'DYLD_LIBRARY_PATH='
+                                   + os.getenv("DYLD_FALLBACK_LIBRARY_PATH")]
+              myargs = myargs +['-T']+self.CMD[:1]+['-e'] + env_ld_library_path
+          elif sys.platform != "win32":
               env_ld_library_path=['env', 'LD_LIBRARY_PATH='
                                    + os.getenv("LD_LIBRARY_PATH")]
               myargs = myargs +['-T']+self.CMD[:1]+['-e'] + env_ld_library_path
         command = myargs + self.CMD
         #print "command = ", command
         if sys.platform == "win32":
-          import win32pm
-          pid = win32pm.spawnpid( command, '-nc' )
+          import subprocess
+          pid = subprocess.Popen(command).pid
         elif Server.server_launch_mode == "fork":
           pid = os.spawnvp(os.P_NOWAIT, command[0], command)
         else: # Server launch mode is daemon