2012-05-08 111 views
0

我想杜致以makefile.am有這樣一個選項:配置和Makefile

這是原來的部分來自makefile.am:

OPTIONS := -Wl,-rpath,/usr/local/lib 
if DEBUGGING 
    OPTIONS += -O0 -g3 -Wall 

這個北京時間我想添加什麼

OPTIONS := -Wl,-rpath,/usr/local/lib 
if WIN 
    OPTIONS += -static-libgcc -static-libstdc++ 
if DEBUGGING 
    OPTIONS += -O0 -g3 -Wall 

這樣我就可以將--enable-win傳遞給./configure,並且將使用「if WIN」部分。正如我所見,我必須將此選項添加到configure.ac文件,但我不知道如何。

回答

0

您應該在configure.ac文件中使用宏AC_ARG_ENABLE。

AC_ARG_ENABLE允許您定義另一個命令行選項。 示例:

AC_ARG_ENABLE(debug-rwlock, 
[ --enable-debug-rwlock Enable an RWLock that prints debug notices \ 
    on the screen. This is a debugging feature which should not be \ 
    usually enabled], 
[ debug_rwlock=yes 
]) 
+0

...並使用AM_CONDITIONAL將條件傳遞給Makefile.am。 – thiton