patch by: Kouhei Sutou <kou@cozmixng.org>
[gtk-doc.git] / configure.in
blob1acec915369b1c8f0a0d82aa08dd6e687274c1d1
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.52)
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 m4_define(gtk_doc_version, 1.10)
8 AC_INIT([gtk-doc], [gtk_doc_version],
9         [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc])
11 AC_CONFIG_SRCDIR([gtk-doc.dsl.in])
13 AM_INIT_AUTOMAKE
14 AM_MAINTAINER_MODE
16 # make sure $ACLOCAL_FLAGS are used during a rebuild.
17 AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
19 AC_ISC_POSIX
20 AC_PROG_CC
21 AC_PROG_LIBTOOL
23 # Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
24 PKG_PROG_PKG_CONFIG([0.19])
26 dnl
27 dnl Check for Perl.
28 dnl
29 AC_PATH_PROG([PERL], [perl])
30 if test -z "$PERL"; then
31   AC_MSG_ERROR([perl not found])
34 AC_MSG_CHECKING([if Perl version >= 5.6.0])
35 if "$PERL" -e "require v5.6.0"; then
36   AC_MSG_RESULT([yes])
37 else
38   AC_MSG_RESULT([no])
39   AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
42 dnl
43 dnl Check for Python.
44 dnl
45 AC_PATH_PROG([PYTHON], [python2.5])
46 if test -z "$PYTHON"; then
47   AC_MSG_ERROR([python 2.5 not found])
50 dnl
51 dnl Check for jade or openjade.
52 dnl
53 dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
54 dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
55 dnl that, which is bad for accessibility.
56 dnl
57 SGML_FORMAT_TYPE=sgml-raw
58 AC_PATH_PROG([JADE], [openjade])
59 if test -z "$JADE"; then
60   SGML_FORMAT_TYPE=sgml
61   AC_PATH_PROG([JADE], [jade])
62   if test -z "$JADE"; then
63     AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
64   fi
66 AC_SUBST([SGML_FORMAT_TYPE])
68 dnl
69 dnl Check for xsltproc
70 dnl
71 AC_PATH_PROG([XSLTPROC], [xsltproc])
72 if test -z "$XSLTPROC"; then
73   AC_MSG_ERROR([xsltproc not found])
76 dnl check for DocBook DTD and stylesheets in the local catalog.
77 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
78    [DocBook XML DTD V4.1.2])
79 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl],
80    [DocBook XSL Stylesheets])
83 # Set PACKAGE_DATA_DIR so we can find the script containing common routines.
85 dnl From Autoconf Macro Archive:
86 m4_define([AC_DEFINE_DIR], [
87   prefix_NONE=
88   exec_prefix_NONE=
89   test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
90   test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
91   eval ac_define_dir="\"[$]$2\""
92   eval ac_define_dir="\"$ac_define_dir\""
93   AC_SUBST($1, "$ac_define_dir")
94   test "$prefix_NONE" && prefix=NONE
95   test "$exec_prefix_NONE" && exec_prefix=NONE
97 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
98 AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
101 dnl Only use -Wall if we have gcc
102 if test "x$GCC" = "xyes"; then
103   if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
104     CFLAGS="$CFLAGS -Wall"
105   fi
108 # Check for scrollkeeper
109 AC_PATH_PROG(scrollkeeper_config, scrollkeeper-config, no)
110 if test x$scrollkeeper_config = xno; then
111   AC_MSG_WARN([Couldn't find scrollkeeper-config, please install the scrollkeeper package])
112 #  if test x$xsltproc = xno; then
113 #    AC_MSG_WARN([Couldn't find xsltproc, please install the libxml/libxslt package])
114 #  fi
116 AM_CONDITIONAL(ENABLE_SCROLLKEEPER, test ! x$scrollkeeper_config = xno)
117 SCROLLKEEPER_BUILD_REQUIRED=0.3.5
118 AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED)
120 # if glib is available we can enable the tests
121 PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0], [
122     glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
123     gtk_doc_use_libtool=true
124     build_tests=true
125   ],[
126     gtk_doc_use_libtool=false
127     build_tests=false
128   ]
130 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xtrue )
131 dnl this enable the rule in test/Makefile.am
132 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xtrue)
133 AC_SUBST(glib_prefix)
136 AC_CONFIG_FILES([Makefile
137 gtk-doc.pc
138 gtk-doc.dsl
139 gtk-doc.spec
140 gtk-doc.cat
141 gtkdoc-common.pl
142 help/Makefile
143 help/manual/Makefile
144 help/manual/C/Makefile
145 help/manual/C/gtk-doc-manual-C.omf
146 tests/Makefile
147 tests/gobject/Makefile
148 tests/gobject/src/Makefile
149 tests/gobject/docs/Makefile
150 tests/bugs/Makefile
151 tests/bugs/src/Makefile
152 tests/bugs/docs/Makefile
155 dnl run chmod on these after parsing them.
156 AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
157 AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
158 AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
159 AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
160 AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
161 AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
162 AC_CONFIG_FILES([gtkdoc-mktmpl],   [chmod +x gtkdoc-mktmpl])
163 AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
164 AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
165 AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
166 AC_CONFIG_FILES([gtkdoc-scanobj],  [chmod +x gtkdoc-scanobj])
167 AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
169 AC_OUTPUT