diff --git a/misc/Makefile b/misc/Makefile index c9376ce..b0b18ae 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,5 +1,11 @@ CC=gcc CFLAGS=-Wall -Wextra -Werror -g -O3 + +_XENSTORE_H=$(wildcard /usr/include/xenstore.h) +ifneq "$(_XENSTORE_H)" "" + CFLAGS+= -DUSE_XENSTORE_H +endif + all: xenstore-watch python close-window xenstore-watch: xenstore-watch.o $(CC) -o xenstore-watch xenstore-watch.o -lxenstore diff --git a/misc/xenstore-watch.c b/misc/xenstore-watch.c index 61767ec..f0e91e8 100644 --- a/misc/xenstore-watch.c +++ b/misc/xenstore-watch.c @@ -1,5 +1,9 @@ #include +#ifdef USE_XENSTORE_H +#include +#else #include +#endif #include #include int main(int argc, char **argv) diff --git a/network/setup-ip b/network/setup-ip index 7ea5fb9..907a295 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -3,7 +3,7 @@ if [ -x /usr/sbin/xenstore-read ]; then XENSTORE_READ="/usr/sbin/xenstore-read" else - XENSTORE_READ="$XENSTORE_READ" + XENSTORE_READ="/usr/bin/xenstore-read" fi ip=`$XENSTORE_READ qubes-ip 2> /dev/null`