[librsvgmm] Revamp build system and documentation generation



commit c7a2b698c3eb21522d23caecdd4987f50d4374b0
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Sat Jul 11 02:42:22 2009 +0200

    Revamp build system and documentation generation
    
    * build/: New directory for auxiliary build files.
    * doc/: Rename docs/ directory to doc/.
    * m4/: Delete directory after moving its content to build/.
    
    * build/compile-binding.am: New Automake include file for
    compiling generated binding sources.
    * build/dist-changelog.am: New Automake include file for
    automatic generation of the ChangeLog file on make dist.
    * build/doc-reference.am: New Automake include file for building
    the reference documentation using Doxygen and xsltproc.
    * build/generate-binding.am: New Automake include file for
    generating the C++ binding sources using gmmproc.
    
    * build/dk-warn.m4: Rename from m4/dk-warn.m4.
    * build/mm-doc.m4: New Autoconf M4 file file defining the
    MM_ARG_ENABLE_DOCUMENTATION macro.
    * build/mm-pkg.m4: New Autoconf M4 file file defining the
    MM_PKG_CONFIG_SUBST macro.
    
    * tools/build_generated.am: Remove obsolete Automake include file.
    * tools/build_gmmproc.am: ditto,
    * tools/build_library.am: ditto.
    
    * configure.ac: Bump Autotools version requirements.  Use new build/
    directory for both M4 macros and auxiliary build files, including the
    config.h header file.
    (ENABLE_DOCUMENTATION): Use new MM_ARG_ENABLE_DOCUMENTATION() macro.
    (GTHREAD_CFLAGS): Use the new MM_PKG_CONFIG_SUBST() macro to capture
    the output of pkg-config.
    (GMMPROC_DIR): Likewise.
    * Makefile.am (dist-changelog): Factor out into separate Automake
    include file build/dist-changelog.am.
    (SUBDIRS): List optional subdirectories indirectly via variables,
    and use Automake conditionals to set those variables statically.
    
    * doc/Makefile.am: Rewrite to use build/doc-reference.am.
    * doc/reference/Doxyfile.in: Remove input file wildcard as the list
    of input files is now passed in verbatim from make.  Disable XML
    output as the DevHelp book is now generated from the tags file.
    * doc/reference/doxytag_to_devhelp2.xsl: New XSL transformation to
    generate a Devhelp 2 book from a Doxygen tag file.
    
    * tools/Makefile.am (dist_noinst_DATA): Remove all but the M4 files.
    * tools/m4/filelist.am: Note origin of file in comment.
    
    * librsvg/src/filelist.am: List .defs and .ccg files here, too.
    * librsvg/src/Makefile.am: Adapt to the revamped build system.
    
    * librsvg/librsvgmm/filelist.am: New Automake include file defining
    the list of source files in the directory.
    * librsvg/librsvgmm/Makefile.am: Adapt to the revamped build system.

 .gitignore                            |   11 +----
 Makefile.am                           |   24 +++++------
 build/.gitignore                      |    9 ++++
 build/compile-binding.am              |   39 +++++++++++++++++
 build/dist-changelog.am               |   32 ++++++++++++++
 {m4 => build}/dk-warn.m4              |    0
 build/doc-reference.am                |   73 +++++++++++++++++++++++++++++++++
 build/generate-binding.am             |   55 +++++++++++++++++++++++++
 build/mm-doc.m4                       |   61 +++++++++++++++++++++++++++
 build/mm-pkg.m4                       |   40 ++++++++++++++++++
 configure.ac                          |   29 +++++++------
 doc/Makefile.am                       |   27 ++++++++++++
 doc/reference/.gitignore              |    5 ++
 {docs => doc}/reference/Doxyfile.in   |   56 ++++++++++++++++---------
 doc/reference/doxytag_to_devhelp2.xsl |   64 +++++++++++++++++++++++++++++
 docs/Makefile.am                      |   63 ----------------------------
 docs/reference/.gitignore             |    6 ---
 librsvg/librsvgmm/Makefile.am         |   20 +++------
 librsvg/librsvgmm/filelist.am         |    7 +++
 librsvg/src/Makefile.am               |   16 ++-----
 librsvg/src/filelist.am               |   13 +++++-
 tools/Makefile.am                     |    7 +---
 tools/build_generated.am              |   36 ----------------
 tools/build_gmmproc.am                |   60 ---------------------------
 tools/build_library.am                |   48 ---------------------
 tools/m4/filelist.am                  |    2 +
 26 files changed, 500 insertions(+), 303 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9ee138f..2973c79 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,17 +8,10 @@ Makefile.in
 /INSTALL
 /aclocal.m4
 /autom4te.cache
-/compile
-/config.*
+/config.log
+/config.status
 /configure
-/depcomp
-/install-sh
 /librsvgmm-*.tar.*
 /libtool
-/ltmain.sh
-/missing
-/stamp-h?
 /*.lineno
-/m4/libtool.m4
-/m4/lt*.m4
 /tools/extradefs/generate_extra_defs
diff --git a/Makefile.am b/Makefile.am
index bf2af58..bf53b51 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,28 +15,24 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
 DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
 
 if MAINTAINER_MODE
-SUBDIRS = tools librsvg/src librsvg/librsvgmm docs
+src_subdirs = tools librsvg/src
 else
-SUBDIRS = librsvg/librsvgmm docs
+src_subdirs =
 endif
+if ENABLE_DOCUMENTATION
+doc_subdirs = doc
+else
+doc_subdirs =
+endif
+SUBDIRS = $(src_subdirs) librsvg/librsvgmm $(doc_subdirs)
 
 dist_noinst_SCRIPTS = autogen.sh
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = librsvg/librsvgmm-2.0.pc
 
-gitlog_format = --date=short --pretty='format:%cd  %an  <%ae>%n%n%s%n%n%b'
-log_transform = sed '/^[12]...-[01].-[0123].  [^<>]*  <[^<>]*>$$/b;s/^[	 ]*/	/;s/[	 ]*$$//'
-
-dist-hook:
-	if test -d "$(top_srcdir)/.git"; then \
-	    ${SHELL} $(top_srcdir)/missing --run git \
-		--git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
-		log $(gitlog_format) | $(log_transform) >ChangeLog.tmp \
-	    && mv -f ChangeLog.tmp "$(top_distdir)/ChangeLog" \
-	    || { rm -f ChangeLog.tmp; exit 1; }; \
-	fi
+include $(top_srcdir)/build/dist-changelog.am
diff --git a/build/.gitignore b/build/.gitignore
new file mode 100644
index 0000000..4b5cf18
--- /dev/null
+++ b/build/.gitignore
@@ -0,0 +1,9 @@
+/compile
+/config.*
+/depcomp
+/install-sh
+/libtool.m4
+/lt*.m4
+/ltmain.sh
+/missing
+/stamp-h?
diff --git a/build/compile-binding.am b/build/compile-binding.am
new file mode 100644
index 0000000..d78ab28
--- /dev/null
+++ b/build/compile-binding.am
@@ -0,0 +1,39 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+## Parameters:  lib_LTLIBRARIES
+## Overrides:   binding_name, binding_basedir, binding_libname
+## Files:       files_built_cc, files_built_h, files_built_ph,
+##              files_extra_cc, files_extra_h
+## Output:      binding_sources, binding_includes, binding_cppflags
+
+binding_name		?= $(notdir $(subdir))
+binding_basedir		?= $(patsubst %/,%,$(dir $(subdir)))
+binding_libname		?= $(basename $(lib_LTLIBRARIES))
+
+binding_sources		= $(files_built_cc) $(files_extra_cc)
+binding_includes	= -I.. -I$(top_srcdir)/$(binding_basedir) -I$(top_builddir)
+binding_cppflags	= -DG_LOG_DOMAIN=\""$(binding_name)"\"
+
+binding_includedir	= $(includedir)/$(binding_libname)/$(binding_name)
+binding_include_HEADERS	= $(files_built_h) $(files_extra_h)
+
+binding_privatedir	= $(binding_includedir)/private
+binding_private_HEADERS	= $(files_built_ph)
+
+binding_built_sources	= $(files_built_cc) $(files_built_h) $(files_built_ph)
+MAINTAINERCLEANFILES	= $(addprefix $(srcdir)/,$(binding_built_sources))
diff --git a/build/dist-changelog.am b/build/dist-changelog.am
new file mode 100644
index 0000000..df33fd2
--- /dev/null
+++ b/build/dist-changelog.am
@@ -0,0 +1,32 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+if MAINTAINER_MODE
+dist-hook: dist-changelog
+else
+dist-hook:
+endif
+
+dist-changelog: $(top_srcdir)/.git/HEAD
+	@if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
+		log --date=short --pretty='format:%cd  %an  <%ae>%n%n%s%n%n%b' \
+	  | sed -e '/^[12]...-[01].-[0123].  [^<>]*  <[^<>]*>$$/ b' \
+		-e 's/^[	 ]*/	/;s/[	 ]*$$//' >.ChangeLog.tmp; \
+	then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
+	else rm -f .ChangeLog.tmp; exit 1; fi
+
+.PHONY: dist-changelog
diff --git a/m4/dk-warn.m4 b/build/dk-warn.m4
similarity index 100%
rename from m4/dk-warn.m4
rename to build/dk-warn.m4
diff --git a/build/doc-reference.am b/build/doc-reference.am
new file mode 100644
index 0000000..92031ba
--- /dev/null
+++ b/build/doc-reference.am
@@ -0,0 +1,73 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+book_title ?= $(PACKAGE_NAME) Reference Manual
+
+doxytagfile = reference/$(book_name).tag
+devhelpfile = reference/$(book_name).devhelp2
+
+htmlref_patterns ?=		\
+	reference/html/*.html	\
+	reference/html/*.css	\
+	reference/html/*.png	\
+	reference/html/*.gif
+
+htmlref_files := $(or $(wildcard\
+	$(htmlref_patterns)),$(wildcard\
+	$(addprefix $(srcdir)/,$(htmlref_patterns))))
+
+referencedir = $(datarootdir)/doc/$(book_name)/reference
+dist_reference_DATA = $(doxytagfile)
+
+htmlrefdir = $(referencedir)/html
+dist_htmlref_DATA = $(htmlref_files)
+
+devhelpdir = $(datadir)/devhelp/books/$(book_name)
+devhelp_DATA = $(devhelpfile)
+
+DISTCLEANFILES = $(devhelpfile) reference/doxygen.log
+MAINTAINERCLEANFILES = $(doxytagfile)
+
+beautify_docs ?= $(GMMPROC_DIR)/beautify_docs.pl
+doxytag_to_devhelp2 ?= $(GMMPROC_DIR)/doxytag_to_devhelp2.xsl
+
+dh_xsl_params =	--stringparam book_title '$(book_title)' \
+		--stringparam book_name '$(book_name)' \
+		--stringparam reference_prefix "$(htmlrefdir)"
+
+if MAINTAINER_MODE
+reference_deps = reference/Doxyfile $(doc_input)
+else
+reference_deps =
+endif
+
+maintainer-clean-local:
+	-rm -rf reference/html
+
+reference/Doxyfile: $(srcdir)/reference/Doxyfile.in $(top_builddir)/config.status
+	cd "$(top_builddir)" && $(SHELL) ./config.status '$(subdir)/$@'
+
+$(doxytagfile): $(reference_deps)
+	-rm -f '$@'
+	-rm -rf reference/html
+	(echo '@INCLUDE =' reference/Doxyfile && echo 'INPUT =' $(doc_input)) | $(DOXYGEN) -
+	$(PERL_PATH) "$(beautify_docs)" reference/html
+
+reference/html/%: $(doxytagfile)
+
+%.devhelp2: %.tag
+	$(XSLTPROC) $(dh_xsl_params) -o '$@' "$(doxytag_to_devhelp2)" '$<'
diff --git a/build/generate-binding.am b/build/generate-binding.am
new file mode 100644
index 0000000..5943929
--- /dev/null
+++ b/build/generate-binding.am
@@ -0,0 +1,55 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+## Parameter:   binding_name, wrap_init_flags
+## Files:       files_tools_m4, files_defs, files_hg, files_ccg
+## Output:      dist_noinst_DATA
+
+include $(top_srcdir)/tools/m4/filelist.am
+
+dist_noinst_DATA = $(files_defs) $(files_hg) $(files_ccg)
+
+tools_dir	= $(top_srcdir)/tools
+output_dir	= $(top_srcdir)/$(dir $(subdir))$(binding_name)
+stamp_dir	= $(srcdir)/.stamps
+
+path_tools_m4	= $(files_tools_m4:%.m4=$(tools_dir)/m4/%.m4)
+path_files_hg	= $(files_hg:%.hg=$(srcdir)/%.hg)
+stamp_files	= $(files_hg:%.hg=$(stamp_dir)/stamp-%)
+
+gmmproc		= $(GMMPROC_DIR)/gmmproc -I $(tools_dir)/m4 --defs $(srcdir)
+gen_wrap_init	= $(PERL_PATH) $(GMMPROC_DIR)/generate_wrap_init.pl $(wrap_init_flags)
+
+.DELETE_ON_ERROR:
+.PHONY: mkdir-stamps
+
+all-local: $(stamp_files) $(output_dir)/wrap_init.cc
+
+mkdir-stamps:
+	test -d "$(stamp_dir)" || $(MKDIR_P) "$(stamp_dir)"
+
+maintainer-clean-local:
+	-rm -rf "$(stamp_dir)"
+
+$(stamp_files): | mkdir-stamps
+
+$(output_dir)/wrap_init.cc:: $(path_files_hg)
+	$(gen_wrap_init) $(path_files_hg) >'$@'
+
+$(stamp_dir)/stamp-%:: %.hg %.ccg $(path_tools_m4) $(files_defs)
+	@echo timestamp >'$@'
+	$(gmmproc) $(notdir $*) $(srcdir) $(output_dir)
diff --git a/build/mm-doc.m4 b/build/mm-doc.m4
new file mode 100644
index 0000000..b63d75e
--- /dev/null
+++ b/build/mm-doc.m4
@@ -0,0 +1,61 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+#serial 20090705
+
+## _MM_ARG_ENABLE_DOCUMENTATION(variable)
+##
+m4_define([_MM_ARG_ENABLE_DOCUMENTATION],
+[dnl
+AC_ARG_VAR([DOXYGEN], [path to doxygen utility])
+AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])[]dnl
+
+AC_ARG_VAR([XSLTPROC], [path to xsltproc utility])
+AC_CHECK_PROG([XSLTPROC], [xsltproc], [xsltproc])[]dnl
+
+AC_ARG_ENABLE([documentation],
+              [AS_HELP_STRING([--disable-documentation],
+                              [do not build or install the documentation])],
+              [$1=$enableval],
+              [$1=yes])[]dnl
+
+AS_IF([test "x$$1" != xno],
+[
+  AS_IF([test "x$USE_MAINTAINER_MODE" != xno && test "x$DOXYGEN" = x], [mm_missing=doxygen],
+        [test "x$XSLTPROC" = x], [mm_missing=xsltproc],
+        [mm_missing=])
+  AS_IF([test -n "$mm_missing"], [AC_MSG_FAILURE([[
+*** Documentation is enabled in this configuration, but the
+*** required tool ${mm_missing} could not be found.]])])
+])
+AM_CONDITIONAL([$1], [test "x$$1" != xno])
+])
+
+## MM_ARG_ENABLE_DOCUMENTATION([variable])
+##
+## Provide the --disable-documentation configure option.  By default,
+## the documentation will be included in the build.  If not explicitly
+## disabled, also check whether the necessary tools are installed, and
+## abort if any are missing.
+##
+## The tools checked for are doxygen and xsltproc.  The substitution
+## variables DOXYGEN and XSLTPROC are set to the command names, unless
+## overridden in the user environment.  Note that Doxygen is a hard
+## dependency only in maintainer mode if the option is provided.
+##
+AC_DEFUN([MM_ARG_ENABLE_DOCUMENTATION],
+         [_MM_ARG_ENABLE_DOCUMENTATION(m4_default([$1], [ENABLE_DOCUMENTATION]))])
diff --git a/build/mm-pkg.m4 b/build/mm-pkg.m4
new file mode 100644
index 0000000..956128c
--- /dev/null
+++ b/build/mm-pkg.m4
@@ -0,0 +1,40 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+#serial 20090710
+
+## MM_PKG_CONFIG_SUBST(variable, arguments, [action-if-found], [action-if-not-found])
+##
+## Run the pkg-config utility with the specified command-line <arguments>
+## and capture its standard output in the named shell <variable>.  If the
+## command exited successfully, execute <action-if-found> in the shell if
+## specified.  If the command failed, run <action-if-not-found> if given,
+## otherwise ignore the error.
+##
+AC_DEFUN([MM_PKG_CONFIG_SUBST],
+[dnl
+m4_assert([$# >= 2 && $# <= 4])[]dnl
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])[]dnl
+AC_MSG_CHECKING([for $1])
+
+AS_IF([test -z "${$1+set}"],
+      [$1=`$PKG_CONFIG $2 2>&AS_MESSAGE_LOG_FD`
+       AS_IF([test "[$]?" -eq 0], [$3], [$4])])
+
+AC_MSG_RESULT([[$]$1])
+AC_SUBST([$1])[]dnl
+])
diff --git a/configure.ac b/configure.ac
index 2e1d9a2..af4f5c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,13 +16,15 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_INIT([librsvgmm], [2.25.0], [gtkmm-list gnome org], [librsvgmm])
-AC_PREREQ([2.60])
+AC_PREREQ([2.62])
+
 AC_CONFIG_SRCDIR([librsvg/src/rsvg.hg])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_AUX_DIR([build])
+AC_CONFIG_MACRO_DIR([build])
+AC_CONFIG_HEADERS([build/config.h])
 
 # The ustar format supports longer filenames
-AM_INIT_AUTOMAKE([1.9 -Wno-portability no-define nostdinc tar-ustar])
+AM_INIT_AUTOMAKE([1.10 -Wno-portability no-define nostdinc tar-ustar])
 AM_MAINTAINER_MODE
 AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
 
@@ -36,21 +38,20 @@ AC_SUBST([LIBRSVGMM_SO_VERSION], [0:0:0])
 LT_PREREQ([2.2.0])
 LT_INIT([disable-static win32-dll])
 
-# Doxygen needs the path to the installed Perl
-GLIBMM_CHECK_PERL([5.6.0])
-
 PKG_CHECK_MODULES([LIBRSVGMM], [librsvg-2.0 >= 2.25 cairomm-1.0 >= 1.6 glibmm-2.4 >= 2.16])
 
-# gthread isn't a requirement, but we should use its CFLAGS if available
-PKG_CHECK_MODULES([GTHREAD], [gthread-2.0 >= 2.16],, [GTHREAD_CFLAGS= GTHREAD_LIBS=])
+# Get compiler flags to enable reentrancy
+MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0])
 
 # Locate gmmproc directory
-GMMPROC_DIR=`$PKG_CONFIG --variable=gmmprocdir glibmm-2.4 2>&AS_MESSAGE_LOG_FD`
-AC_SUBST([GMMPROC_DIR])
+MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.4])
+
+# Doxygen needs the path to the installed Perl
+GLIBMM_CHECK_PERL([5.6.0])
+MM_ARG_ENABLE_DOCUMENTATION
 
 AC_LANG([C++])
 
-# Evaluate the --enable-warnings=level option.
 DK_ARG_ENABLE_WARNINGS([LIBRSVGMM_WXXFLAGS],
                        [-Wall],
                        [-pedantic -Wall -Wextra],
@@ -62,6 +63,6 @@ AC_CONFIG_FILES([Makefile
                  librsvg/librsvgmm-2.0-uninstalled.pc
                  librsvg/src/Makefile
                  librsvg/librsvgmm/Makefile
-                 docs/Makefile
-                 docs/reference/Doxyfile])
+                 doc/Makefile
+                 doc/reference/Doxyfile])
 AC_OUTPUT
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..3fec6c1
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,27 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of librsvgmm.
+##
+## librsvgmm is free software: you can redistribute it and/or modify it
+## under the terms of the GNU Lesser General Public License as published
+## by the Free Software Foundation, either version 2.1 of the License,
+## or (at your option) any later version.
+##
+## librsvgmm is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+## See the GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+include $(top_srcdir)/librsvg/src/filelist.am
+include $(top_srcdir)/librsvg/librsvgmm/filelist.am
+
+book_name = librsvgmm-2.0
+doc_input = $(addprefix $(top_srcdir)/librsvg/librsvgmm/,$(files_built_h))
+
+dist_noinst_DATA = reference/doxytag_to_devhelp2.xsl
+doxytag_to_devhelp2 = $(srcdir)/reference/doxytag_to_devhelp2.xsl
+
+include $(top_srcdir)/build/doc-reference.am
diff --git a/doc/reference/.gitignore b/doc/reference/.gitignore
new file mode 100644
index 0000000..a245931
--- /dev/null
+++ b/doc/reference/.gitignore
@@ -0,0 +1,5 @@
+/Doxyfile
+/doxygen.log
+/librsvgmm-2.0.devhelp2
+/librsvgmm-2.0.tag
+/html
diff --git a/docs/reference/Doxyfile.in b/doc/reference/Doxyfile.in
similarity index 87%
rename from docs/reference/Doxyfile.in
rename to doc/reference/Doxyfile.in
index 3901dcf..db4f4ce 100644
--- a/docs/reference/Doxyfile.in
+++ b/doc/reference/Doxyfile.in
@@ -18,8 +18,6 @@ INLINE_INHERITED_MEMB  = NO
 FULL_PATH_NAMES        = YES
 STRIP_FROM_PATH        = "@abs_top_builddir@/librsvg/" \
                          "@abs_top_srcdir@/librsvg/" \
-                         "@abs_top_builddir@/" \
-                         "@abs_top_srcdir@/"
 STRIP_FROM_INC_PATH    = "@abs_top_builddir@/librsvg/" \
                          "@abs_top_srcdir@/librsvg/"
 SHORT_NAMES            = NO
@@ -29,13 +27,16 @@ MULTILINE_CPP_IS_BRIEF = NO
 INHERIT_DOCS           = YES
 SEPARATE_MEMBER_PAGES  = NO
 TAB_SIZE               = 8
-ALIASES                =
+ALIASES                = "newin2p4=" \
+                         "newin2p8=" \
+                         "newin2p14=" \
+                         "newin2p22="
 OPTIMIZE_OUTPUT_FOR_C  = NO
 OPTIMIZE_OUTPUT_JAVA   = NO
 OPTIMIZE_FOR_FORTRAN   = NO
 OPTIMIZE_OUTPUT_VHDL   = NO
 EXTENSION_MAPPING      =
-BUILTIN_STL_SUPPORT    = YES
+BUILTIN_STL_SUPPORT    = NO
 CPP_CLI_SUPPORT        = NO
 SIP_SUPPORT            = NO
 IDL_PROPERTY_SUPPORT   = YES
@@ -53,7 +54,7 @@ EXTRACT_LOCAL_CLASSES  = NO
 EXTRACT_LOCAL_METHODS  = NO
 EXTRACT_ANON_NSPACES   = NO
 HIDE_UNDOC_MEMBERS     = YES
-HIDE_UNDOC_CLASSES     = NO
+HIDE_UNDOC_CLASSES     = YES
 HIDE_FRIEND_COMPOUNDS  = YES
 HIDE_IN_BODY_DOCS      = YES
 INTERNAL_DOCS          = NO
@@ -71,7 +72,7 @@ GENERATE_BUGLIST       = NO
 GENERATE_DEPRECATEDLIST= YES
 ENABLED_SECTIONS       =
 MAX_INITIALIZER_LINES  = 2
-SHOW_USED_FILES        = NO
+SHOW_USED_FILES        = YES
 SHOW_DIRECTORIES       = NO
 SHOW_FILES             = NO
 SHOW_NAMESPACES        = YES
@@ -90,15 +91,24 @@ WARN_LOGFILE           = reference/doxygen.log
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = "@abs_top_builddir@/librsvg/librsvgmm" \
-                         "@abs_top_srcdir@/librsvg/librsvgmm"
+INPUT                  =
 INPUT_ENCODING         = UTF-8
-FILE_PATTERNS          = *.h
+FILE_PATTERNS          =
 RECURSIVE              = NO
 EXCLUDE                =
 EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = */wrap_init.h
-EXCLUDE_SYMBOLS        = _*
+EXCLUDE_PATTERNS       =
+EXCLUDE_SYMBOLS        = _* \
+                         RsvgDimensionData \
+                         RsvgPositionData \
+                         adaptor_trait \
+                         basic_filebuf \
+                         basic_streambuf \
+                         binary_function \
+                         char_traits \
+                         internal \
+                         pair \
+                         unary_function
 EXAMPLE_PATH           =
 EXAMPLE_PATTERNS       = *.cc \
                          *.h
@@ -192,7 +202,7 @@ MAN_LINKS              = NO
 #---------------------------------------------------------------------------
 # configuration options related to the XML output
 #---------------------------------------------------------------------------
-GENERATE_XML           = YES
+GENERATE_XML           = NO
 XML_OUTPUT             = xml
 XML_SCHEMA             =
 XML_DTD                =
@@ -214,24 +224,28 @@ PERLMOD_MAKEVAR_PREFIX =
 ENABLE_PREPROCESSING   = YES
 MACRO_EXPANSION        = YES
 EXPAND_ONLY_PREDEF     = YES
-SEARCH_INCLUDES        = NO
-INCLUDE_PATH           =
-INCLUDE_FILE_PATTERNS  =
-PREDEFINED             = DOXYGEN_SHOULD_SKIP_THIS \
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = "@abs_top_builddir@/librsvg" \
+                         "@abs_top_srcdir@/librsvg"
+INCLUDE_FILE_PATTERNS  = *.h
+PREDEFINED             = __cplusplus \
+                         DOXYGEN_SHOULD_SKIP_THIS \
+                         G_GNUC_CONST= \
                          GLIBMM_VFUNCS_ENABLED \
                          GLIBMM_PROPERTIES_ENABLED \
                          GLIBMM_EXCEPTIONS_ENABLED \
-                         GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
+                         GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED \
+                         GTKMM_ATKMM_ENABLED
 EXPAND_AS_DEFINED      =
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
 # Configuration::additions related to external references
 #---------------------------------------------------------------------------
-TAGFILES               =
-GENERATE_TAGFILE       = reference/librsvgmm_doxygen_tags
+TAGFILES               = $(DOXYGEN_TAGFILES)
+GENERATE_TAGFILE       = reference/librsvgmm-2.0.tag
 ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = @PERL_PATH@
+EXTERNAL_GROUPS        = NO
+PERL_PATH              =
 #---------------------------------------------------------------------------
 # Configuration options related to the dot tool
 #---------------------------------------------------------------------------
diff --git a/doc/reference/doxytag_to_devhelp2.xsl b/doc/reference/doxytag_to_devhelp2.xsl
new file mode 100644
index 0000000..5c51b52
--- /dev/null
+++ b/doc/reference/doxytag_to_devhelp2.xsl
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns="http://www.devhelp.net/book";
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+  <xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8"/>
+
+  <!-- these are parameters so that this stylesheet can be used by multiple
+  libraries.  Pass them in on the commandline -->
+  <xsl:param name="book_title"/>
+  <xsl:param name="book_name"/>
+  <xsl:param name="reference_prefix"/>
+
+  <xsl:template match="/">
+    <book title="{$book_title}" name="{$book_name}" base="{$reference_prefix}"
+          link="index.html" version="2" language="c++">
+      <chapters>
+        <sub name="Classes" link="classes.html">
+          <xsl:apply-templates select="tagfile/compound[ kind='class' or @kind='struct']" mode="sub">
+            <xsl:sort lang="en" case-order="upper-first" select="name"/>
+          </xsl:apply-templates>
+        </sub>
+        <sub name="Namespaces" link="namespaces.html">
+          <xsl:apply-templates select="tagfile/compound[ kind='namespace']" mode="sub">
+            <xsl:sort lang="en" case-order="upper-first" select="name"/>
+          </xsl:apply-templates>
+        </sub>
+      </chapters>
+      <functions>
+        <xsl:apply-templates select="tagfile/compound|tagfile/compound/member" mode="keyword">
+          <xsl:sort lang="en" select="concat(../name, '::', name)"/>
+        </xsl:apply-templates>
+      </functions>
+    </book>
+  </xsl:template>
+
+  <xsl:template match="compound" mode="sub">
+    <sub name="{name}" link="{filename}"/>
+  </xsl:template>
+
+  <xsl:template match="compound[ kind='class' or @kind='struct']" mode="keyword">
+    <keyword type="struct" name="{name}" link="{filename}"/>
+  </xsl:template>
+  <xsl:template match="member[ kind='function' or @kind='typedef' or @kind='variable']" mode="keyword">
+    <keyword type="{ kind}" xsl:use-attribute-sets="keyword-member"/>
+  </xsl:template>
+  <xsl:template match="member[ kind='enumeration']" mode="keyword">
+    <keyword type="enum" xsl:use-attribute-sets="keyword-member"/>
+  </xsl:template>
+  <xsl:template match="member[ kind='enumvalue' or @kind='define']" mode="keyword">
+    <keyword type="macro" xsl:use-attribute-sets="keyword-member"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="keyword"/>
+
+  <xsl:attribute-set name="keyword-member">
+    <xsl:attribute name="name">
+      <xsl:value-of select="concat(../name, '::', name)"/>
+    </xsl:attribute>
+    <xsl:attribute name="link">
+      <xsl:value-of select="concat(anchorfile, '#', anchor)"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+
+</xsl:stylesheet>
diff --git a/librsvg/librsvgmm/Makefile.am b/librsvg/librsvgmm/Makefile.am
index b470756..6c5d95a 100644
--- a/librsvg/librsvgmm/Makefile.am
+++ b/librsvg/librsvgmm/Makefile.am
@@ -15,21 +15,15 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-sublib_name       = librsvgmm
-sublib_libname    = librsvgmm-2.0
-sublib_libversion = $(LIBRSVGMM_SO_VERSION)
-sublib_namespace  = Rsvg
-sublib_cflags     = $(GTHREAD_CFLAGS) $(LIBRSVGMM_CFLAGS)
-sublib_topdir     = librsvg
-
-files_extra_cc =
-files_extra_h  = wrap_init.h
+lib_LTLIBRARIES = librsvgmm-2.0.la
 
-include $(top_srcdir)/tools/build_generated.am
+include $(srcdir)/../src/filelist.am
+include $(srcdir)/filelist.am
+include $(top_srcdir)/build/compile-binding.am
 
+AM_CPPFLAGS = $(binding_includes) $(binding_cppflags) $(GTHREAD_CFLAGS) $(LIBRSVGMM_CFLAGS)
 AM_CXXFLAGS = $(LIBRSVGMM_WXXFLAGS)
 
-lib_LTLIBRARIES = librsvgmm-2.0.la
-librsvgmm_2_0_la_SOURCES = $(files_all_cc)
-librsvgmm_2_0_la_LDFLAGS = $(common_ldflags)
+librsvgmm_2_0_la_SOURCES = $(binding_sources)
+librsvgmm_2_0_la_LDFLAGS = -version-info $(LIBRSVGMM_SO_VERSION)
 librsvgmm_2_0_la_LIBADD  = $(LIBRSVGMM_LIBS)
diff --git a/librsvg/librsvgmm/filelist.am b/librsvg/librsvgmm/filelist.am
new file mode 100644
index 0000000..3a69e48
--- /dev/null
+++ b/librsvg/librsvgmm/filelist.am
@@ -0,0 +1,7 @@
+## This file is part of librsvgmm.
+
+files_built_cc	= $(files_hg:.hg=.cc) wrap_init.cc
+files_built_h	= $(files_hg:.hg=.h)
+files_built_ph	= $(files_hg:%.hg=private/%_p.h)
+files_extra_cc	=
+files_extra_h	= wrap_init.h
diff --git a/librsvg/src/Makefile.am b/librsvg/src/Makefile.am
index c816a56..565bb80 100644
--- a/librsvg/src/Makefile.am
+++ b/librsvg/src/Makefile.am
@@ -15,16 +15,8 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-sublib_name      = librsvgmm
-sublib_namespace = Rsvg
-sublib_parentdir = librsvgmm
+binding_name	= librsvgmm
+wrap_init_flags = --namespace=Rsvg --parent_dir=librsvgmm
 
-files_defs =			\
-	librsvg.defs		\
-	librsvg_enum.defs	\
-	librsvg_extra.defs	\
-	librsvg_method.defs	\
-	librsvg_docs.xml	\
-	librsvg_docs_override.xml
-
-include $(top_srcdir)/tools/build_gmmproc.am
+include $(srcdir)/filelist.am
+include $(top_srcdir)/build/generate-binding.am
diff --git a/librsvg/src/filelist.am b/librsvg/src/filelist.am
index 1bda3e6..99eb06f 100644
--- a/librsvg/src/filelist.am
+++ b/librsvg/src/filelist.am
@@ -1 +1,12 @@
-files_hg = rsvg.hg
+## This file is part of librsvgmm.
+
+files_defs =			\
+	librsvg.defs		\
+	librsvg_enum.defs	\
+	librsvg_extra.defs	\
+	librsvg_method.defs	\
+	librsvg_docs.xml	\
+	librsvg_docs_override.xml
+
+files_hg  = rsvg.hg
+files_ccg = $(files_hg:%.hg=%.ccg)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 2ec87ae..fad7212 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -19,12 +19,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 include $(srcdir)/m4/filelist.am
 
-dist_noinst_DATA =		\
-	build_generated.am	\
-	build_gmmproc.am	\
-	build_library.am	\
-	m4/filelist.am		\
-	$(files_tools_m4:%.m4=m4/%.m4)
+dist_noinst_DATA = $(files_tools_m4:%.m4=m4/%.m4)
 
 noinst_PROGRAMS = extradefs/generate_extra_defs
 extradefs_generate_extra_defs_SOURCES = extradefs/generate_extra_defs_librsvg.cc
diff --git a/tools/m4/filelist.am b/tools/m4/filelist.am
index 5186c77..e00e0c4 100644
--- a/tools/m4/filelist.am
+++ b/tools/m4/filelist.am
@@ -1 +1,3 @@
+## This file is part of librsvgmm.
+
 files_tools_m4 = convert.m4 convert_librsvg.m4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]