From 6072aa0b462484da990ffa00ee39fb141fa9513f Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 22 Mar 2016 22:33:43 +0100
Subject: [PATCH] Account for Matlab 2016a in installer and mex-folder

Note that 32bit is not supported anymore

(cherry picked from commit e37b32b01534ffe9a5a5ec3f00f745720b75a83f)
---
 m4/ax_matlab_version.m4        | 3 +++
 matlab/add_path_to_mex_files.m | 2 +-
 windows/dynare.nsi             | 6 +++---
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/m4/ax_matlab_version.m4 b/m4/ax_matlab_version.m4
index b3047770e..2fae21f2c 100644
--- a/m4/ax_matlab_version.m4
+++ b/m4/ax_matlab_version.m4
@@ -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
+    *2016a | *2016A)
+      MATLAB_VERSION="9.0"
+      ;;
     *2015b | *2015B)
       MATLAB_VERSION="8.6"
       ;;
diff --git a/matlab/add_path_to_mex_files.m b/matlab/add_path_to_mex_files.m
index ff0f84114..7408746cf 100644
--- a/matlab/add_path_to_mex_files.m
+++ b/matlab/add_path_to_mex_files.m
@@ -48,7 +48,7 @@ else
                 end
             end
         else
-            tmp = [dynareroot '../mex/matlab/win64-7.8-8.6/'];
+            tmp = [dynareroot '../mex/matlab/win64-7.8-9.0/'];
             if exist(tmp, 'dir')
                 mexpath = tmp;
                 if modifypath
diff --git a/windows/dynare.nsi b/windows/dynare.nsi
index 0e1d628c6..ea17caa4b 100644
--- a/windows/dynare.nsi
+++ b/windows/dynare.nsi
@@ -98,9 +98,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.6 (R2009a to R2015b)"
- SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.6
- File ..\mex\matlab\win64-7.8-8.6\*.mexw64
+Section "MEX files for MATLAB 64-bit, version 7.8 to 9.0 (R2009a to R2016a)"
+ SetOutPath $INSTDIR\mex\matlab\win64-7.8-9.0
+ File ..\mex\matlab\win64-7.8-9.0\*.mexw64
 SectionEnd
 
 SectionGroupEnd
-- 
GitLab