octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC compiler support [patch 27]: OCTAVE_HOME


From: Michael Goffioul
Subject: Re: MSVC compiler support [patch 27]: OCTAVE_HOME
Date: Wed, 18 Oct 2006 14:04:03 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

David Bateman a écrit :
Michael Goffioul wrote:
Defines OCTAVE_HOME automatically, allowing the full installed package
to be
relocated in another directory

This should be in src/sysdep.cc shouldn't it as its purely system
dependent..

Here's a new patch that put the code into sysdep.cc

Michael.
Index: src/sysdep.cc
===================================================================
RCS file: /cvs/octave/src/sysdep.cc,v
retrieving revision 1.119
diff -c -r1.119 sysdep.cc
*** src/sysdep.cc       19 May 2006 05:32:18 -0000      1.119
--- src/sysdep.cc       18 Oct 2006 12:03:15 -0000
***************
*** 139,144 ****
--- 139,160 ----
  }
  #endif
  
+ #if defined(_MSC_VER)
+ static void
+ MSVC_init (void)
+ {
+   // Initialize OCTAVE_HOME
+   char buffer[1024];
+   if (GetModuleFileName(NULL, buffer, 1024) > 0)
+   {
+     std::string exec_dir = buffer;
+     int pos = exec_dir.rfind("\\bin\\");
+     if (pos != NPOS)
+       octave_env::putenv(std::string("OCTAVE_HOME"), exec_dir.substr(0, pos));
+   }
+ }
+ #endif
+ 
  #if defined (__CYGWIN__)
  
  #include <limits.h>
***************
*** 236,241 ****
--- 252,259 ----
    CYGWIN_init ();
  #elif defined (__MINGW32__)
    MINGW_init ();
+ #elif defined (_MSC_VER)
+   MSVC_init ();
  #elif defined (NeXT)
    NeXT_init ();
  #elif defined (__EMX__)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]