--- gtk-doc-1.18.orig/tests/tools.sh.in	2011-06-17 03:39:37.000000000 -0500
+++ gtk-doc-1.18/tests/tools.sh.in	2012-01-18 17:19:32.691835290 -0600
@@ -12,29 +12,30 @@
 # test perl scripts
 for file in gtkdoc-check gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mktmpl gtkdoc-rebase gtkdoc-scan gtkdoc-scangobj gtkdoc-scanobj ; do
   @PERL@ -cwT `which $file`
-  if test $? = 1 ; then failed=$(($failed + 1)); fi
-  tested=$(($tested + 1))
+  if test $? = 1 ; then failed=`expr $failed + 1`; fi
+  tested=`expr $tested + 1`
 done
 
 
 # test shell scripts
 for file in gtkdoc-mkhtml gtkdoc-mkman gtkdoc-mkpdf gtkdocize; do
   sh -n `which $file`
-  if test $? != 0 ; then failed=$(($failed + 1)); fi
-  tested=$(($tested + 1))
+  if test $? != 0 ; then failed=`expr $failed + 1`; fi
+  tested=`expr $tested + 1`
 done
 
 
 # test xsl files
 for file in $ABS_TOP_SRCDIR/*.xsl; do
   xmllint --noout --noent $file
-  if test $? != 0 ; then failed=$(($failed + 1)); fi
-  tested=$(($tested + 1))
+  if test $? != 0 ; then failed=`expr $failed + 1`; fi
+  tested=`expr $tested + 1`
 done
 
 # summary
+successes=`expr $tested - $failed`
 
-rate=$((100*($tested - $failed)/$tested));
+rate=`expr 100 \* $successes / $tested`;
 echo "$rate %: Checks $tested, Failures: $failed"
 
 test $failed = 0
--- gtk-doc-1.18.orig/tests/fail.sh	2011-06-17 03:39:37.000000000 -0500
+++ gtk-doc-1.18/tests/fail.sh	2012-01-18 17:30:48.351667464 -0600
@@ -14,26 +14,27 @@
 # check missing section description
 # we can't just check for a missing "tester_nodocs" entry
 grep >/dev/null "tester_nodocs:Long_Description" $DOC_MODULE-undocumented.txt
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $? = 1 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 # check missing section long description
 grep >/dev/null "tester_nolongdesc:Long_Description" $DOC_MODULE-undocumented.txt
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $? = 1 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 # check missing section short description
 grep >/dev/null "tester_noshortdesc:Short_Description" $DOC_MODULE-undocumented.txt
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $? = 1 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 # check enums
 grep >/dev/null "EnumNoItemDocs (<items>)" $DOC_MODULE-undocumented.txt
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $? = 1 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 # summary
-rate=$((100*($tested - $failed)/$tested));
+successes=`expr $tested - $failed`
+rate=`expr 100 \* $successes / $tested`;
 echo "$rate %: Checks $tested, Failures: $failed"
 
 test $failed = 0
--- gtk-doc-1.18.orig/tests/sanity.sh	2011-06-17 03:39:37.000000000 -0500
+++ gtk-doc-1.18/tests/sanity.sh	2012-01-18 17:35:46.228837919 -0600
@@ -13,24 +13,24 @@
 for path in $dir/*/docs*/html; do
   if test ! -s $path/index.html ; then
     echo 1>&2 "no or empty $path/index.html"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
   if test ! -s $path/index.sgml ; then
     echo 1>&2 "no or empty $path/index.sgml"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
   if test ! -s $path/home.png ; then
     echo 1>&2 "no or empty $path/home.png"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
   file=`echo $path/*.devhelp2`
   if test ! -s $file ; then
     echo 1>&2 "no or empty $file"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
 done
-if test $nok -gt 0 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $nok -gt 0 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 
 # check online/anchor tags
@@ -39,16 +39,16 @@
   grep >/dev/null "<ONLINE href=" $file
   if test $? = 1 ; then
     echo 1>&2 "missing ONLINE reference in $file"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
   grep >/dev/null "<ANCHOR id=" $file
   if test $? = 1 ; then
     echo 1>&2 "missing ANCHOR reference in $file"
-    nok=$(($nok + 1)); break;
+    nok=`expr $nok + 1`; break;
   fi
 done
-if test $nok -gt 0 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $nok -gt 0 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 
 # check validity of generated xml files
@@ -57,11 +57,11 @@
   xmllint --noout --noent $file
   if test $? != 0 ; then
     echo 1>&2 "xml validity check failed for $file"
-    nok=$(($nok + 1));
+    nok=`expr $nok + 1`;
   fi
 done
-if test $nok -gt 0 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $nok -gt 0 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 
 # check validity of generated sgml files
@@ -70,15 +70,16 @@
   xmllint --noout --noent $file
   if test $? != 0 ; then
     echo 1>&2 "sgml validity check failed for $file"
-    nok=$(($nok + 1));
+    nok=`expr $nok + 1`;
   fi
 done
-if test $nok -gt 0 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+if test $nok -gt 0 ; then failed=`expr $failed + 1`; fi
+tested=`expr $tested + 1`
 
 
 # summary
-rate=$((100*($tested - $failed)/$tested));
+successes=`expr $tested - $failed`
+rate=`expr 100 \* $successes / $tested`;
 echo "$rate %: Checks $tested, Failures: $failed"
 
 test $failed = 0
--- gtk-doc-1.18.orig/gtkdoc-mkhtml.in	2011-06-17 03:39:37.000000000 -0500
+++ gtk-doc-1.18/gtkdoc-mkhtml.in	2012-01-18 17:37:35.326725915 -0600
@@ -51,9 +51,10 @@
 if test $uninstalled = yes; then
     # this does not work from buiddir!=srcdir
     gtkdocdir=`dirname $0`
-    if test ! -e $gtkdocdir/gtk-doc.xsl; then
+	# traditional Bourne shells may not support -e here, use -f
+    if test ! -f $gtkdocdir/gtk-doc.xsl; then
         # try to src dir (set from makefiles) too
-        if test -e $ABS_TOP_SRCDIR/gtk-doc.xsl; then
+        if test -f $ABS_TOP_SRCDIR/gtk-doc.xsl; then
             gtkdocdir=$ABS_TOP_SRCDIR
         fi
     fi
