2017-09-14 73 views
0

我正在尝试将我们的构建系统更新为非递归构建系统。该系统的当前布局(在此我们建立两个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-mythbusterKarel Zak's blog),而不是使用SUBDIRS,我includecommonmex.amproject/mex/build/matlab/Makefile.ammex*.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,但不是一个会被忽略另一个。

当我运行makemex文件被构建,但没有任何扩展(我构建在macOS上,但结果在我想象的GNU/Linux上是相同的)。当我们编译这些mex文件以在GNU/Linux,macOS和Windows上分发时,扩展对我们来说非常重要。

如何在使用MEXEXT变量覆盖在configure.ac中设置的EXEEXT的同时在configure.ac中设置的情况下移动到非递归构建系统?

回答

0

最后,这很容易。只需覆盖EXEEXT的定义configure.ac

EXEEXT=$MEXEXT