【问题标题】:configure and makefile配置和生成文件
【发布时间】:2012-05-08 22:08:12
【问题描述】:

我想用这样的选项扩展我的 makefile.am:

这是来自 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 文件中,但我不知道如何。

【问题讨论】:

    标签: c++ makefile configure


    【解决方案1】:

    您应该在 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
     ])
    

    【讨论】:

    • ... 并使用 AM_CONDITIONAL 将条件传递给 Makefile.am。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-04
    • 2011-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多