Index: gtkdoc-mkhtml.in
===================================================================
--- gtkdoc-mkhtml.in	(revision 652)
+++ gtkdoc-mkhtml.in	(working copy)
@@ -9,10 +9,12 @@
 # parse options, ignore unknown options for future extensions
 
 searchpath=
+uninstalled=no
 while true; do
     case "X$1" in
         X--version) echo "@VERSION@"; exit 0;;
         X--help) echo "$usage"; exit 0;;
+        X--uninstalled) uninstalled=yes;;
         X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
         X--*) shift;;
         X*) break;;
@@ -29,17 +31,14 @@
 document=$1
 shift
 
-# FIXME: this is a hack to detect uninstalled
-if test "x$0" = "x@prefix@/bin/gtkdoc-mkhtml" ; then
-      #echo "installed"
+if test $uninstalled = yes; then
+      # this does not work from buiddir!=srcdir
+      gtkdocdir=`dirname $0`
+else
       # the first two are needed to resolve datadir
       prefix=@prefix@
       datarootdir=@datarootdir@
       gtkdocdir=@datadir@/gtk-doc/data
-else
-      #echo "uninstalled"
-      # this does not work from buiddir!=srcdir
-      gtkdocdir=`dirname $0`
 fi
 
 if head -n 1 $document | grep "<?xml" > /dev/null; then
