本文介绍了将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选项以自定义构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!