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