1 dnl Process this file with autoconf to produce a configure script.
4 dnl Use a simple 2-digit version number for a while, since our old example
5 dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9.
6 dnl FIXME: I can't see anything failing (1.14.1), lets try to use a three digit
7 dnl number for the development version
8 m4_define(gtk_doc_version, 1.15.1)
10 AC_INIT([gtk-doc], [gtk_doc_version], [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc])
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_SRCDIR([gtkdoc-common.pl.in])
15 AM_INIT_AUTOMAKE([check-news std-options])
18 # Support silent build rules, requires at least automake-1.11. Disable
19 # by either passing --disable-silent-rules to configure or passing V=1
21 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23 dnl Forcing a non-null ACTION-IF-NOT-FOUND disables scrollkeeper if
24 dnl gnome-doc-utils is not found but does not invalidate the build.
25 GNOME_DOC_INIT([],[],enable_scrollkeeper=no)
27 dnl make sure $ACLOCAL_FLAGS are used during a rebuild.
28 AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
34 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
35 PKG_PROG_PKG_CONFIG([0.19])
40 AC_PATH_PROG([PERL], [perl])
41 if test -z "$PERL"; then
42 AC_MSG_ERROR([perl not found])
45 AC_MSG_CHECKING([if Perl version >= 5.6.0])
46 if "$PERL" -e "require v5.6.0"; then
50 AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
56 AM_PATH_PYTHON([2.3],,[:])
57 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
60 dnl Check for jade or openjade.
62 dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
63 dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
64 dnl that, which is bad for accessibility.
66 SGML_FORMAT_TYPE=sgml-raw
67 AC_PATH_PROG([JADE], [openjade])
68 if test -z "$JADE"; then
70 AC_PATH_PROG([JADE], [jade])
71 if test -z "$JADE"; then
72 AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
75 AC_SUBST([SGML_FORMAT_TYPE])
78 dnl Check for xsltproc
80 AC_PATH_PROG([XSLTPROC], [xsltproc])
81 if test -z "$XSLTPROC"; then
82 AC_MSG_ERROR([xsltproc not found])
86 dnl Check for dblatex/fop (for pdf output)
88 AC_PATH_PROG([DBLATEX], [dblatex])
89 if test -z "$DBLATEX"; then
90 AC_PATH_PROG([FOP], [fop])
91 if test -z "$FOP"; then
92 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
96 dnl check for DocBook DTD and stylesheets in the local catalog.
97 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
98 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
101 dnl Check for syntax highlighters
103 AC_ARG_WITH([highlight],
104 AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
105 , [with_highlight=auto])
107 case $with_highlight in
108 no|source-highlight|highlight|vim|auto) ;;
109 *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
113 if test "$with_highlight" = "auto"; then
114 AC_PATH_PROG([HIGHLIGHT], [source-highlight])
115 if test -n "$HIGHLIGHT"; then
116 HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
118 AC_PATH_PROG([HIGHLIGHT], [highlight])
119 if test -n "$HIGHLIGHT"; then
120 HIGHLIGHT_OPTIONS="-X -f --class-name=gtkdoc "
122 AC_PATH_PROG([HIGHLIGHT], [vim])
123 if test -n "$HIGHLIGHT"; then
124 dnl vim is useless if it does not support syntax highlighting
125 AC_MSG_CHECKING([whether vim has +syntax feature])
126 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
136 if test "$with_highlight" != "no"; then
137 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
140 case $with_highlight in
141 source-highlight) HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i";;
142 highlight) HIGHLIGHT_OPTIONS="-X -f --class-name=gtkdoc ";;
144 AC_MSG_CHECKING([whether vim has +syntax feature])
145 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
154 if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
155 AC_MSG_ERROR([Could not find requested syntax highlighter])
158 AC_SUBST([HIGHLIGHT_OPTIONS])
161 dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
163 dnl From Autoconf Macro Archive:
164 m4_define([AC_DEFINE_DIR], [
167 test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
168 test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
169 eval ac_define_dir="\"[$]$2\""
170 eval ac_define_dir="\"$ac_define_dir\""
171 AC_SUBST($1, "$ac_define_dir")
172 test "$prefix_NONE" && prefix=NONE
173 test "$exec_prefix_NONE" && exec_prefix=NONE
175 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
176 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
178 dnl Only use -Wall if we have gcc
179 if test "x$GCC" = "xyes"; then
180 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
181 CFLAGS="$CFLAGS -Wall"
185 dnl if glib is available we can enable the tests
186 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
187 [ glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
188 gtk_doc_use_libtool="yes"
191 [ gtk_doc_use_libtool="no"
195 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
196 dnl this enable the rule in test/Makefile.am
197 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
198 AC_SUBST(glib_prefix)
200 dnl enable runtime debugging code
201 AC_MSG_CHECKING(whether to enable runtime debugging code)
202 AC_ARG_ENABLE([debug],
203 AS_HELP_STRING([--enable-debug],
204 [enable runtime debugging code (default=no)]),,
206 AC_MSG_RESULT($enable_debug)
208 if test "$enable_debug" = "yes"; then
209 TRACE="print __FILE__ . \":\" . __LINE__ . \":\" ."
215 AC_CONFIG_FILES([Makefile
224 tests/gobject/Makefile
225 tests/gobject/src/Makefile
226 tests/gobject/docs/Makefile
227 tests/gobject/docs-tmpl/Makefile
229 tests/bugs/src/Makefile
230 tests/bugs/docs/Makefile
231 tests/annotations/Makefile
232 tests/annotations/src/Makefile
233 tests/annotations/docs/Makefile
235 tests/fail/src/Makefile
236 tests/fail/docs/Makefile
238 tests/empty/src/Makefile
239 tests/empty/docs/Makefile
242 dnl run chmod on these after parsing them.
243 AC_CONFIG_FILES([gtkdoc-check], [chmod +x gtkdoc-check])
244 AC_CONFIG_FILES([gtkdoc-depscan], [chmod +x gtkdoc-depscan])
245 AC_CONFIG_FILES([gtkdoc-fixxref], [chmod +x gtkdoc-fixxref])
246 dnl that would be nice, but would fail if perl is in a non-std path
247 dnl AC_CONFIG_FILES([gtkdoc-mkdb], [chmod +x gtkdoc-mkdb && perl -cwT gtkdoc-mkdb])
248 AC_CONFIG_FILES([gtkdoc-mkdb], [chmod +x gtkdoc-mkdb])
249 AC_CONFIG_FILES([gtkdoc-mkhtml], [chmod +x gtkdoc-mkhtml])
250 AC_CONFIG_FILES([gtkdoc-mkman], [chmod +x gtkdoc-mkman])
251 AC_CONFIG_FILES([gtkdoc-mkpdf], [chmod +x gtkdoc-mkpdf])
252 AC_CONFIG_FILES([gtkdoc-mktmpl], [chmod +x gtkdoc-mktmpl])
253 AC_CONFIG_FILES([gtkdoc-rebase], [chmod +x gtkdoc-rebase])
254 AC_CONFIG_FILES([gtkdoc-scan], [chmod +x gtkdoc-scan])
255 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
256 AC_CONFIG_FILES([gtkdoc-scanobj], [chmod +x gtkdoc-scanobj])
257 AC_CONFIG_FILES([gtkdocize], [chmod +x gtkdocize])
258 AC_CONFIG_FILES([tests/tools.sh], [chmod +x tests/tools.sh])
262 gtk-doc was configured with the following options:
263 ==================================================])
265 test "$PYTHON" != : \
266 && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
267 || AC_MSG_NOTICE([ Python based tools disabled])
269 && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
270 || AC_MSG_NOTICE([ SGML support disabled, no jade processor available])
271 test -n "$DBLATEX$FOP" \
272 && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
273 || AC_MSG_NOTICE([ XML PDF support disabled, no fop available])
274 test "x$gdu_cv_have_gdu" = "xyes" \
275 && AC_MSG_NOTICE([** Gnome-doc-utils support enabled]) \
276 || AC_MSG_NOTICE([ Gnome-doc-utils support disabled])
277 test "x$enable_scrollkeeper" = "xyes" \
278 && AC_MSG_NOTICE([** Scrollkeeper support enabled]) \
279 || AC_MSG_NOTICE([ Scrollkeeper support disabled])
280 test -n "$HIGHLIGHT" \
281 && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
282 || AC_MSG_NOTICE([ Syntax highlighting of examples disabled])
283 test "x$build_tests" != "xno" \
284 && AC_MSG_NOTICE([** Building regression tests]) \
285 || AC_MSG_NOTICE([ Skipping regression tests])