Index: gtkdoc-mkdb.in
===================================================================
--- gtkdoc-mkdb.in	(Revision 441)
+++ gtkdoc-mkdb.in	(Arbeitskopie)
@@ -1300,8 +1300,8 @@
 
 	# allow alphanumerics, '_', '[' & ']' in param names
 	# Try to match a standard parameter (keep in sync with gtkdoc-mktmpl)
-	#                                $1                                                                              $2                         $3                                                       $4       $5
-	} elsif ($declaration =~ s/^\s*((?:G_CONST_RETURN|G_GNUC_UNUSED|unsigned|signed|long|short|volatile|const)\s+)*((?:struct|enum)?\s*\w+)\s*((?:(?:const|restrict)?\s*\*?\s*(?:const|restrict)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) {
+	#                                $1                                                                              $2                             $3                                                           $4       $5
+	} elsif ($declaration =~ s/^\s*((?:G_CONST_RETURN|G_GNUC_UNUSED|unsigned|signed|long|short|volatile|const)\s+)*((?:struct\b|enum\b)?\s*\w+)\s*((?:(?:const|restrict)?\s*\*?\s*(?:const\b|restrict\b)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) {
 	    my $pre	= defined($1) ? $1 : "";
 	    my $type	= $2;
 	    my $ptr	= defined($3) ? $3 : "";
@@ -1338,9 +1338,9 @@
 	    }
 
 	# Try to match parameters which are functions (keep in sync with gtkdoc-mktmpl)
-	#                            $1                                       $2          $3      $4                      $5                    $7             $8
-	} elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict)?\s*(const\s+)?\(\s*\*+\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
-	    my $mod1 = defined($1) ? $1 : "";
+	#                              $1                                       $2          $3      $4                        $5                    $7             $8
+	} elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict\b)?\s*(const\s+)?\(\s*\*+\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
+ 	    my $mod1 = defined($1) ? $1 : "";
 	    if (defined($2)) { $mod1 .= $2; }
 	    my $type = $3;
 	    my $ptr1 = $4;
@@ -2468,7 +2468,7 @@
 	    $desc .= MakeIndexterms($symbol);
 	    $desc .= "<programlisting>";
 
-	    $SignalReturns[$i] =~ m/\s*(const\s*)?(\w+)\s*(\**)/;
+	    $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/;
 	    my $type_modifier = defined($1) ? $1 : "";
 	    my $type = $2;
 	    my $pointer = $3;
Index: gtkdoc-scan.in
===================================================================
--- gtkdoc-scan.in	(Revision 434)
+++ gtkdoc-scan.in	(Arbeitskopie)
@@ -470,7 +470,7 @@
 		$decl = $';
 		if ($previous_line !~ m/^\s*G_INLINE_FUNC/
 		    && $previous_line !~ m/^\s*static\s+/) {
-		    if ($previous_line =~ m/^\s*(?:\b(?:extern|${IGNORE_DECORATORS})\b\s*)*((?:const\s*|G_CONST_RETURN\s*|unsigned\s*|enum\s+)?\w+)(\s*\*+)?\s*$/) {
+		    if ($previous_line =~ m/^\s*(?:\b(?:extern|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|enum\s+)?\w+)(\s*\*+)?\s*$/) {
 			$ret_type = $1;
 			if (defined ($2)) { $ret_type .= " $2"; }
 #			print "Function: $symbol, Returns: $ret_type\n";
Index: autogen.sh
===================================================================
--- autogen.sh	(Revision 434)
+++ autogen.sh	(Arbeitskopie)
@@ -67,11 +67,13 @@
 # optionally feature autoheader
 #(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
 
+libtoolize --copy --force
+
 $AUTOMAKE --add-missing $am_opt || exit $?
 
 cd "$THEDIR"
 
 $srcdir/configure --enable-maintainer-mode "$@" || exit $?
 
-echo 
+echo
 echo "Now type 'make install' to install $PROJECT."
Index: gtkdoc-common.pl.in
===================================================================
--- gtkdoc-common.pl.in	(Revision 434)
+++ gtkdoc-common.pl.in	(Arbeitskopie)
@@ -204,7 +204,7 @@
 	        # identifier, and be followed by any number of pairs of
 	        # brackets or a bit field specifier.
 	        # e.g. *foo, ***bar, *baz[12][23], foo : 25.
-	        if ($n =~ m/^\s* (\**(?:\s*restrict)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) {
+	        if ($n =~ m/^\s* (\**(?:\s*restrict\b)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) {
 		    my $ptrs = $1;
 		    my $name = $2;
 		    my $array = defined($3) ? $3 : "";
Index: gtkdoc-mktmpl.in
===================================================================
--- gtkdoc-mktmpl.in	(Revision 441)
+++ gtkdoc-mktmpl.in	(Arbeitskopie)
@@ -394,8 +394,8 @@
 					 $template_exists, 1, "");
 
 	    # Try to match a standard parameter (keep in sync with gtkdoc-mkdb)
-	    #                                $1                                                                              $2                         $3                                                       $4       $5
-	    } elsif ($declaration =~ s/^\s*((?:G_CONST_RETURN|G_GNUC_UNUSED|unsigned|signed|long|short|volatile|const)\s+)*((?:struct|enum)?\s*\w+)\s*((?:(?:const|restrict)?\s*\*?\s*(?:const|restrict)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) {
+	    #                                $1                                                                              $2                             $3                                                           $4       $5
+	    } elsif ($declaration =~ s/^\s*((?:G_CONST_RETURN|G_GNUC_UNUSED|unsigned|signed|long|short|volatile|const)\s+)*((?:struct\b|enum\b)?\s*\w+)\s*((?:(?:const|restrict)?\s*\*?\s*(?:const\b|restrict\b)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) {
  		my $pre		= defined($1) ? $1 : "";
  		my $type	= $2;
  		my $ptr		= defined($3) ? $3 : "";
@@ -422,8 +422,8 @@
 					 "");
 
 	    # Try to match parameters which are functions (keep in sync with gtkdoc-mkdb)
-	    #                            $1                                       $2          $3      $4                      $5                    $7             $8
-	    } elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict)?\s*(const\s+)?\(\s*\*+\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
+	    #                              $1                                       $2          $3      $4                      $5                    $7             $8
+	    } elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict\b)?\s*(const\s+)?\(\s*\*+\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
 	        $name = $6;
 		$output .= &OutputParam ($symbol, $name, $template_exists, 1,
 					 "");
Index: configure.in
===================================================================
--- configure.in	(Revision 434)
+++ configure.in	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 AC_ISC_POSIX
 AC_PROG_CC
+AC_PROG_LIBTOOL
 
 # Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
 PKG_PROG_PKG_CONFIG([0.19])
@@ -108,9 +109,25 @@
 SCROLLKEEPER_BUILD_REQUIRED=0.3.5
 AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED)
 
-AC_CONFIG_FILES([Makefile 
+# if glib is available we can enable the tests
+PKG_CHECK_MODULES(TEST_DEPS, glib-2.0 >= 2.2.0 gobject-2.0  >= 2.6.0, [
+    AM_CONDITIONAL(BUILD_TESTS, true)
+    AC_DEFINE(BUILD_TESTS, [1], [Define to 1 if we build the tests])
+    AC_PROG_LIBTOOL
+    AM_CONDITIONAL(ENABLE_GTK_DOC, true)
+    AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
+  ],[
+    AM_CONDITIONAL(BUILD_TESTS, false)
+  ]
+)
+
+glib_prefix="`pkg-config --variable=prefix glib-2.0`"
+AC_SUBST(glib_prefix)
+
+
+AC_CONFIG_FILES([Makefile
 gtk-doc.pc
-gtk-doc.dsl 
+gtk-doc.dsl
 gtk-doc.spec
 gtk-doc.cat
 gtkdoc-common.pl
@@ -118,6 +135,10 @@
 help/manual/Makefile
 help/manual/C/Makefile
 help/manual/C/gtk-doc-manual-C.omf
+tests/Makefile
+tests/suite1/Makefile
+tests/suite1/src/Makefile
+tests/suite1/docs/Makefile
 ])
 
 dnl run chmod on these after parsing them.
Index: Makefile.am
===================================================================
--- Makefile.am	(Revision 434)
+++ Makefile.am	(Arbeitskopie)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = help
+SUBDIRS = help tests
 
 bin_SCRIPTS = \
 	gtkdoc-scanobj  \
