fixxref: remove leftover comment
[gtk-doc.git] / configure.ac
blob698063b7d59107de2f9547d26e46884674dbbbbb
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.26.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([gtk-doc.pc.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 Python.
36 dnl
37 AM_PATH_PYTHON([2.7])
39 dnl
40 dnl Check for xsltproc
41 dnl
42 AC_PATH_PROG([XSLTPROC], [xsltproc])
43 if test -z "$XSLTPROC"; then
44         AC_MSG_ERROR([xsltproc not found])
47 dnl
48 dnl Check for dblatex/fop (for pdf output)
49 dnl
50 AC_PATH_PROG([DBLATEX], [dblatex])
51 if test -z "$DBLATEX"; then
52         AC_PATH_PROG([FOP], [fop])
53         if test -z "$FOP"; then
54                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
55         fi
58 dnl check for DocBook DTD and stylesheets in the local catalog.
59 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
60 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
62 dnl
63 dnl Check for syntax highlighters
64 dnl
65 AC_ARG_WITH([highlight],
66         AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
67         , [with_highlight=auto])
69 case $with_highlight in
70         no|source-highlight|highlight|vim|auto) ;;
71         *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
72 esac
74 HIGHLIGHT_OPTIONS=""
75 if test "$with_highlight" = "auto"; then
76         AC_PATH_PROG([HIGHLIGHT], [source-highlight])
77         if test -n "$HIGHLIGHT"; then
78                 HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i"
79         else
80                 AC_PATH_PROG([HIGHLIGHT], [highlight])
81                 if test -n "$HIGHLIGHT"; then
82                         HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc "
83                 else
84                         AC_PATH_PROG([HIGHLIGHT], [vim])
85                         if test -n "$HIGHLIGHT"; then
86                                 dnl vim is useless if it does not support syntax highlighting
87                                 AC_MSG_CHECKING([whether vim has +syntax feature])
88                                 if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
89                                         AC_MSG_RESULT([yes])
90                                 else
91                                         AC_MSG_RESULT([no])
92                                         HIGHLIGHT=
93                                 fi
94                         fi
95                 fi
96         fi
97 else
98         if test "$with_highlight" != "no"; then
99                 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
100         fi
102         case $with_highlight in
103                 source-highlight) HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i";;
104                 highlight) HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc ";;
105                 vim)
106                         AC_MSG_CHECKING([whether vim has +syntax feature])
107                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
108                                 AC_MSG_RESULT([yes])
109                         else
110                                 AC_MSG_RESULT([no])
111                                 HIGHLIGHT=no
112                         fi
113                 ;;
114         esac
116         if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
117                 AC_MSG_ERROR([Could not find requested syntax highlighter])
118         fi
120 AC_SUBST([HIGHLIGHT_OPTIONS])
123 dnl Set runtime package dirs so we can find the script containing common routines.
125 dnl From Autoconf Macro Archive:
126 m4_define([AC_DEFINE_DIR], [
127         prefix_NONE=
128         exec_prefix_NONE=
129         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
130         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
131         eval ac_define_dir="\"[$]$2\""
132         eval ac_define_dir="\"$ac_define_dir\""
133         AC_SUBST($1, "$ac_define_dir")
134         test "$prefix_NONE" && prefix=NONE
135         test "$exec_prefix_NONE" && exec_prefix=NONE
137 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
138 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
139 PYTHON_PACKAGE_DIR="${datadir}/${PACKAGE}/python"
140 AC_DEFINE_DIR([PYTHON_PACKAGE_DIR], [PYTHON_PACKAGE_DIR])
142 dnl Only use -Wall if we have gcc
143 if test "x$GCC" = "xyes"; then
144         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
145                 CFLAGS="$CFLAGS -Wall"
146         fi
149 dnl if glib is available we can enable the tests
150 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
151         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
152                 gtk_doc_use_libtool="yes"
153                 build_tests="yes"
154         ],
155         [       gtk_doc_use_libtool="no"
156                 build_tests="no"
157         ]
159 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
160 dnl this enables the rule in test/Makefile.am
161 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
162 AC_SUBST(glib_prefix)
164 dnl enable runtime debugging code
165 AC_MSG_CHECKING(whether to enable runtime debugging code)
166 AC_ARG_ENABLE([debug],
167         AS_HELP_STRING([--enable-debug],
168         [enable runtime debugging code (default=no)]),,
169         [enable_debug="no"])
170 AC_MSG_RESULT($enable_debug)
172 if test "x$enable_debug" != "xno"; then
173         TRACE="LogTrace"
174 else
175         TRACE="#"
177 AC_SUBST(TRACE)
179 dnl check what date format we can use for the makefile tracing in tests
180 dnl this is mostly to detect the date command on macosx that is quite cripled
181 dnl  and broken too
182 AC_MSG_CHECKING(whether date can output nanoseconds)
183 date +%s.%N | grep -q 'N'
184 if test "$?" = "1"; then
185   TS_FMT="+%s.%N"
186   ELAPSED_FMT="+%H:%M:%S.%N"
187   AC_MSG_RESULT(yes)
188 else
189   TS_FMT="+%s.0"
190   ELAPSED_FMT="+%H:%M:%S"
191   AC_MSG_RESULT(no)
193 AC_SUBST(TS_FMT)
194 AC_SUBST(ELAPSED_FMT)
196 AC_MSG_CHECKING(whether date can format dates)
197 date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
198 if test "$?" = "0"; then
199   DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
200   AC_MSG_RESULT(yes)
201 else
202   DATE_FMT_CMD="echo "
203   AC_MSG_RESULT(no)
205 AC_SUBST(DATE_FMT_CMD)
208 dnl Documentation
210 AC_MSG_CHECKING([for yelp-tools])
211 have_yelp_tools=no
212 m4_ifdef([YELP_HELP_INIT],[
213 AC_MSG_RESULT([yes])
214 YELP_HELP_INIT
215 have_yelp_tools=yes
217 if test "x$have_yelp_tools" != "xyes"; then
218   AC_MSG_RESULT([no])
220 AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
222 AC_CONFIG_FILES([Makefile
223 gtk-doc.pc
224 cmake/Makefile
225 cmake/GtkDocConfig.cmake
226 cmake/GtkDocConfigVersion.cmake
227 gtkdoc/config.py
228 help/Makefile
229 help/manual/Makefile
230 tests/Makefile
231 tests/gobject/Makefile
232 tests/gobject/src/Makefile
233 tests/gobject/docs/Makefile
234 tests/bugs/Makefile
235 tests/bugs/src/Makefile
236 tests/bugs/docs/Makefile
237 tests/annotations/Makefile
238 tests/annotations/src/Makefile
239 tests/annotations/docs/Makefile
240 tests/fail/Makefile
241 tests/fail/src/Makefile
242 tests/fail/docs/Makefile
243 tests/empty/Makefile
244 tests/empty/src/Makefile
245 tests/empty/docs/Makefile
246 tests/program/Makefile
247 tests/program/src/Makefile
248 tests/program/docs/Makefile
251 dnl run chmod on these after parsing them.
252 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
253 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
254 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
255 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
256 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
257 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
258 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
259 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
260 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
261 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
262 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
263 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
264 AC_OUTPUT
266 AC_MSG_NOTICE([
267 gtk-doc was configured with the following options:
268 ==================================================])
270 test -n "$DBLATEX$FOP" \
271     && AC_MSG_NOTICE([** PDF support enabled, using $DBLATEX$FOP]) \
272     || AC_MSG_NOTICE([   PDF support disabled, no dblatex or fop available])
273 test -n "$HIGHLIGHT" \
274     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
275     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
276 test "x$build_tests" != "xno" \
277     && AC_MSG_NOTICE([** Building regression tests]) \
278     || AC_MSG_NOTICE([   Skipping regression tests])
279 test "x$enable_debug" != "xno" \
280     && AC_MSG_NOTICE([** Debug tracing enabled]) \
281     || AC_MSG_NOTICE([   Debug tracing disabled])
282 test "x$have_yelp_tools" != "xno" \
283     && AC_MSG_NOTICE([** Documentation enabled]) \
284     || AC_MSG_NOTICE([   Documentation disabled])