# HG changeset patch # User jwe # Date 1161746796 0 # Node ID 40ab35ab651cd6591abcd3eee56058993831d689 # Parent 802aec2b1a2e8deca281f08e56268a492886479e [project @ 2006-10-25 03:26:36 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-10-24 Michael Goffioul + + * Makefile.in: Filter out $(XTRA_CXXDEFS) from $(ALL_CXXFLAGS) for + $(DLD_PICOBJ). + +2006-10-24 John W. Eaton + + * sysdep.cc (MSC_init): New function. + (sysdep_init): Call it. + (w32_set_octave_home): New function, based on code from Michael + Goffioul . + (MINGW_init): Call w32_set_octave_home here too. + 2006-10-23 John W. Eaton * symtab.cc (symbol_table::clear_mex_functions): New function. diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -264,6 +264,9 @@ lex.o parse.o __gnuplot_raw__.o pic/lex.o pic/parse.o pic/__gnuplot_raw__.o: \ ALL_CXXFLAGS := $(filter-out -Wold-style-cast, $(ALL_CXXFLAGS)) +$(DLD_PICOBJ): \ + ALL_CXXFLAGS := $(filter-out $(XTRA_CXXDEFS), $(ALL_CXXFLAGS)) + XERBLA = ../libcruft/blas-xtra/xerbla.o ifdef FPICFLAG PIC_XERBLA = ../libcruft/blas-xtra/pic/xerbla.o diff --git a/src/sysdep.cc b/src/sysdep.cc --- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -106,6 +106,40 @@ } #endif +static void +w32_set_octave_home (void) +{ +#if defined (__WIN32__) && ! defined (_POSIX_VERSION) + int n = 1024; + + std::string bin_dir (' ', n); + + while (true) + { + int status = GetModuleFileName (0, &bin_dir[0], n); + + if (status < n) + { + bin_dir.resize (status); + break; + } + else + { + n *= 2; + bin_dir.resize (n); + } + } + + if (! bin_dir.empty ()) + { + size_t pos = bin_dir.rfind ("\\bin\\"); + + if (pos != NPOS) + octave_env::putenv ("OCTAVE_HOME", bin_dir.substr (0, pos)); + } +#endif +} + void w32_set_quiet_shutdown (void) { @@ -132,6 +166,8 @@ static void MINGW_init (void) { + w32_set_octave_home (); + // Init mutex to protect setjmp/longjmp and get main thread context w32_sigint_init (); @@ -139,6 +175,14 @@ } #endif +#if defined (_MSC_VER) +static void +MSVC_init (void) +{ + w32_set_octave_home (); +} +#endif + #if defined (__CYGWIN__) #include @@ -236,6 +280,8 @@ CYGWIN_init (); #elif defined (__MINGW32__) MINGW_init (); +#elif defined (_MSC_VER) + MSVC_init (); #elif defined (NeXT) NeXT_init (); #elif defined (__EMX__)