Added more info to "Documenting symbols" section
[gtk-doc.git] / configure.ac
blobc2a90e3cc9abe7406365999acc574bff912a7041
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.58)
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 m4_define(gtk_doc_version, 1.14)
8 AC_INIT([gtk-doc], [gtk_doc_version], [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc])
10 AC_CONFIG_MACRO_DIR([m4])
11 AC_CONFIG_SRCDIR([gtkdoc-common.pl.in])
13 AM_INIT_AUTOMAKE([check-news std-options])
14 AM_MAINTAINER_MODE
16 # Support silent build rules, requires at least automake-1.11. Disable
17 # by either passing --disable-silent-rules to configure or passing V=1
18 # to make
19 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
21 dnl Forcing a non-null ACTION-IF-NOT-FOUND disables scrollkeeper if
22 dnl gnome-doc-utils is not found but does not invalidate the build.
23 GNOME_DOC_INIT([],[],enable_scrollkeeper=no)
25 dnl make sure $ACLOCAL_FLAGS are used during a rebuild.
26 AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
28 AC_ISC_POSIX
29 AC_PROG_CC
30 AC_PROG_LIBTOOL
32 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
33 PKG_PROG_PKG_CONFIG([0.19])
35 dnl
36 dnl Check for Perl.
37 dnl
38 AC_PATH_PROG([PERL], [perl])
39 if test -z "$PERL"; then
40         AC_MSG_ERROR([perl not found])
43 AC_MSG_CHECKING([if Perl version >= 5.6.0])
44 if "$PERL" -e "require v5.6.0"; then
45         AC_MSG_RESULT([yes])
46 else
47         AC_MSG_RESULT([no])
48         AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
51 dnl
52 dnl Check for Python.
53 dnl
54 AM_PATH_PYTHON([2.3],,[:])
55 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
57 dnl
58 dnl Check for jade or openjade.
59 dnl
60 dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
61 dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
62 dnl that, which is bad for accessibility.
63 dnl
64 SGML_FORMAT_TYPE=sgml-raw
65 AC_PATH_PROG([JADE], [openjade])
66 if test -z "$JADE"; then
67         SGML_FORMAT_TYPE=sgml
68         AC_PATH_PROG([JADE], [jade])
69         if test -z "$JADE"; then
70                 AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
71         fi
73 AC_SUBST([SGML_FORMAT_TYPE])
75 dnl
76 dnl Check for xsltproc
77 dnl
78 AC_PATH_PROG([XSLTPROC], [xsltproc])
79 if test -z "$XSLTPROC"; then
80         AC_MSG_ERROR([xsltproc not found])
83 dnl
84 dnl Check for dblatex/fop (for pdf output)
85 dnl
86 AC_PATH_PROG([DBLATEX], [dblatex])
87 if test -z "$DBLATEX"; then
88         AC_PATH_PROG([FOP], [fop])
89         if test -z "$FOP"; then
90                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
91         fi
94 dnl check for DocBook DTD and stylesheets in the local catalog.
95 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
96 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
98 dnl
99 dnl Check for syntax highlighters
101 HIGHLIGHT_OPTIONS=""
102 AC_PATH_PROG([HIGHLIGHT], [source-highlight])
103 if test -n "$HIGHLIGHT"; then
104         HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
105 else
106         AC_PATH_PROG([HIGHLIGHT], [highlight])
107         if test -n "$HIGHLIGHT"; then
108                 HIGHLIGHT_OPTIONS="-X -f --class-name=gtkdoc "
109         else
110                 AC_PATH_PROG([HIGHLIGHT], [vim])
111                 if test -n "$HIGHLIGHT"; then
112                         dnl vim is useless if it does not support syntax highlighting
113                         AC_MSG_CHECKING([whether vim has +syntax feature])
114                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
115                                 AC_MSG_RESULT([yes])
116                         else
117                                 AC_MSG_RESULT([no])
118                                 HIGHLIGHT=
119                         fi
120                 fi
121         fi
123 AC_SUBST([HIGHLIGHT_OPTIONS])
126 dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
128 dnl From Autoconf Macro Archive:
129 m4_define([AC_DEFINE_DIR], [
130         prefix_NONE=
131         exec_prefix_NONE=
132         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
133         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
134         eval ac_define_dir="\"[$]$2\""
135         eval ac_define_dir="\"$ac_define_dir\""
136         AC_SUBST($1, "$ac_define_dir")
137         test "$prefix_NONE" && prefix=NONE
138         test "$exec_prefix_NONE" && exec_prefix=NONE
140 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
141 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
143 dnl Only use -Wall if we have gcc
144 if test "x$GCC" = "xyes"; then
145         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
146                 CFLAGS="$CFLAGS -Wall"
147         fi
150 dnl if glib is available we can enable the tests
151 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
152         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
153                 gtk_doc_use_libtool="yes"
154                 build_tests="yes"
155         ],
156         [       gtk_doc_use_libtool="no"
157                 build_tests="no"
158         ]
160 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
161 dnl this enable the rule in test/Makefile.am
162 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
163 AC_SUBST(glib_prefix)
165 dnl enable runtime debugging code
166 AC_MSG_CHECKING(whether to enable runtime debugging code)
167 AC_ARG_ENABLE([debug],
168         AS_HELP_STRING([--enable-debug],
169         [enable runtime debugging code (default=no)]),,
170         [enable_debug="no"])
171 AC_MSG_RESULT($enable_debug)
173 if test "$enable_debug" = "yes"; then
174         TRACE="print __FILE__ . \":\" . __LINE__ . \":\" ."
175 else
176         TRACE="#"
178 AC_SUBST(TRACE)
180 AC_CONFIG_FILES([Makefile
181 gtk-doc.pc
182 gtk-doc.dsl
183 gtk-doc.spec
184 gtk-doc.cat
185 gtkdoc-common.pl
186 help/Makefile
187 help/manual/Makefile
188 tests/Makefile
189 tests/gobject/Makefile
190 tests/gobject/src/Makefile
191 tests/gobject/docs/Makefile
192 tests/gobject/docs-tmpl/Makefile
193 tests/bugs/Makefile
194 tests/bugs/src/Makefile
195 tests/bugs/docs/Makefile
196 tests/annotations/Makefile
197 tests/annotations/src/Makefile
198 tests/annotations/docs/Makefile
199 tests/fail/Makefile
200 tests/fail/src/Makefile
201 tests/fail/docs/Makefile
202 tests/empty/Makefile
203 tests/empty/src/Makefile
204 tests/empty/docs/Makefile
207 dnl run chmod on these after parsing them.
208 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
209 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
210 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
211 dnl that would be nice, but would fail if perl is in a non-std path
212 dnl AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb && perl -cwT gtkdoc-mkdb])
213 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
214 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
215 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
216 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
217 AC_CONFIG_FILES([gtkdoc-mktmpl],   [chmod +x gtkdoc-mktmpl])
218 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
219 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
220 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
221 AC_CONFIG_FILES([gtkdoc-scanobj],  [chmod +x gtkdoc-scanobj])
222 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
223 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
224 AC_OUTPUT
226 AC_MSG_NOTICE([
227 gtk-doc was configured with the following options:
228 ==================================================])
230 test "$PYTHON" != : \
231     && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
232     || AC_MSG_NOTICE([   Python based tools disabled])
233 test -n "$JADE" \
234     && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
235     || AC_MSG_NOTICE([   SGML support disabled, no jade processor available])
236 test -n "$DBLATEX$FOP" \
237     && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
238     || AC_MSG_NOTICE([   XML PDF support disabled, no fop available])
239 test "x$gdu_cv_have_gdu" = "xyes" \
240     && AC_MSG_NOTICE([** Gnome-doc-utils support enabled]) \
241     || AC_MSG_NOTICE([   Gnome-doc-utils support disabled])
242 test "x$enable_scrollkeeper" = "xyes" \
243     && AC_MSG_NOTICE([** Scrollkeeper support enabled]) \
244     || AC_MSG_NOTICE([   Scrollkeeper support disabled])
245 test -n "$HIGHLIGHT" \
246     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
247     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
248 test "x$build_tests" != "xno" \
249     && AC_MSG_NOTICE([** Building regression tests]) \
250     || AC_MSG_NOTICE([   Skipping regression tests])