mkhtml2: add handling for testobject on *mediaobjects
[gtk-doc.git] / configure.ac
bloba14f403b9eadcc7b5f3dd76cdcea88c7ce6da88d
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.63])
4 dnl We're using a two digit number for the releases and
5 dnl a three digit number for the development version
6 m4_define(gtk_doc_version, 1.28.1)
8 AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])
10 AC_CONFIG_MACRO_DIR([m4])
11 AC_CONFIG_SRCDIR([gtk-doc.pc.in])
12 AC_CONFIG_AUX_DIR([build-aux])
14 AM_INIT_AUTOMAKE([1.11 check-news std-options -Wno-portability tar-ustar no-dist-gzip dist-xz])
15 AM_MAINTAINER_MODE([enable])
17 # Support silent build rules, requires at least automake-1.11. Disable
18 # by either passing --disable-silent-rules to configure or passing V=1
19 # to make
20 AM_SILENT_RULES([yes])
22 # Check for programs
23 AC_PROG_CC
25 # Initialize libtool
26 LT_PREREQ([2.2])
27 LT_INIT
29 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
30 PKG_PROG_PKG_CONFIG([0.19])
32 dnl
33 dnl Check for Python.
34 dnl
35 AM_PATH_PYTHON([3.2])
37 dnl
38 dnl Check for xsltproc
39 dnl
40 AC_PATH_PROG([XSLTPROC], [xsltproc])
41 if test -z "$XSLTPROC"; then
42         AC_MSG_ERROR([xsltproc not found])
45 dnl
46 dnl Check for dblatex/fop (for pdf output)
47 dnl
48 AC_PATH_PROG([DBLATEX], [dblatex])
49 if test -z "$DBLATEX"; then
50         AC_PATH_PROG([FOP], [fop])
51         if test -z "$FOP"; then
52                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
53         fi
56 dnl check for DocBook DTD and stylesheets in the local catalog.
57 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
58 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
60 dnl
61 dnl Check for syntax highlighters
62 dnl
63 AC_ARG_WITH([highlight],
64         AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
65         , [with_highlight=auto])
67 case $with_highlight in
68         no|source-highlight|highlight|vim|auto) ;;
69         *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
70 esac
72 HIGHLIGHT_OPTIONS=""
73 if test "$with_highlight" = "auto"; then
74         AC_PATH_PROG([HIGHLIGHT], [source-highlight])
75         if test -n "$HIGHLIGHT"; then
76                 HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i"
77         else
78                 AC_PATH_PROG([HIGHLIGHT], [highlight])
79                 if test -n "$HIGHLIGHT"; then
80                         HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc "
81                 else
82                         AC_PATH_PROG([HIGHLIGHT], [vim])
83                         if test -n "$HIGHLIGHT"; then
84                                 dnl vim is useless if it does not support syntax highlighting
85                                 AC_MSG_CHECKING([whether vim has +syntax feature])
86                                 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
87                                         AC_MSG_RESULT([yes])
88                                 else
89                                         AC_MSG_RESULT([no])
90                                         HIGHLIGHT=
91                                 fi
92                         fi
93                 fi
94         fi
95 else
96         if test "$with_highlight" != "no"; then
97                 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
98         fi
100         case $with_highlight in
101                 source-highlight) HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i";;
102                 highlight) HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc ";;
103                 vim)
104                         AC_MSG_CHECKING([whether vim has +syntax feature])
105                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
106                                 AC_MSG_RESULT([yes])
107                         else
108                                 AC_MSG_RESULT([no])
109                                 HIGHLIGHT=no
110                         fi
111                 ;;
112         esac
114         if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
115                 AC_MSG_ERROR([Could not find requested syntax highlighter])
116         fi
118 AC_SUBST([HIGHLIGHT_OPTIONS])
121 dnl Set runtime package dirs so we can find the script containing common routines.
123 dnl From Autoconf Macro Archive:
124 m4_define([AC_DEFINE_DIR], [
125         prefix_NONE=
126         exec_prefix_NONE=
127         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
128         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
129         eval ac_define_dir="\"[$]$2\""
130         eval ac_define_dir="\"$ac_define_dir\""
131         AC_SUBST($1, "$ac_define_dir")
132         test "$prefix_NONE" && prefix=NONE
133         test "$exec_prefix_NONE" && exec_prefix=NONE
135 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
136 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
137 PYTHON_PACKAGE_DIR="${datadir}/${PACKAGE}/python"
138 AC_DEFINE_DIR([PYTHON_PACKAGE_DIR], [PYTHON_PACKAGE_DIR])
140 dnl Only use -Wall if we have gcc
141 if test "x$GCC" = "xyes"; then
142         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
143                 CFLAGS="$CFLAGS -Wall"
144         fi
147 dnl if glib is available we can enable the tests
148 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
149         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
150                 gtk_doc_use_libtool="yes"
151                 build_tests="yes"
152         ],
153         [       gtk_doc_use_libtool="no"
154                 build_tests="no"
155         ]
157 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
158 dnl this enables the rule in test/Makefile.am
159 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
160 AC_SUBST(glib_prefix)
162 dnl enable runtime debugging code
163 AC_MSG_CHECKING(whether to enable runtime debugging code)
164 AC_ARG_ENABLE([debug],
165         AS_HELP_STRING([--enable-debug],
166         [enable runtime debugging code (default=no)]),,
167         [enable_debug="no"])
168 AC_MSG_RESULT($enable_debug)
170 dnl check what date format we can use for the makefile tracing in tests
171 dnl this is mostly to detect the date command on macosx that is quite cripled
172 dnl  and broken too
173 AC_MSG_CHECKING(whether date can output nanoseconds)
174 date +%s.%N | grep -q 'N'
175 if test "$?" = "1"; then
176   TS_FMT="+%s.%N"
177   ELAPSED_FMT="+%H:%M:%S.%N"
178   AC_MSG_RESULT(yes)
179 else
180   TS_FMT="+%s.0"
181   ELAPSED_FMT="+%H:%M:%S"
182   AC_MSG_RESULT(no)
184 AC_SUBST(TS_FMT)
185 AC_SUBST(ELAPSED_FMT)
187 AC_MSG_CHECKING(whether date can format dates)
188 date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
189 if test "$?" = "0"; then
190   DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
191   AC_MSG_RESULT(yes)
192 else
193   DATE_FMT_CMD="echo "
194   AC_MSG_RESULT(no)
196 AC_SUBST(DATE_FMT_CMD)
199 dnl Documentation
201 AC_MSG_CHECKING([for yelp-tools])
202 have_yelp_tools=no
203 m4_ifdef([YELP_HELP_INIT],[
204 AC_MSG_RESULT([yes])
205 YELP_HELP_INIT
206 have_yelp_tools=yes
208 if test "x$have_yelp_tools" != "xyes"; then
209   AC_MSG_RESULT([no])
211 AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
213 # cmake/GtkDocConfig.cmake is handled in the Makefile, not here.
214 AC_CONFIG_FILES([Makefile
215 gtk-doc.pc
216 cmake/Makefile
217 cmake/GtkDocConfigVersion.cmake
218 gtkdoc/config.py
219 help/Makefile
220 help/manual/Makefile
221 tests/Makefile
222 tests/annotations/docs/Makefile
223 tests/bugs/docs/Makefile
224 tests/empty/docs/Makefile
225 tests/fail/docs/Makefile
226 tests/gobject/src/Makefile
227 tests/gobject/docs/Makefile
228 tests/program/docs/Makefile
229 tests/repro/docs/Makefile
232 dnl run chmod on these after parsing them.
233 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
234 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
235 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
236 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
237 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
238 AC_CONFIG_FILES([gtkdoc-mkhtml2],  [chmod +x gtkdoc-mkhtml2])
239 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
240 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
241 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
242 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
243 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
244 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
245 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
246 AC_OUTPUT
248 AC_MSG_NOTICE([
249 gtk-doc was configured with the following options:
250 ==================================================])
252 test -n "$DBLATEX$FOP" \
253     && AC_MSG_NOTICE([** PDF support enabled, using $DBLATEX$FOP]) \
254     || AC_MSG_NOTICE([   PDF support disabled, no dblatex or fop available])
255 test -n "$HIGHLIGHT" \
256     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
257     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
258 test "x$build_tests" != "xno" \
259     && AC_MSG_NOTICE([** Building regression tests]) \
260     || AC_MSG_NOTICE([   Skipping regression tests])
261 test "x$enable_debug" != "xno" \
262     && AC_MSG_NOTICE([** Debug tracing enabled]) \
263     || AC_MSG_NOTICE([   Debug tracing disabled])
264 test "x$have_yelp_tools" != "xno" \
265     && AC_MSG_NOTICE([** Documentation enabled]) \
266     || AC_MSG_NOTICE([   Documentation disabled])