From: Ian Jackson Date: Tue, 30 Jun 2009 13:46:42 +0000 (+0100) Subject: get rid of hardcoded paths X-Git-Tag: xen-4.0.0-rc1~60 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=05135013b164cab4240ff3589f4e7bd9a1e369c3;p=qemu-xen-4.0-testing.git get rid of hardcoded paths 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 --- diff --git a/Makefile b/Makefile index c395e773..e37e0693 100644 --- 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) diff --git a/xen-config-host.h b/xen-config-host.h index 5b1f4d7d..f34e76b9 100644 --- a/xen-config-host.h +++ b/xen-config-host.h @@ -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 diff --git a/xen-config.mak b/xen-config.mak index 62106191..40984bc4 100644 --- a/xen-config.mak +++ b/xen-config.mak @@ -8,4 +8,4 @@ CONFIG_SOFTMMU=yes CFLAGS += -I$(QEMU_ROOT)/hw -bindir = ${prefix}/${LIBLEAFDIR}/xen/bin +bindir = ${LIBEXEC} diff --git a/xen-hooks.mak b/xen-hooks.mak index c6b4f8c1..211416ef 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -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) diff --git a/xen-setup b/xen-setup index 8ca00199..fde15688 100755 --- 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 diff --git a/xen-setup-stubdom b/xen-setup-stubdom index 835e5053..fcf60c39 100755 --- a/xen-setup-stubdom +++ b/xen-setup-stubdom @@ -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 <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 <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