passing MEXEXT to compile MEX files
In Matlab, the extension name of the MEX file varies accross plateform. When we use USE_DLL and call the model file DLL in another DLL (it is the case for estimation, for example) we need to know this extension. Currently, the Matlab calling program use mexext() to get a string and passes this string to the, say, estimation DLL. This is very roundabout, because mexext() makes a system call to evaluate a batch file to learn the name of the MEX extension of a given system. I would prefer to know the extension name at the time of compilation of the DLL and hard code it in the DLL. Currently, the build system already puts the extension name in environment variable MEXEXT. I suggest the following modification to the Makefile: from MATLAB_DEFS = -D_GNU_SOURCE -DNDEBUG -DMATLAB_VERSION=0x0713 to MATLAB_DEFS = -DMEXEXT=$MEXEXT -D_GNU_SOURCE -DNDEBUG -DMATLAB_VERSION=0x0713
Then, we can just use macrovariable MEXEXT in the C++ code when necessary.
The same can be used for OCTAVE but I expect the name of the extension to be always the same.