From 2b45ef3a8a164648647eba1265db6a3d10ea7bad Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jun 2003 18:28:20 +0000 Subject: [PATCH] Bug 75: dont build docs unless docbook is available. Dont install docs unless they are pre-built or buildable --- Makefile.am | 3 ++- configure.in | 26 +++++++++++++++++++++----- doc/Makefile.am | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index fd10fbb..bf93beb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,8 @@ # 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 \ diff --git a/configure.in b/configure.in index 76e8d44..21652b1 100644 --- a/configure.in +++ b/configure.in @@ -335,16 +335,32 @@ AC_SUBST(ORTH_FILES) 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 # diff --git a/doc/Makefile.am b/doc/Makefile.am index 6a9d782..b98c13b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -93,7 +93,7 @@ EXTRA_DIST = $(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(FNCS_TMPL) SUFFIXES=.fncs .sgml .txt .html -if ENABLE_DOCS +if USEDOCBOOK .fncs.sgml: $(RM) $@ -- 2.39.5