summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-06-06 12:38:22 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2016-06-06 12:38:22 +0100
commit63c95e24cf8b25c0f84602b21128e47233f14225 (patch)
treefc855302669586043bc774f5c4ac9634c12723cf
parent1dea266593edb766d6d898c79451ef193eb17cfa (diff)
downloadgtk-doc-stub-63c95e24cf8b25c0f84602b21128e47233f14225.tar.gz
Add --srcdir argument to gtkdocize
Since commit 1401aebc625dd1c7c39457d3455dce3019ded0be gtkdocize in gtk-doc, gtkdocize supports a --srcdir argument, which allows to specify the source directory for non-srcdir builds. The gtkdocize in gtk-doc-stub should support the same argument. See also: https://bugzilla.gnome.org/show_bug.cgi?id=692367
-rw-r--r--gtkdocize.in25
1 files changed, 23 insertions, 2 deletions
diff --git a/gtkdocize.in b/gtkdocize.in
index b33fa31..874371c 100644
--- a/gtkdocize.in
+++ b/gtkdocize.in
@@ -11,14 +11,35 @@ datarootdir=@datarootdir@
datadir=@datadir@
# options
-docdir=.
copy=no
makefile=gtk-doc.make
flavour=legacy
# mini help
usage="\
-usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|legacy-flat|no-tmpl|no-tmpl-flat} ]"
+usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|legacy-flat|no-tmpl|no-tmpl-flat} ] [ --srcdir DIR ]"
+
+# Find the srcdir early (and ignore a srcdir set in configure).
+# https://bugzilla.gnome.org/show_bug.cgi?id=707426
+args="$*"
+while test $# -gt 0; do
+ case "$1" in
+ --srcdir)
+ shift
+ srcdir="$1"
+ shift ;;
+ --srcdir=*)
+ srcdir=`expr "X$1" : '[^=]*=\(.*\)'`
+ shift ;;
+ *)
+ shift ;;
+ esac
+done
+set - $args
+
+# assume working directory if srcdir is not set
+test "$srcdir" || srcdir=.
+test "$docdir" || docdir="$srcdir"
# detect configure script
no_configure_found=0