From 03a690a50baea7a4d7a4d380ec669d0c2f0a23e1 Mon Sep 17 00:00:00 2001
From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Fri, 18 Dec 2009 13:40:50 +0000
Subject: [PATCH] 4.1 branch: merged r3269 (Fix problem with USE_DLL under
 Octave 3.2)

git-svn-id: https://www.dynare.org/svn/dynare/branches/4.1@3270 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 preprocessor/ModFile.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 666714e587..0ee3b6ff19 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -318,8 +318,11 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all
       mOutputFile << "    eval('mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined error -arch \\$ARCHS -Wl,-syslibroot,\\$SDKROOT -mmacosx-version-min=\\$MACOSX_DEPLOYMENT_TARGET -bundle'' " << basename << "_dynamic.c')" << endl; // MATLAB/MacOS
 # endif
 #endif
-      mOutputFile << "else" << endl
-                  << "    mex "  << basename << "_dynamic.c" << endl // Octave
+      mOutputFile << "else" << endl // Octave
+                  << "    if ~octave_ver_less_than('3.2.0')" << endl // Workaround for bug in Octave >= 3.2, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550823
+                  << "        sleep(2)" << endl
+                  << "    end" << endl
+                  << "    mex " << basename << "_dynamic.c" << endl
                   << "end" << endl;
     }
 
-- 
GitLab