Index: xen-4.2.0/qemu/xen-hooks.mak
===================================================================
--- xen-4.2.0.orig/qemu/xen-hooks.mak	2012-11-07 17:30:40.000000000 +0100
+++ xen-4.2.0/qemu/xen-hooks.mak	2012-11-13 10:22:28.852631118 +0100
@@ -20,7 +20,7 @@
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 
-LDFLAGS := $(CFLAGS) $(LDFLAGS)
+LDFLAGS := $(CFLAGS) $(LDFLAGS) -Wl,-rpath,'$${ORIGIN}/../lib'
 
 OBJS += piix4acpi.o
 OBJS += xenstore.o
@@ -79,7 +79,6 @@
 
 EXESUF=-xen
 
-datadir := $(subst qemu,xen/qemu,$(datadir))
 docdir :=  $(subst qemu,xen/qemu,$(docdir))
 mandir :=  $(subst share/man,share/xen/man,$(mandir))
 
Index: xen-4.2.0/qemu/xen-setup
===================================================================
--- xen-4.2.0.orig/qemu/xen-setup	2012-11-07 17:30:41.000000000 +0100
+++ xen-4.2.0/qemu/xen-setup	2012-11-13 10:22:28.852631118 +0100
@@ -28,7 +28,7 @@
 ln -sf ${QEMU_ROOT:-..}/xen-config.mak $target/config.mak
 cat ${QEMU_ROOT:-.}/xen-config-host.mak >>config-host.mak
 
-sed -e 's,qemu,xen/qemu,' config-host.h >config-host.h.new
+cat config-host.h >config-host.h.new
 echo "#define DEFAULT_NETWORK_SCRIPT      \"${XEN_SCRIPT_DIR}/qemu-ifup\"" >>config-host.h.new
 echo "#define DEFAULT_NETWORK_DOWN_SCRIPT \"${XEN_SCRIPT_DIR}/qemu-ifdown\"" >>config-host.h.new
 echo '#include "xen-config-host.h"' >>config-host.h.new
