From b3fffef24d5f31f34cbdd5bdcbcf06616d7a77bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 21 Mar 2013 18:20:30 +0100
Subject: [PATCH] Provisions for MATLAB 8.1 (R2013a) (cherry picked from commit
 3bbdbf83870af1fc4493b897f5413be0d3cdbc4b)

---
 m4/ax_matlab_version.m4      |  5 ++++-
 matlab/dynare_config.m       |  8 ++++----
 osx/createOsxFolderForPkg.sh | 24 ++++++++++++------------
 windows/dynare.nsi           | 12 ++++++------
 4 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/m4/ax_matlab_version.m4 b/m4/ax_matlab_version.m4
index 049feb803..12b5693dc 100644
--- a/m4/ax_matlab_version.m4
+++ b/m4/ax_matlab_version.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2009-2012 Dynare Team
+dnl Copyright (C) 2009-2013 Dynare Team
 dnl
 dnl This file is part of Dynare.
 dnl
@@ -22,6 +22,9 @@ AC_REQUIRE([AX_MATLAB])
 AC_MSG_CHECKING([for MATLAB version])
 if test "x$MATLAB_VERSION" != "x"; then
   case $MATLAB_VERSION in
+    *2013a | *2013A)
+      MATLAB_VERSION="8.1"
+      ;;
     *2012b | *2012B)
       MATLAB_VERSION="8.0"
       ;;
diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m
index e89e6f927..57f916113 100644
--- a/matlab/dynare_config.m
+++ b/matlab/dynare_config.m
@@ -15,7 +15,7 @@ function dynareroot = dynare_config(path_to_dynare,verbose)
 % SPECIAL REQUIREMENTS
 %   none
 
-% Copyright (C) 2001-2012 Dynare Team
+% Copyright (C) 2001-2013 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -110,7 +110,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.0'];
+            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
@@ -135,7 +135,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.0'];
+            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
@@ -149,7 +149,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/osx32-7.5-8.0'];
+            mexpath = [dynareroot '../mex/matlab/osx32-7.5-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
diff --git a/osx/createOsxFolderForPkg.sh b/osx/createOsxFolderForPkg.sh
index da91860af..feefa8de7 100755
--- a/osx/createOsxFolderForPkg.sh
+++ b/osx/createOsxFolderForPkg.sh
@@ -29,7 +29,7 @@ mkdir -p "$INSTALLDIR/contrib/ms-sbvar/TZcode"
 mkdir -p "$INSTALLDIR/mex/octave"
 mkdir -p "$INSTALLDIR/mex/matlab/osx64"
 mkdir "$INSTALLDIR/mex/matlab/osx32-7.4"
-mkdir "$INSTALLDIR/mex/matlab/osx32-7.5-8.0"
+mkdir "$INSTALLDIR/mex/matlab/osx32-7.5-8.1"
 
 
 # top level
@@ -122,17 +122,17 @@ cd $TOP_DYN_DIR/mex/build/matlab
 make
 
 # Matlab
-cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci                            $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci                     $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci                                $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci             $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci                                    $INSTALLDIR/mex/matlab/osx32-7.5-8.0
+cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci                            $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci                     $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci                                $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci             $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci                                    $INSTALLDIR/mex/matlab/osx32-7.5-8.1
 
 
 #####################################
diff --git a/windows/dynare.nsi b/windows/dynare.nsi
index 6ec57ee02..7a32ad555 100644
--- a/windows/dynare.nsi
+++ b/windows/dynare.nsi
@@ -93,9 +93,9 @@ Section "MEX files for MATLAB 32-bit, version 7.3 to 7.4 (R2006b to R2007a)"
  File ..\mex\matlab\win32-7.3-7.4\*.mexw32
 SectionEnd
 
-Section "MEX files for MATLAB 32-bit, version 7.5 to 8.0 (R2007b to R2012b)"
- SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.0
- File ..\mex\matlab\win32-7.5-8.0\*.mexw32
+Section "MEX files for MATLAB 32-bit, version 7.5 to 8.1 (R2007b to R2013a)"
+ SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.1
+ File ..\mex\matlab\win32-7.5-8.1\*.mexw32
 SectionEnd
 
 Section "MEX files for MATLAB 64-bit, version 7.2 (R2006a)"
@@ -113,9 +113,9 @@ Section "MEX files for MATLAB 64-bit, version 7.5 to 7.7 (R2007b to R2008b)"
  File ..\mex\matlab\win64-7.5-7.7\*.mexw64
 SectionEnd
 
-Section "MEX files for MATLAB 64-bit, version 7.8 to 8.0 (R2009a to R2012b)"
- SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.0
- File ..\mex\matlab\win64-7.8-8.0\*.mexw64
+Section "MEX files for MATLAB 64-bit, version 7.8 to 8.1 (R2009a to R2013a)"
+ SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.1
+ File ..\mex\matlab\win64-7.8-8.1\*.mexw64
 SectionEnd
 
 SectionGroupEnd
-- 
GitLab