style.css: fix footnote placement
[gtk-doc.git] / configure.ac
blobdab392f6936092d29bc1a000486472544e3c2800
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.21.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 # Check for programs
25 AC_PROG_CC
27 # Initialize libtool
28 LT_PREREQ([2.2])
29 LT_INIT
31 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
32 PKG_PROG_PKG_CONFIG([0.19])
34 dnl
35 dnl Check for Perl.
36 dnl
37 AC_PATH_PROG([PERL], [perl])
38 if test -z "$PERL"; then
39         AC_MSG_ERROR([perl not found])
42 AC_MSG_CHECKING([if Perl version >= 5.6.0])
43 if "$PERL" -e "require v5.6.0"; then
44         AC_MSG_RESULT([yes])
45 else
46         AC_MSG_RESULT([no])
47         AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
50 dnl
51 dnl Check for Python.
52 dnl
53 AM_PATH_PYTHON([2.3],,[:])
54 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
56 dnl
57 dnl Check for jade or openjade.
58 dnl
59 dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
60 dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
61 dnl that, which is bad for accessibility.
62 dnl
63 SGML_FORMAT_TYPE=sgml-raw
64 AC_PATH_PROG([JADE], [openjade])
65 if test -z "$JADE"; then
66         SGML_FORMAT_TYPE=sgml
67         AC_PATH_PROG([JADE], [jade])
68         if test -z "$JADE"; then
69                 AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
70         fi
72 AC_SUBST([SGML_FORMAT_TYPE])
74 dnl
75 dnl Check for xsltproc
76 dnl
77 AC_PATH_PROG([XSLTPROC], [xsltproc])
78 if test -z "$XSLTPROC"; then
79         AC_MSG_ERROR([xsltproc not found])
82 dnl
83 dnl Check for dblatex/fop (for pdf output)
84 dnl
85 AC_PATH_PROG([DBLATEX], [dblatex])
86 if test -z "$DBLATEX"; then
87         AC_PATH_PROG([FOP], [fop])
88         if test -z "$FOP"; then
89                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
90         fi
93 dnl check for DocBook DTD and stylesheets in the local catalog.
94 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
95 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
97 dnl
98 dnl Check for syntax highlighters
99 dnl
100 AC_ARG_WITH([highlight],
101         AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
102         , [with_highlight=auto])
104 case $with_highlight in
105         no|source-highlight|highlight|vim|auto) ;;
106         *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
107 esac
109 HIGHLIGHT_OPTIONS=""
110 if test "$with_highlight" = "auto"; then
111         AC_PATH_PROG([HIGHLIGHT], [source-highlight])
112         if test -n "$HIGHLIGHT"; then
113                 HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
114         else
115                 AC_PATH_PROG([HIGHLIGHT], [highlight])
116                 if test -n "$HIGHLIGHT"; then
117                         HIGHLIGHT_OPTIONS="--out-format=xhtml -f --class-name=gtkdoc "
118                 else
119                         AC_PATH_PROG([HIGHLIGHT], [vim])
120                         if test -n "$HIGHLIGHT"; then
121                                 dnl vim is useless if it does not support syntax highlighting
122                                 AC_MSG_CHECKING([whether vim has +syntax feature])
123                                 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
124                                         AC_MSG_RESULT([yes])
125                                 else
126                                         AC_MSG_RESULT([no])
127                                         HIGHLIGHT=
128                                 fi
129                         fi
130                 fi
131         fi
132 else
133         if test "$with_highlight" != "no"; then
134                 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
135         fi
137         case $with_highlight in
138                 source-highlight) HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i";;
139                 highlight) HIGHLIGHT_OPTIONS="--out-format=xhtml -f --class-name=gtkdoc ";;
140                 vim)
141                         AC_MSG_CHECKING([whether vim has +syntax feature])
142                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
143                                 AC_MSG_RESULT([yes])
144                         else
145                                 AC_MSG_RESULT([no])
146                                 HIGHLIGHT=no
147                         fi
148                 ;;
149         esac
151         if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
152                 AC_MSG_ERROR([Could not find requested syntax highlighter])
153         fi
155 AC_SUBST([HIGHLIGHT_OPTIONS])
158 dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
160 dnl From Autoconf Macro Archive:
161 m4_define([AC_DEFINE_DIR], [
162         prefix_NONE=
163         exec_prefix_NONE=
164         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
165         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
166         eval ac_define_dir="\"[$]$2\""
167         eval ac_define_dir="\"$ac_define_dir\""
168         AC_SUBST($1, "$ac_define_dir")
169         test "$prefix_NONE" && prefix=NONE
170         test "$exec_prefix_NONE" && exec_prefix=NONE
172 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
173 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
175 dnl Only use -Wall if we have gcc
176 if test "x$GCC" = "xyes"; then
177         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
178                 CFLAGS="$CFLAGS -Wall"
179         fi
182 dnl if glib is available we can enable the tests
183 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
184         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
185                 gtk_doc_use_libtool="yes"
186                 build_tests="yes"
187         ],
188         [       gtk_doc_use_libtool="no"
189                 build_tests="no"
190         ]
192 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
193 dnl this enable the rule in test/Makefile.am
194 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
195 AC_SUBST(glib_prefix)
197 dnl enable runtime debugging code
198 AC_MSG_CHECKING(whether to enable runtime debugging code)
199 AC_ARG_ENABLE([debug],
200         AS_HELP_STRING([--enable-debug],
201         [enable runtime debugging code (default=no)]),,
202         [enable_debug="no"])
203 AC_MSG_RESULT($enable_debug)
205 if test "x$enable_debug" != "xno"; then
206         TRACE="LogTrace"
207 else
208         TRACE="#"
210 AC_SUBST(TRACE)
212 dnl check what date format we can use for the makefile tracing in tests
213 dnl this is mostly to detect the date command on macosx that is quite cripled
214 dnl  and broken too
215 AC_MSG_CHECKING(whether date can output nanoseconds)
216 date +%s.%N | grep -q 'N'
217 if test "$?" = "1"; then
218   TS_FMT="+%s.%N"
219   ELAPSED_FMT="+%H:%M:%S.%N"
220   AC_MSG_RESULT(yes)
221 else
222   TS_FMT="+%s.0"
223   ELAPSED_FMT="+%H:%M:%S"
224   AC_MSG_RESULT(no)
226 AC_SUBST(TS_FMT)
227 AC_SUBST(ELAPSED_FMT)
229 AC_MSG_CHECKING(whether date can format dates)
230 date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
231 if test "$?" = "0"; then
232   DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
233   AC_MSG_RESULT(yes)
234 else
235   DATE_FMT_CMD="echo "
236   AC_MSG_RESULT(no)
238 AC_SUBST(DATE_FMT_CMD)
241 dnl Documentation
243 AC_MSG_CHECKING([for yelp-tools])
244 have_yelp_tools=no
245 m4_ifdef([YELP_HELP_INIT],[
246 AC_MSG_RESULT([yes])
247 YELP_HELP_INIT
248 have_yelp_tools=yes
250 if test "x$have_yelp_tools" != "xyes"; then
251   AC_MSG_RESULT([no])
253 AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
255 AC_CONFIG_FILES([Makefile
256 gtk-doc.pc
257 gtk-doc.dsl
258 gtk-doc.spec
259 gtk-doc.cat
260 gtkdoc-common.pl
261 help/Makefile
262 help/manual/Makefile
263 tests/Makefile
264 tests/gobject/Makefile
265 tests/gobject/src/Makefile
266 tests/gobject/docs/Makefile
267 tests/bugs/Makefile
268 tests/bugs/src/Makefile
269 tests/bugs/docs/Makefile
270 tests/annotations/Makefile
271 tests/annotations/src/Makefile
272 tests/annotations/docs/Makefile
273 tests/fail/Makefile
274 tests/fail/src/Makefile
275 tests/fail/docs/Makefile
276 tests/empty/Makefile
277 tests/empty/src/Makefile
278 tests/empty/docs/Makefile
281 dnl run chmod on these after parsing them.
282 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
283 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
284 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
285 dnl that would be nice, but would fail if perl is in a non-std path
286 dnl AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb && perl -cwT gtkdoc-mkdb])
287 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
288 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
289 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
290 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
291 AC_CONFIG_FILES([gtkdoc-mktmpl],   [chmod +x gtkdoc-mktmpl])
292 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
293 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
294 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
295 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
296 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
297 AC_OUTPUT
299 AC_MSG_NOTICE([
300 gtk-doc was configured with the following options:
301 ==================================================])
303 test "$PYTHON" != : \
304     && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
305     || AC_MSG_NOTICE([   Python based tools disabled])
306 test -n "$JADE" \
307     && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
308     || AC_MSG_NOTICE([   SGML support disabled, no jade processor available])
309 test -n "$DBLATEX$FOP" \
310     && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
311     || AC_MSG_NOTICE([   XML PDF support disabled, no dblatex or fop available])
312 test -n "$HIGHLIGHT" \
313     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
314     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
315 test "x$build_tests" != "xno" \
316     && AC_MSG_NOTICE([** Building regression tests]) \
317     || AC_MSG_NOTICE([   Skipping regression tests])
318 test "x$enable_debug" != "xno" \
319     && AC_MSG_NOTICE([** Debug tracing enabled]) \
320     || AC_MSG_NOTICE([   Debug tracing disabled])
321 test "x$have_yelp_tools" != "xno" \
322     && AC_MSG_NOTICE([** Documentation enabled]) \
323     || AC_MSG_NOTICE([   Documentation disabled])