Browse Source

Use xenstore.h instead of xs.h when xen >= 4.2

Davíð Steinn Geirsson 10 years ago
parent
commit
e5fa610b0d
3 changed files with 11 additions and 1 deletions
  1. 6 0
      misc/Makefile
  2. 4 0
      misc/xenstore-watch.c
  3. 1 1
      network/setup-ip

+ 6 - 0
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

+ 4 - 0
misc/xenstore-watch.c

@@ -1,5 +1,9 @@
 #include <sys/types.h>
+#ifdef USE_XENSTORE_H
+#include <xenstore.h>
+#else
 #include <xs.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 int main(int argc, char **argv)

+ 1 - 1
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`