]> xenbits.xensource.com Git - qemu-xen-4.1-testing.git/commitdiff
get rid of hardcoded paths
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 30 Jun 2009 13:46:42 +0000 (14:46 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 30 Jun 2009 13:46:42 +0000 (14:46 +0100)
Attached patches get rid of hardcoded pathes in ioemu
and in ioemu-stubdom.

You need xen changeset 19841 or newer to have
them working.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Makefile
xen-config-host.h
xen-config.mak
xen-hooks.mak
xen-setup
xen-setup-stubdom

index c395e773d338f90327cb927aa5ba92306b9074e0..e37e069325b86b6af96c55f61cfe7996e44fa6af 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -46,10 +46,11 @@ $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
 
 recurse-all: $(SUBDIR_RULES)
 
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include
+CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
+CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
+CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS += -I$(XEN_ROOT)/tools/include
+
 tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
        $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
 
index 5b1f4d7db0dedd4e099cdc0bbb90a64ed65d3cb0..f34e76b95284517c528a6805d5a5f4a40b8ae589 100644 (file)
@@ -32,9 +32,6 @@ extern int xc_handle;
 extern int xen_pause_requested;
 extern int vcpus;
 
-#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/xen/qemu-ifdown"
-
 #ifdef CONFIG_STUBDOM
 #define bdrv_host_device bdrv_raw
 #endif
index 62106191736df8c13ee1f68db1597fc2168416f2..40984bc4712218a73072abd89778eb62bbcf030a 100644 (file)
@@ -8,4 +8,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${prefix}/${LIBLEAFDIR}/xen/bin
+bindir = ${LIBEXEC}
index c6b4f8c1f35a48b8f6c3ad36ae62d1b282f9b901..211416efd4ae43a823fee59049dc59bec2f68189 100644 (file)
@@ -78,4 +78,4 @@ datadir := $(subst qemu,xen/qemu,$(datadir))
 docdir :=  $(subst qemu,xen/qemu,$(docdir))
 mandir :=  $(subst share/man,share/xen/man,$(mandir))
 
-configdir := /etc/xen
+configdir := $(XEN_SCRIPT_DIR)
index 8ca00199c326fe15fd0dc0f4af28c555fa2a687d..fde15688d07f49a1e44e605ca6ce74ac95dc3bc0 100755 (executable)
--- a/xen-setup
+++ b/xen-setup
@@ -9,7 +9,14 @@ rm -f config-host.mak
 
 if test -f config-host.h; then mv config-host.h config-host.h~; fi
 
-./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=/usr
+if test -z "${PREFIX}"; then
+       PREFIX="/usr"
+fi
+if test -z "${XEN_SCRIPT_DIR}"; then
+       XEN_SCRIPT_DIR="/etc/xen/scripts"
+fi
+
+./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX}
 
 target=i386-dm
 
@@ -22,6 +29,8 @@ ln -sf ../xen-config.mak $target/config.mak
 cat xen-config-host.mak >>config-host.mak
 
 sed -e 's,qemu,xen/qemu,' 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
 
 if test -f config-host.h~; then mv config-host.h~ config-host.h; fi
index 835e505333b9c9936244105a1b756d9331f21e10..fcf60c39133725f5d9f778659b601b6fc3e81af0 100755 (executable)
@@ -21,7 +21,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__
 TARGET_CFLAGS= $TARGET_CFLAGS
 TARGET_LDFLAGS= $TARGET_LDFLAGS
 
-bindir = \${prefix}/\${LIBLEAFDIR}/xen/bin
+bindir = \${LIBEXEC}
 END
 mv -f $target/config.mak.new $target/config.mak
 #----------
@@ -31,7 +31,9 @@ ln -sf ../i386-dm/hookslib.mak $target/
 
 #----------
 cat <<END >config-host.h.new
-#define CONFIG_QEMU_SHAREDIR "/usr/share/xen/qemu"
+#define DEFAULT_NETWORK_SCRIPT "${XEN_SCRIPT_DIR}/qemu-ifup"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "${XEN_SCRIPT_DIR}/qemu-ifdown"
+#define CONFIG_QEMU_SHAREDIR "${SHAREDIR}/xen/qemu"
 #define HOST_I386 1
 #define HOST_LONG_BITS 32
 #define HAVE_BYTESWAP_H 1
@@ -46,11 +48,11 @@ mv -f config-host.h.new config-host.h
 #----------
 cat <<END >config-host.mak.new
 CONFIG_STUBDOM=yes
-prefix=/usr
+prefix=$(PREFIX)
 bindir=\${prefix}/bin
-mandir=\${prefix}/share/man
-datadir=\${prefix}/share/qemu
-docdir=\${prefix}/share/doc/qemu
+mandir=\$(MANDIR)
+datadir=\$(SHAREDIR)/qemu
+docdir=\$(SHAREDIR)/doc/qemu
 MAKE=make
 INSTALL=install
 CC=gcc