From f445cd7e5f0cdc4928586cfde1cd738105121867 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Tue, 26 Mar 2019 17:19:41 +0100 Subject: [PATCH] build: conditional include adg-canvas.h adg-canvas.h is created at configure time from a template. On in-place builds (i.e. where $srcdir is .), the *.h glob of docs/adg/Makefile.am properly includes that file. On VPATH builds instead, that file must be manually included in EXTRA_HFILE. It is required to include any file once (and only once) otherwise gtk-doc will start barking and bad things will happen. --- configure.ac | 8 ++++++++ docs/adg/Makefile.am | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8910e491..14b67447 100644 --- a/configure.ac +++ b/configure.ac @@ -416,8 +416,16 @@ AM_COND_IF([HAVE_GTK3], AC_SUBST([ADG_CFLAGS]) AC_SUBST([ADG_LIBS]) +# Path to external dependencies, used by gtkdoc-fixxref AC_SUBST([EXTRADIR]) +# On VPATH builds, adg-canvas.h is created in the builddir so it must be +# manually included by gtkdoc. On in-place builds, this is not needed. +AS_IF([test "x${srcdir}" = "x."], + [ADG_CANVAS_H=], + [ADG_CANVAS_H='$(top_builddir)/src/adg/adg-canvas.h']) +AC_SUBST([ADG_CANVAS_H]) + # Generation diff --git a/docs/adg/Makefile.am b/docs/adg/Makefile.am index 66e4d379..19a1982d 100644 --- a/docs/adg/Makefile.am +++ b/docs/adg/Makefile.am @@ -14,7 +14,7 @@ MKHTML_OPTIONS= FIXXREF_OPTIONS= --extra-dir=$(top_builddir)/docs/cpml/html \ $(EXTRADIR) HFILE_GLOB= $(DOC_SOURCE_DIR)/*.h -EXTRA_HFILES= $(top_builddir)/src/adg/adg-canvas.h +EXTRA_HFILES= $(ADG_CANVAS_H) CFILE_GLOB= $(DOC_SOURCE_DIR)/*.c IGNORE_HFILES= adg.h \ adg-adim-private.h \ -- 2.11.4.GIT