3 progname
=`echo "$0" | sed 's%^.*/%%'`
10 datarootdir
=@datarootdir@
20 usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|legacy-flat|no-tmpl|no-tmpl-flat} ] [ --srcdir DIR ]"
22 # Find the srcdir early (and ignore a srcdir set in configure).
23 # https://bugzilla.gnome.org/show_bug.cgi?id=707426
25 while test $# -gt 0; do
32 srcdir
=`expr "X$1" : '[^=]*=\(.*\)'`
40 # assume working directory if srcdir is not set
41 test "$srcdir" || srcdir
=.
42 test "$docdir" || docdir
="$srcdir"
44 # detect configure script
46 if test -f "$srcdir"/configure.ac
; then
47 configure
="$srcdir"/configure.ac
48 elif test -f "$srcdir"/configure.
in; then
49 configure
="$srcdir"/configure.
in
54 # check configure script for GTK_DOC_CHECK macro
55 no_gtk_doc_check_found
=0
56 if test $no_configure_found -eq 0; then
57 macro
=`grep '^GTK_DOC_CHECK' $configure 2>/dev/null`
58 if test $?
-eq 0; then
59 # GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
60 params
=`echo $macro | sed -e 's/^GTK_DOC_CHECK(\ *\(.*\))/\1/'`
61 if echo $params |
grep -q '^.*\,\ *\[\{0,1\}'; then
62 extra_options
=`echo $params | sed -e 's/^.*\,\ *\[\{0,1\}\([^]]*\)\]\{0,1\}\ *$/\1/'`
63 #echo >&2 "DEBUG: adding extra options [$extra_options] to [$*]"
64 set - $
* $GTKDOCIZE_FLAGS $extra_options
66 set - $
* $GTKDOCIZE_FLAGS
69 no_gtk_doc_check_found
=1;
73 while test $# -gt 0; do
74 #echo >&2 "DEBUG: parsing args [$1]";
80 echo "$PROGRAM ($PACKAGE) $VERSION"
90 docdir
=`expr "X$1" : '[^=]*=\(.*\)'`
97 flavour
=`expr "X$1" : '[^=]*=\(.*\)'`
101 # srcdir was set earlier.
104 # srcdir was set earlier.
107 echo "$progname: unrecognised option '$1'" 1>&2
111 echo "$progname: too many arguments" 1>&2
121 makefile
=gtk-doc.flat.
make
124 makefile
=gtk-doc.notmpl.
make
127 makefile
=gtk-doc.notmpl-flat.
make
130 echo "$progname: invalid value for --flavour" 1>&2
135 if test $no_configure_found -eq 1; then
136 echo "$progname: neither configure.ac nor configure.in exist" 1>&2
139 if test $no_gtk_doc_check_found -eq 1; then
140 echo "$progname: GTK_DOC_CHECK not called in $configure" 1>&2
144 # If the AC_CONFIG_MACRO_DIR() macro is used, copy gtk-doc.m4 from our
145 # prefix to that directory. This makes sure that the M4 macro used
146 # matches the the automake fragment.
147 # If AC_CONFIG_MACRO_DIR is not used, the macro won't be copied, and
148 # the correct flags must be passed to aclocal for it to find the macro.
149 m4dir
="$srcdir/`cat "$configure" | grep '^AC_CONFIG_MACRO_DIR' | sed -n -e 's/AC_CONFIG_MACRO_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`"
150 if test -n "$m4dir"; then
151 rm -f $m4dir/gtk-doc.
m4
152 if test "$copy" = yes; then
153 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
156 ln -sf $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
157 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
162 rm -f $docdir/gtk-doc.
make
163 if test "$copy" = yes; then
164 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
167 ln -sf $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
168 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||