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
118 legacy-flat|no-tmpl-flat
)
119 makefile
=gtk-doc.flat.
make
124 echo "$progname: invalid value for --flavour" 1>&2
129 if test $no_configure_found -eq 1; then
130 echo "$progname: neither configure.ac nor configure.in exist" 1>&2
133 if test $no_gtk_doc_check_found -eq 1; then
134 echo "$progname: GTK_DOC_CHECK not called in $configure" 1>&2
138 # If the AC_CONFIG_MACRO_DIR() macro is used, copy gtk-doc.m4 from our
139 # prefix to that directory. This makes sure that the M4 macro used
140 # matches the the automake fragment.
141 # If AC_CONFIG_MACRO_DIR is not used, the macro won't be copied, and
142 # the correct flags must be passed to aclocal for it to find the macro.
143 m4dir
="$srcdir"/`autoconf 2>/dev/null --trace 'AC_CONFIG_MACRO_DIR:$1' "$configure"`
144 if test -n "$m4dir"; then
145 rm -f $m4dir/gtk-doc.
m4
146 if test "$copy" = yes; then
147 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
150 ln -sf $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
151 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
156 rm -f $docdir/gtk-doc.
make
157 if test "$copy" = yes; then
158 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
161 ln -sf $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
162 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||