From 84b65c91795eef61ca7c16b0ab2288616b6fdff6 Mon Sep 17 00:00:00 2001
From: michel <michel@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Tue, 8 Dec 2009 14:02:02 +0000
Subject: [PATCH] mex for Linux (to be tested)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3210 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 preprocessor/ModFile.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 87d998377d..ebba73f41b 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -296,8 +296,12 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all) const
 
   // Compile the dynamic MEX file for use_dll option
   if (use_dll)
-    mOutputFile << "if ~exist('OCTAVE_VERSION') && ispc" << endl
-                << "  eval('mex -O LINKER=''echo EXPORTS > mex.def & echo mexFunction & echo Dynamic >> mex.def & gcc-3'' LDFLAGS=''-pthread -shared -Wl,--no-undefined'' " << basename << "_dynamic.c')" << endl // This command is enclosed in an eval(), because otherwise it will make Octave fail
+    mOutputFile << "if ~exist('OCTAVE_VERSION')" << endl
+                << "  if ispc" << endl
+                << "    eval('mex -O LINKER=''echo EXPORTS > mex.def & echo mexFunction & echo Dynamic >> mex.def & gcc-3'' LDFLAGS=''-pthread -shared -Wl,--no-undefined'' " << basename << "_dynamic.c')" << endl // This command is enclosed in an eval(), because otherwise it will make Octave fail
+                << "  else" << endl
+                << "    eval('mex -v -O LDFLAGS=''-pthread -shared -Wl,--no-undefined'' " << basename << "_dynamic.c')" << endl // This command is enclosed in an eval(), because otherwise it will make Octave fail
+                << "  end" << endl
                 << "else" << endl
                 << "  mex "  << basename << "_dynamic.c" << endl
                 << "end" << endl;
-- 
GitLab