SUBDIRS=src tests doc rpm
-## install the following extra data with docs
+## what to clean
+
+CLEANFILES=*~\
+ $(PACKAGE)-$(VERSION).tar.gz\
+ $(PACKAGE)-$(VERSION).rpm\
+ ChangeLog.bak
+
+## what additional things to distribute
+
+EXTRA_DIST= ChangeLogOld $(m4data_DATA)
+
+## install docs
+datarootdir = $(prefix)/share
+docdir = $(datarootdir)/doc/$(PACKAGE)
doc_DATA = ChangeLog ChangeLogOld NEWS README COPYING.LESSER
-## install check.m4 so clients can use it
+## install check.m4 with AM_PATH_CHECK in it
m4datadir = $(datadir)/aclocal
m4data_DATA = check.m4
-EXTRA_DIST= ChangeLogOld $(m4data_DATA)
-
-CLEANFILES=*~\
- ${PACKAGE}-${VERSION}*.gz\
- ${PACKAGE}-${VERSION}*.rpm\
- ChangeLog.bak
rpm: dist
(cd rpm && ${MAKE} ${AM_MAKEFLAGS} rpm)
AC_CHECK_PROGS(GCOV, gcov, false)
AC_CHECK_PROGS(LCOV, lcov, false)
AC_CHECK_PROGS(GENHTML, genhtml, false)
+
+# check for docbook2html, and if we don't have it issue a warning,
+# otherwise define HAVE_DOCBOOK2HTML to enable building docs
AC_CHECK_PROG(have_docbook2html,docbook2html,yes)
if test x"$have_docbook2html" != "xyes" ; then
- AC_MSG_WARN([required tools not found, not building docs])
+ AC_MSG_WARN([docbook2html missing, not building docs; install docbook-utils or sgml2x])
fi
-AM_CONDITIONAL(MAKE_DOC, test x"$have_docbook2html" = "xyes")
+AM_CONDITIONAL(HAVE_DOCBOOK2HTML, test x"$have_docbook2html" = "xyes")
# Checks for libraries.
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
-
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
## Process this file with automake to produce Makefile.in
-SUBDIRS=money
+SUBDIRS = money
-SUFFIXES = .html
+## source files
sgml_docs = tutorial.sgml
+
+## built files
+
html_docs = *.html
$(html_docs): $(sgml_docs)
docbook2html -o . $<
-EXTRA_DIST = $(sgml_docs) $(html_docs)
+## what to clean
+
+CLEANFILES = *~
+
+## what to distribute
+
+EXTRA_DIST = $(sgml_docs)
+
+## what to install
+
+datarootdir = $(prefix)/share
-if MAKE_DOC
-doc_DATA = $(sgml_docs) $(html_docs)
-CLEANFILES = $(html_docs) *~
-else
-doc_DATA = $(sgml_docs)
-CLEANFILES=*~
+if HAVE_DOCBOOK2HTML
+ tutorialdir=$(datarootdir)/doc/$(PACKAGE)/tutorial
+ tutorial_DATA=$(html_docs)
+ CLEANFILES += $(html_docs)
endif
## Process this file with automake to produce Makefile.in
-example_docs =\
+## source files
+
+examples =\
money.h\
money.c\
check_money.c\
configure.in.money\
Makefile.am.money
-EXTRA_DIST = $(example_docs)
+## what to clean
+
+CLEANFILES = *~
+
+## what to distribute
+
+EXTRA_DIST = $(examples)
+
+## what to install
-exampledoc_DATA = $(example_docs)
\ No newline at end of file
+datarootdir = $(prefix)/share
+examplesdir = $(datarootdir)/doc/$(PACKAGE)/examples
+examples_DATA = $(examples)