3 progname
=`echo "$0" | sed 's%^.*/%%'`
10 datarootdir
=@datarootdir@
21 usage: $progname [ --copy ] [ --docdir DIR ] [ --flavour {legacy|legacy-flat|no-tmpl|no-tmpl-flat} ]"
23 # detect configure script
25 if test -f configure.ac
; then
26 configure
=configure.ac
27 elif test -f configure.
in; then
28 configure
=configure.
in
33 # check configure script for GTK_DOC_CHECK macro
34 no_gtk_doc_check_found
=0
35 if test $no_configure_found -eq 0; then
36 macro
=`grep '^GTK_DOC_CHECK' $configure 2>/dev/null`
37 if test $?
-eq 0; then
38 # GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
39 params
=`echo $macro | sed -e 's/^GTK_DOC_CHECK(\ *\(.*\))/\1/'`
40 if echo $params |
grep -q '^.*\,\ *\[\{0,1\}'; then
41 extra_options
=`echo $params | sed -e 's/^.*\,\ *\[\{0,1\}\([^]]*\)\]\{0,1\}\ *$/\1/'`
42 #echo >&2 "DEBUG: adding extra options [$extra_options] to [$*]"
43 set - $
* $GTKDOCIZE_FLAGS $extra_options
45 set - $
* $GTKDOCIZE_FLAGS
48 no_gtk_doc_check_found
=1;
52 while test $# -gt 0; do
53 #echo >&2 "DEBUG: parsing args [$1]";
59 echo "$PROGRAM ($PACKAGE) $VERSION"
69 docdir
=`expr "X$1" : '[^=]*=\(.*\)'`
76 flavour
=`expr "X$1" : '[^=]*=\(.*\)'`
79 echo "$progname: unrecognised option '$1'" 1>&2
83 echo "$progname: too many arguments" 1>&2
93 makefile
=gtk-doc.flat.
make
96 makefile
=gtk-doc.notmpl.
make
99 makefile
=gtk-doc.notmpl-flat.
make
102 echo "$progname: invalid value for --flavour" 1>&2
107 if test $no_configure_found -eq 1; then
108 echo "$progname: neither configure.ac nor configure.in exist" 1>&2
111 if test $no_gtk_doc_check_found -eq 1; then
112 echo "$progname: GTK_DOC_CHECK not called in $configure" 1>&2
116 # If the AC_CONFIG_MACRO_DIR() macro is used, copy gtk-doc.m4 from our
117 # prefix to that directory. This makes sure that the M4 macro used
118 # matches the the automake fragment.
119 # If AC_CONFIG_MACRO_DIR is not used, the macro won't be copied, and
120 # the correct flags must be passed to aclocal for it to find the macro.
121 m4dir
=`cat "$configure" | grep '^AC_CONFIG_MACRO_DIR' | sed -n -e 's/AC_CONFIG_MACRO_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
122 if test -n "$m4dir"; then
123 rm -f $m4dir/gtk-doc.
m4
124 if test "$copy" = yes; then
125 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
128 ln -sf $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
129 cp -f $datadir/aclocal
/gtk-doc.
m4 $m4dir/ ||
134 rm -f $docdir/gtk-doc.
make
135 if test "$copy" = yes; then
136 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
139 ln -sf $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||
140 cp -f $datadir/gtk-doc
/data
/$makefile $docdir/gtk-doc.
make ||