[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__)
- MSVC compiler support [patch 25]: INFINITE, (continued)
- MSVC compiler support [patch 24]: strftime crash, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 24]: strftime crash, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 24]: strftime crash, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 26]: MinGW code share, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 26]: MinGW code share, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 27]: OCTAVE_HOME, Michael Goffioul, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, David Bateman, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, Michael Goffioul, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME,
Michael Goffioul <=
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, John W. Eaton, 2006/10/24
- MSVC compiler support [patch 28]: setvbuf crash, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 28]: setvbuf crash, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 29]: Backslash in path, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 29]: Backslash in path, John W. Eaton, 2006/10/27
- MSVC compiler support [patch 30]: Help MSVC with templates, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 30]: Help MSVC with templates, John W. Eaton, 2006/10/26
- MSVC compiler support [patch 31]: CHAR_BIT, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 31]: CHAR_BIT, John W. Eaton, 2006/10/17
- MSVC compiler support [patch 32]: ls, Michael Goffioul, 2006/10/17