Index: gtkdoc-scan.in
===================================================================
--- gtkdoc-scan.in	(revision 452)
+++ gtkdoc-scan.in	(working copy)
@@ -38,6 +38,7 @@
 
 use strict;
 use Getopt::Long;
+use Cwd qw(realpath);
 
 unshift @INC, '@PACKAGE_DATA_DIR@';
 require "gtkdoc-common.pl";
@@ -134,6 +135,9 @@
 my $object_list = "";
 my $file;
 
+# Remembers already scanned source files.
+my %HeadersSeen;
+
 # The header files to scan are passed in as command-line args.
 for $file (@ARGV) {
     &ScanHeader ($file, \$object_list, \$main_list);
@@ -221,7 +225,13 @@
 
 sub ScanHeader {
     my ($input_file, $object_list, $main_list) = @_;
+    my $abs_input_file = realpath $input_file;
+    if (defined $HeadersSeen{$abs_input_file}) {
+#	print "DEBUG: Duplicite $input_file ignored\n";
+	return;
+    }
 #    print "DEBUG: Scanning $input_file\n";
+    $HeadersSeen{$abs_input_file} = 1;
 
     my $list = "";		  # Holds the resulting list of declarations.
     my ($in_comment) = 0;	  # True if we are in a comment.
Index: gtkdoc-mkdb.in
===================================================================
--- gtkdoc-mkdb.in	(revision 452)
+++ gtkdoc-mkdb.in	(working copy)
@@ -31,6 +31,7 @@
 
 use strict;
 use Getopt::Long;
+use Cwd qw(realpath);
 
 unshift @INC, '@PACKAGE_DATA_DIR@';
 require "gtkdoc-common.pl";
@@ -220,6 +221,9 @@
 # holds the symbols which are mentioned in $MODULE-sections.txt
 my %KnownSymbols;
 
+# Remembers already scanned source files.
+my %SourcesSeen;
+
 # Standard C preprocessor directives, which we ignore for '#' abbreviations.
 my %PreProcessorDirectives;
 $PreProcessorDirectives{"assert"} = 1;
@@ -2818,8 +2822,15 @@
     if ($IGNORE_FILES =~ m/(\s|^)\Q${basename}\E(\s|$)/) {
 	return;
     }
+
+    my $abs_input_file = realpath $file;
+    if (defined $SourcesSeen{$abs_input_file}) {
+#	print "DEBUG: Duplicite $file ignored\n";
+	return;
+    }
     
 #    print "DEBUG: Scanning $file\n";
+    $SourcesSeen{$abs_input_file} = 1;
 
     open (SRCFILE, $file)
 	|| die "Can't open $file: $!";
