我正在尝试将我们的构建系统更新为非递归构建系统。该系统的当前布局(在此我们建立两个GNU八音和Matlab MEX文件)是:从递归到非递归构建系统
---project/
| ---mex/
| | +--src/ (contains common source files)
| | +--matlab-mex/ (contains compiled Matlab mex files)
| | +--octave-mex/ (contains compiled Octave mex files)
| | ---build/
| | | mex1.am
| | | ...
| | | mexN.am
| | | ---matlab/
| | | | Makefile.am
| | | | configure.ac
| | | | commonmex.am
| | | | ---mex1/
| | | | | Makefile.am
| | | | ...
| | | | ---mexN/
| | | | | Makefile.am
| | | +--octave/ (... same layout as project/mex/build/matlab/)
目前,commonmex.am
包含行EXEEXT=$(MEXEXT)
,让mex
文件具有相应扩展名(.mex
,.mexmaci
编译.mexmaci64
等),取决于由configure
发现的Matlab版本和OS系统/体系结构。作为一个递归系统,这很有效。
问题
在移动到一个非递归构建系统(具有读autotools-mythbuster和Karel Zak's blog),而不是使用SUBDIRS
,我include
commonmex.am
和project/mex/build/matlab/Makefile.am
的mex*.am
。我遇到的问题是我无法像上面那样覆盖EXEEXT
。当我运行autoreconf -si
我得到以下警告:
./commonmex.am:1: warning: EXEEXT was already defined in condition TRUE, which includes condition DO_SOMETHING ...
Makefile.am:10: 'mex1/mex1.am' included from here
mex1/mex1.am:1: './commonmex.am' included from here
configure.ac:59: ... 'EXEEXT' previously defined here
NB:if DO_SOMETHING
是一个条件在Makefile.am
了覆盖整个Makefile文件等,如果人建筑有GNU八度或Matlab,但不是一个会被忽略另一个。
当我运行make
mex
文件被构建,但没有任何扩展(我构建在macOS上,但结果在我想象的GNU/Linux上是相同的)。当我们编译这些mex文件以在GNU/Linux,macOS和Windows上分发时,扩展对我们来说非常重要。
如何在使用MEXEXT
变量覆盖在configure.ac
中设置的EXEEXT
的同时在configure.ac中设置的情况下移动到非递归构建系统?