将 autoconf 配置为具有 --with 选项以自定义构建 [英] configuring autoconf to have --with options to customise build

查看:32
本文介绍了将 autoconf 配置为具有 --with 选项以自定义构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 autoconf 和 automake 的工作原理有非常基本的了解,这些了解是从各种教程中收集的.但是,由于我希望我的库在构建过程中具有灵活性,因此它们需要具有其他常见的 --with-FEATURE--without-FEATURE 功能程式.我该如何实施?

I have a very basic understanding of how autoconf and automake work, gathered from various tutorials. However, as I would like my libraries to be flexible during their builds, they need to have the --with-FEATURE and --without-FEATURE functionality commonly found in other programs. How do I implement this?

推荐答案

您需要使用 AC_ARG_WITH,例如:

You'll want to use AC_ARG_WITH, for example:

AC_ARG_WITH(editres,
[  --without-editres                do not use editres])
if test "x${with_editres}" != "xno"; then
    AC_CHECK_LIB(Xmu, _XEditResCheckMessages,
        EDITRES_LIBS="-lXmu"
        AC_DEFINE(HAVE_EDITRES, 1), AC_DEFINE(HAVE_EDITRES, 0),
        ${X_PRE_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS})
else
    AC_DEFINE(HAVE_EDITRES, 0)
fi

这篇关于将 autoconf 配置为具有 --with 选项以自定义构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆