Index: gtkdoc-fixxref.in
===================================================================
--- gtkdoc-fixxref.in	(Revision 434)
+++ gtkdoc-fixxref.in	(Arbeitskopie)
@@ -67,6 +67,11 @@
 # This contains all the entities and their relative URLs.
 my %Links;
 
+
+$HTML_DIR =~ m%(.*?)/share/gtk-doc/html%;
+my $path_prefix=$1;
+#print "Path prefix: $path_prefix\n";
+
 my $dir;
 
 # We scan the directory containing GLib and any directories in GNOME2_PATH
@@ -91,11 +96,13 @@
 
 #print "Scanning HTML_DIR directory: $HTML_DIR\n";
 &ScanIndices ($HTML_DIR, 0);
+
+# FIXME: we should remove duplicate dirs here
 foreach my $dir (@EXTRA_DIRS) {
 #    print "Scanning EXTRA_DIR directory: $dir\n";
-    # If the --extra-dir option is an absolute directory, we use absolute
-    # directories for the links. Support Unix '/' or Win32 'C:\'.
-    if ($dir =~ m%^(/|[A-Z]:\\)%) {
+    # If the --extra-dir option is not sharing the same prefix as the target
+    # directory of the docs, we need to use absolute directories for the links
+    if ($dir !~ m%$path_prefix/(.*)%) {
         &ScanIndices ($dir, 1);
     } else {
         &ScanIndices ($dir, 0);
