[gtk-doc-stub] Add --srcdir argument to gtkdocize



commit 63c95e24cf8b25c0f84602b21128e47233f14225
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jun 6 12:38:22 2016 +0100

    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

 gtkdocize.in |   25 +++++++++++++++++++++++--
 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


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