--- misc.c.orig	2008-02-24 15:54:21.000000000 +0100
+++ misc.c	2008-03-29 12:43:31.000000000 +0100
@@ -19,7 +19,16 @@
 #endif
 
 #ifndef HAVE_CANONICALIZE_FILE_NAME /* have safe GNU ext? */
-# error "missing safe realpath()"
+#include <sys/param.h>
+#include <stdlib.h>
+static char * malloc_realpath(const char *pathname, char *resolved_path)
+{
+    char *buf = resolved_path;
+    if (buf == NULL) buf = malloc(PATH_MAX);
+    if (buf) return realpath(pathname, buf);
+    return NULL;
+}
+#define realpath malloc_realpath
 #endif
 
 #ifdef HAVE_STRSIGNAL
