与autoconf集成
非常容易!只需在您的 configure.ac 脚本中添加一行。
# check for gtk-doc GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
This will require all developers to have gtk-doc installed. If it is okay for your project to have optional api-doc build setup, you can solve this as below. Keep it as is, as gtkdocize is looking for GTK_DOC_CHECK at the start of a line.
# check for gtk-doc m4_ifdef([GTK_DOC_CHECK], [ GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) ],[ AM_CONDITIONAL([ENABLE_GTK_DOC], false) ])
The first argument is used to check for the gtkdocversion at configure time. The 2nd, optional argument is used by gtkdocize. The GTK_DOC_CHECK macro also adds several configure switches:
- --with-html-dir=PATH : 安装文档的路径
- --enable-gtk-doc : 用gtk-doc构建文档[默认值:no]
- --enable-gtk-doc-html :用html格式构建文档[默认值:yes]
- --enable-gtk-doc-pdf : 以PDF格式构建文档[默认值:no]
GTK-Doc在默认情况下是关闭的!请记得给文本configure运作时传递'--enable-gtk-doc'选项。否则,将会安装预先生成的文档(对用户有意义但对开发人员没用处)。
Furthermore it is recommended that you have the following line inside your configure.ac script. This allows gtkdocize to automatically copy the macro definition for GTK_DOC_CHECK to your project.
AC_CONFIG_MACRO_DIR(m4)
After all changes to configure.ac are made, update the configure file. This can be done by re-running autoreconf -i or autogen.sh.