Updated Spanish translation
[gtk-doc.git] / configure.ac
blob5217f74e5d0b19e94709400c5a2cb72e88baf681
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.63])
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.18.1)
10 AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_SRCDIR([gtkdoc-common.pl.in])
14 AC_CONFIG_AUX_DIR([build-aux])
16 AM_INIT_AUTOMAKE([1.11 check-news std-options -Wno-portability tar-ustar no-dist-gzip dist-xz])
17 AM_MAINTAINER_MODE([enable])
19 # Support silent build rules, requires at least automake-1.11. Disable
20 # by either passing --disable-silent-rules to configure or passing V=1
21 # to make
22 AM_SILENT_RULES([yes])
24 dnl Forcing a non-null ACTION-IF-NOT-FOUND disables scrollkeeper if
25 dnl gnome-doc-utils is not found but does not invalidate the build.
26 GNOME_DOC_INIT([],[],enable_scrollkeeper=no)
28 # Check for programs
29 AC_PROG_CC
31 # Initialize libtool
32 LT_PREREQ([2.2])
33 LT_INIT
35 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
36 PKG_PROG_PKG_CONFIG([0.19])
38 dnl
39 dnl Check for Perl.
40 dnl
41 AC_PATH_PROG([PERL], [perl])
42 if test -z "$PERL"; then
43         AC_MSG_ERROR([perl not found])
46 AC_MSG_CHECKING([if Perl version >= 5.6.0])
47 if "$PERL" -e "require v5.6.0"; then
48         AC_MSG_RESULT([yes])
49 else
50         AC_MSG_RESULT([no])
51         AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
54 dnl
55 dnl Check for Python.
56 dnl
57 AM_PATH_PYTHON([2.3],,[:])
58 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
60 dnl
61 dnl Check for jade or openjade.
62 dnl
63 dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
64 dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
65 dnl that, which is bad for accessibility.
66 dnl
67 SGML_FORMAT_TYPE=sgml-raw
68 AC_PATH_PROG([JADE], [openjade])
69 if test -z "$JADE"; then
70         SGML_FORMAT_TYPE=sgml
71         AC_PATH_PROG([JADE], [jade])
72         if test -z "$JADE"; then
73                 AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
74         fi
76 AC_SUBST([SGML_FORMAT_TYPE])
78 dnl
79 dnl Check for xsltproc
80 dnl
81 AC_PATH_PROG([XSLTPROC], [xsltproc])
82 if test -z "$XSLTPROC"; then
83         AC_MSG_ERROR([xsltproc not found])
86 dnl
87 dnl Check for dblatex/fop (for pdf output)
88 dnl
89 AC_PATH_PROG([DBLATEX], [dblatex])
90 if test -z "$DBLATEX"; then
91         AC_PATH_PROG([FOP], [fop])
92         if test -z "$FOP"; then
93                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
94         fi
97 dnl check for DocBook DTD and stylesheets in the local catalog.
98 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
99 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
102 dnl Check for syntax highlighters
104 AC_ARG_WITH([highlight],
105         AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
106         , [with_highlight=auto])
108 case $with_highlight in
109         no|source-highlight|highlight|vim|auto) ;;
110         *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
111 esac
113 HIGHLIGHT_OPTIONS=""
114 if test "$with_highlight" = "auto"; then
115         AC_PATH_PROG([HIGHLIGHT], [source-highlight])
116         if test -n "$HIGHLIGHT"; then
117                 HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
118         else
119                 AC_PATH_PROG([HIGHLIGHT], [highlight])
120                 if test -n "$HIGHLIGHT"; then
121                         HIGHLIGHT_OPTIONS="--out-format=xhtml -f --class-name=gtkdoc "
122                 else
123                         AC_PATH_PROG([HIGHLIGHT], [vim])
124                         if test -n "$HIGHLIGHT"; then
125                                 dnl vim is useless if it does not support syntax highlighting
126                                 AC_MSG_CHECKING([whether vim has +syntax feature])
127                                 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
128                                         AC_MSG_RESULT([yes])
129                                 else
130                                         AC_MSG_RESULT([no])
131                                         HIGHLIGHT=
132                                 fi
133                         fi
134                 fi
135         fi
136 else
137         if test "$with_highlight" != "no"; then
138                 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
139         fi
141         case $with_highlight in
142                 source-highlight) HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i";;
143                 highlight) HIGHLIGHT_OPTIONS="--out-format=xhtml -f --class-name=gtkdoc ";;
144                 vim)
145                         AC_MSG_CHECKING([whether vim has +syntax feature])
146                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
147                                 AC_MSG_RESULT([yes])
148                         else
149                                 AC_MSG_RESULT([no])
150                                 HIGHLIGHT=no
151                         fi
152                 ;;
153         esac
155         if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
156                 AC_MSG_ERROR([Could not find requested syntax highlighter])
157         fi
159 AC_SUBST([HIGHLIGHT_OPTIONS])
162 dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
164 dnl From Autoconf Macro Archive:
165 m4_define([AC_DEFINE_DIR], [
166         prefix_NONE=
167         exec_prefix_NONE=
168         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
169         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
170         eval ac_define_dir="\"[$]$2\""
171         eval ac_define_dir="\"$ac_define_dir\""
172         AC_SUBST($1, "$ac_define_dir")
173         test "$prefix_NONE" && prefix=NONE
174         test "$exec_prefix_NONE" && exec_prefix=NONE
176 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
177 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
179 dnl Only use -Wall if we have gcc
180 if test "x$GCC" = "xyes"; then
181         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
182                 CFLAGS="$CFLAGS -Wall"
183         fi
186 dnl if glib is available we can enable the tests
187 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
188         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
189                 gtk_doc_use_libtool="yes"
190                 build_tests="yes"
191         ],
192         [       gtk_doc_use_libtool="no"
193                 build_tests="no"
194         ]
196 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
197 dnl this enable the rule in test/Makefile.am
198 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
199 AC_SUBST(glib_prefix)
201 dnl enable runtime debugging code
202 AC_MSG_CHECKING(whether to enable runtime debugging code)
203 AC_ARG_ENABLE([debug],
204         AS_HELP_STRING([--enable-debug],
205         [enable runtime debugging code (default=no)]),,
206         [enable_debug="no"])
207 AC_MSG_RESULT($enable_debug)
209 if test "x$enable_debug" != "xno"; then
210         TRACE="LogTrace"
211 else
212         TRACE="#"
214 AC_SUBST(TRACE)
216 AC_CONFIG_FILES([Makefile
217 gtk-doc.pc
218 gtk-doc.dsl
219 gtk-doc.spec
220 gtk-doc.cat
221 gtkdoc-common.pl
222 help/Makefile
223 help/manual/Makefile
224 tests/Makefile
225 tests/gobject/Makefile
226 tests/gobject/src/Makefile
227 tests/gobject/docs/Makefile
228 tests/gobject/docs-tmpl/Makefile
229 tests/bugs/Makefile
230 tests/bugs/src/Makefile
231 tests/bugs/docs/Makefile
232 tests/annotations/Makefile
233 tests/annotations/src/Makefile
234 tests/annotations/docs/Makefile
235 tests/fail/Makefile
236 tests/fail/src/Makefile
237 tests/fail/docs/Makefile
238 tests/empty/Makefile
239 tests/empty/src/Makefile
240 tests/empty/docs/Makefile
243 dnl run chmod on these after parsing them.
244 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
245 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
246 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
247 dnl that would be nice, but would fail if perl is in a non-std path
248 dnl AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb && perl -cwT gtkdoc-mkdb])
249 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
250 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
251 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
252 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
253 AC_CONFIG_FILES([gtkdoc-mktmpl],   [chmod +x gtkdoc-mktmpl])
254 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
255 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
256 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
257 AC_CONFIG_FILES([gtkdoc-scanobj],  [chmod +x gtkdoc-scanobj])
258 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
259 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
260 AC_OUTPUT
262 AC_MSG_NOTICE([
263 gtk-doc was configured with the following options:
264 ==================================================])
266 test "$PYTHON" != : \
267     && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
268     || AC_MSG_NOTICE([   Python based tools disabled])
269 test -n "$JADE" \
270     && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
271     || AC_MSG_NOTICE([   SGML support disabled, no jade processor available])
272 test -n "$DBLATEX$FOP" \
273     && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
274     || AC_MSG_NOTICE([   XML PDF support disabled, no fop available])
275 test "x$gdu_cv_have_gdu" = "xyes" \
276     && AC_MSG_NOTICE([** Gnome-doc-utils support enabled]) \
277     || AC_MSG_NOTICE([   Gnome-doc-utils support disabled])
278 test "x$enable_scrollkeeper" = "xyes" \
279     && AC_MSG_NOTICE([** Scrollkeeper support enabled]) \
280     || AC_MSG_NOTICE([   Scrollkeeper support disabled])
281 test -n "$HIGHLIGHT" \
282     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
283     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
284 test "x$build_tests" != "xno" \
285     && AC_MSG_NOTICE([** Building regression tests]) \
286     || AC_MSG_NOTICE([   Skipping regression tests])
287 test "x$enable_debug" != "xno" \
288     && AC_MSG_NOTICE([** Debug tracing enabled]) \
289     || AC_MSG_NOTICE([   Debug tracing disabled])