# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-SUBDIRS=fontconfig fc-lang fc-glyphname src fc-cache fc-list fc-match doc test
+DOCSRC=@DOCSRC@
+SUBDIRS=fontconfig fc-lang fc-glyphname src fc-cache fc-list fc-match $(DOCSRC) test
EXTRA_DIST = \
fontconfig.pc.in \
AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
-AC_ARG_ENABLE(docs, [ --disable-docs Don't build and install documentation],,enable_docs=yes)
+AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes)
-if test "x$enable_docs" = xyes; then
- if test "x$HASDOCBOOK" != xyes; then
- enable_docs=no
- fi
+default_docs="yes"
+#
+# Check if docs exist or can be created
+#
+if test x$HASDOCBOOK = xno; then
+ if test -f doc/fonts-conf.5; then
+ :
+ else
+ default_docs="no"
+ fi
fi
+AC_ARG_ENABLE(docs, [ --disable-docs Don't build and install documentation],,enable_docs=$default_docs)
+
AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes)
+if test "x$enable_docs" = xyes; then
+ DOCSRC="doc"
+else
+ DOCSRC=""
+fi
+
+AC_SUBST(DOCSRC)
+
#
# Figure out where to install documentation
#