1 dnl Process this file with autoconf to produce a configure script.
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.27.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
20 AM_SILENT_RULES([yes])
29 dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
30 PKG_PROG_PKG_CONFIG([0.19])
38 dnl Check for xsltproc
40 AC_PATH_PROG([XSLTPROC], [xsltproc])
41 if test -z "$XSLTPROC"; then
42 AC_MSG_ERROR([xsltproc not found])
46 dnl Check for dblatex/fop (for pdf output)
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])
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])
61 dnl Check for syntax highlighters
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.]) ;;
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"
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 "
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
96 if test "$with_highlight" != "no"; then
97 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
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 ";;
104 AC_MSG_CHECKING([whether vim has +syntax feature])
105 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
114 if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
115 AC_MSG_ERROR([Could not find requested syntax highlighter])
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], [
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"
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"
153 [ gtk_doc_use_libtool="no"
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)]),,
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
173 AC_MSG_CHECKING(whether date can output nanoseconds)
174 date +%s.%N | grep -q 'N'
175 if test "$?" = "1"; then
177 ELAPSED_FMT="+%H:%M:%S.%N"
181 ELAPSED_FMT="+%H:%M:%S"
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"
196 AC_SUBST(DATE_FMT_CMD)
201 AC_MSG_CHECKING([for yelp-tools])
203 m4_ifdef([YELP_HELP_INIT],[
208 if test "x$have_yelp_tools" != "xyes"; then
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
217 cmake/GtkDocConfigVersion.cmake
222 tests/annotations/Makefile
223 tests/annotations/src/Makefile
224 tests/annotations/docs/Makefile
226 tests/bugs/src/Makefile
227 tests/bugs/docs/Makefile
229 tests/empty/src/Makefile
230 tests/empty/docs/Makefile
232 tests/fail/src/Makefile
233 tests/fail/docs/Makefile
234 tests/gobject/Makefile
235 tests/gobject/src/Makefile
236 tests/gobject/docs/Makefile
237 tests/program/Makefile
238 tests/program/src/Makefile
239 tests/program/docs/Makefile
241 tests/repro/src/Makefile
242 tests/repro/docs/Makefile
245 dnl run chmod on these after parsing them.
246 AC_CONFIG_FILES([gtkdoc-check], [chmod +x gtkdoc-check])
247 AC_CONFIG_FILES([gtkdoc-depscan], [chmod +x gtkdoc-depscan])
248 AC_CONFIG_FILES([gtkdoc-fixxref], [chmod +x gtkdoc-fixxref])
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-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([gtkdocize], [chmod +x gtkdocize])
257 AC_CONFIG_FILES([tests/tools.sh], [chmod +x tests/tools.sh])
261 gtk-doc was configured with the following options:
262 ==================================================])
264 test -n "$DBLATEX$FOP" \
265 && AC_MSG_NOTICE([** PDF support enabled, using $DBLATEX$FOP]) \
266 || AC_MSG_NOTICE([ PDF support disabled, no dblatex or fop available])
267 test -n "$HIGHLIGHT" \
268 && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
269 || AC_MSG_NOTICE([ Syntax highlighting of examples disabled])
270 test "x$build_tests" != "xno" \
271 && AC_MSG_NOTICE([** Building regression tests]) \
272 || AC_MSG_NOTICE([ Skipping regression tests])
273 test "x$enable_debug" != "xno" \
274 && AC_MSG_NOTICE([** Debug tracing enabled]) \
275 || AC_MSG_NOTICE([ Debug tracing disabled])
276 test "x$have_yelp_tools" != "xno" \
277 && AC_MSG_NOTICE([** Documentation enabled]) \
278 || AC_MSG_NOTICE([ Documentation disabled])