I tested the new option in my build system. It seems to have fixed the problem. However, I wasn't able to test the the default, i.e. not specifying mexname at all. It appears like your previous changes broke directors as 'make check-matlab-test-suite RUNPIPE=>>/tmp/xxx' now hangs. The hang occurred before I made the changes included in this pull request.
I tested the new option in my build system. It seems to have fixed the problem. However, I wasn't able to test the the default, i.e. not specifying mexname at all. It appears like your previous changes broke directors as 'make check-matlab-test-suite RUNPIPE=>>/tmp/xxx' now hangs. The hang occurred before I made the changes included in this pull request.