migratetmpl: also remove the migration tool
[gtk-doc.git] / configure.ac
blob1c0db4c1371fd8a4f34d98192eedb10368ed7dd5
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.25.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.16.0])
43 if "$PERL" -e "require v5.16.0"; then
44         AC_MSG_RESULT([yes])
45 else
46         AC_MSG_RESULT([no])
47         AC_MSG_ERROR([perl >= 5.16.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 xsltproc
58 dnl
59 AC_PATH_PROG([XSLTPROC], [xsltproc])
60 if test -z "$XSLTPROC"; then
61         AC_MSG_ERROR([xsltproc not found])
64 dnl
65 dnl Check for dblatex/fop (for pdf output)
66 dnl
67 AC_PATH_PROG([DBLATEX], [dblatex])
68 if test -z "$DBLATEX"; then
69         AC_PATH_PROG([FOP], [fop])
70         if test -z "$FOP"; then
71                 AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
72         fi
75 dnl check for DocBook DTD and stylesheets in the local catalog.
76 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
77 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
79 dnl
80 dnl Check for syntax highlighters
81 dnl
82 AC_ARG_WITH([highlight],
83         AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
84         , [with_highlight=auto])
86 case $with_highlight in
87         no|source-highlight|highlight|vim|auto) ;;
88         *) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
89 esac
91 HIGHLIGHT_OPTIONS=""
92 if test "$with_highlight" = "auto"; then
93         AC_PATH_PROG([HIGHLIGHT], [source-highlight])
94         if test -n "$HIGHLIGHT"; then
95                 HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i"
96         else
97                 AC_PATH_PROG([HIGHLIGHT], [highlight])
98                 if test -n "$HIGHLIGHT"; then
99                         HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc "
100                 else
101                         AC_PATH_PROG([HIGHLIGHT], [vim])
102                         if test -n "$HIGHLIGHT"; then
103                                 dnl vim is useless if it does not support syntax highlighting
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=
110                                 fi
111                         fi
112                 fi
113         fi
114 else
115         if test "$with_highlight" != "no"; then
116                 AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
117         fi
119         case $with_highlight in
120                 source-highlight) HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i";;
121                 highlight) HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc ";;
122                 vim)
123                         AC_MSG_CHECKING([whether vim has +syntax feature])
124                         if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
125                                 AC_MSG_RESULT([yes])
126                         else
127                                 AC_MSG_RESULT([no])
128                                 HIGHLIGHT=no
129                         fi
130                 ;;
131         esac
133         if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
134                 AC_MSG_ERROR([Could not find requested syntax highlighter])
135         fi
137 AC_SUBST([HIGHLIGHT_OPTIONS])
140 dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
142 dnl From Autoconf Macro Archive:
143 m4_define([AC_DEFINE_DIR], [
144         prefix_NONE=
145         exec_prefix_NONE=
146         test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
147         test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
148         eval ac_define_dir="\"[$]$2\""
149         eval ac_define_dir="\"$ac_define_dir\""
150         AC_SUBST($1, "$ac_define_dir")
151         test "$prefix_NONE" && prefix=NONE
152         test "$exec_prefix_NONE" && exec_prefix=NONE
154 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
155 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
157 dnl Only use -Wall if we have gcc
158 if test "x$GCC" = "xyes"; then
159         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
160                 CFLAGS="$CFLAGS -Wall"
161         fi
164 dnl if glib is available we can enable the tests
165 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
166         [       glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
167                 gtk_doc_use_libtool="yes"
168                 build_tests="yes"
169         ],
170         [       gtk_doc_use_libtool="no"
171                 build_tests="no"
172         ]
174 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
175 dnl this enables the rule in test/Makefile.am
176 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
177 AC_SUBST(glib_prefix)
179 dnl enable runtime debugging code
180 AC_MSG_CHECKING(whether to enable runtime debugging code)
181 AC_ARG_ENABLE([debug],
182         AS_HELP_STRING([--enable-debug],
183         [enable runtime debugging code (default=no)]),,
184         [enable_debug="no"])
185 AC_MSG_RESULT($enable_debug)
187 if test "x$enable_debug" != "xno"; then
188         TRACE="LogTrace"
189 else
190         TRACE="#"
192 AC_SUBST(TRACE)
194 dnl check what date format we can use for the makefile tracing in tests
195 dnl this is mostly to detect the date command on macosx that is quite cripled
196 dnl  and broken too
197 AC_MSG_CHECKING(whether date can output nanoseconds)
198 date +%s.%N | grep -q 'N'
199 if test "$?" = "1"; then
200   TS_FMT="+%s.%N"
201   ELAPSED_FMT="+%H:%M:%S.%N"
202   AC_MSG_RESULT(yes)
203 else
204   TS_FMT="+%s.0"
205   ELAPSED_FMT="+%H:%M:%S"
206   AC_MSG_RESULT(no)
208 AC_SUBST(TS_FMT)
209 AC_SUBST(ELAPSED_FMT)
211 AC_MSG_CHECKING(whether date can format dates)
212 date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
213 if test "$?" = "0"; then
214   DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
215   AC_MSG_RESULT(yes)
216 else
217   DATE_FMT_CMD="echo "
218   AC_MSG_RESULT(no)
220 AC_SUBST(DATE_FMT_CMD)
223 dnl Documentation
225 AC_MSG_CHECKING([for yelp-tools])
226 have_yelp_tools=no
227 m4_ifdef([YELP_HELP_INIT],[
228 AC_MSG_RESULT([yes])
229 YELP_HELP_INIT
230 have_yelp_tools=yes
232 if test "x$have_yelp_tools" != "xyes"; then
233   AC_MSG_RESULT([no])
235 AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
237 AC_CONFIG_FILES([Makefile
238 gtk-doc.pc
239 gtk-doc.dsl
240 gtk-doc.spec
241 gtk-doc.cat
242 gtkdoc-common.pl
243 cmake/Makefile
244 cmake/GtkDocConfig.cmake
245 cmake/GtkDocConfigVersion.cmake
246 help/Makefile
247 help/manual/Makefile
248 tests/Makefile
249 tests/gobject/Makefile
250 tests/gobject/src/Makefile
251 tests/gobject/docs/Makefile
252 tests/bugs/Makefile
253 tests/bugs/src/Makefile
254 tests/bugs/docs/Makefile
255 tests/annotations/Makefile
256 tests/annotations/src/Makefile
257 tests/annotations/docs/Makefile
258 tests/fail/Makefile
259 tests/fail/src/Makefile
260 tests/fail/docs/Makefile
261 tests/empty/Makefile
262 tests/empty/src/Makefile
263 tests/empty/docs/Makefile
264 tests/program/Makefile
265 tests/program/src/Makefile
266 tests/program/docs/Makefile
269 dnl run chmod on these after parsing them.
270 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
271 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
272 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
273 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
274 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
275 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
276 AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
277 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
278 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
279 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
280 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
281 AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
282 AC_OUTPUT
284 AC_MSG_NOTICE([
285 gtk-doc was configured with the following options:
286 ==================================================])
288 test "$PYTHON" != : \
289     && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
290     || AC_MSG_NOTICE([   Python based tools disabled])
291 test -n "$DBLATEX$FOP" \
292     && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
293     || AC_MSG_NOTICE([   XML PDF support disabled, no dblatex or fop available])
294 test -n "$HIGHLIGHT" \
295     && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
296     || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
297 test "x$build_tests" != "xno" \
298     && AC_MSG_NOTICE([** Building regression tests]) \
299     || AC_MSG_NOTICE([   Skipping regression tests])
300 test "x$enable_debug" != "xno" \
301     && AC_MSG_NOTICE([** Debug tracing enabled]) \
302     || AC_MSG_NOTICE([   Debug tracing disabled])
303 test "x$have_yelp_tools" != "xno" \
304     && AC_MSG_NOTICE([** Documentation enabled]) \
305     || AC_MSG_NOTICE([   Documentation disabled])