Skip to contentSkip to conversation

tools/vtpm: do not install if vtpm can not be build

PATCH In review Olaf Hering 2 participants 3 messages Mar 14, 2012 – Apr 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/vtpm: do not install if vtpm can not be build

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1331751709 -3600
# Node ID eed3dbadeb151d9d93cf2b041aa63b9bacd1e4ad # Parent db4b70a33865e2fe77584c67d7d7644045ddf4ca tools/vtpm: do not install if vtpm can not be build

A simple 'make tools' fails in vtpm because there is also a 'make install' during make tools. vtpm checks only in the build target wether it can be built at all, but the check is missing in the install target as well.

tools/vtpm/Makefile +5 -1
diff -r db4b70a33865 -r eed3dbadeb15 tools/vtpm/Makefile
@@ -23,7 +23,11 @@ build: build_sub
 
 .PHONY: install
 install: build
-	$(MAKE) -C $(VTPM_DIR) $@
+	set -e; if [ -e $(GMP_HEADER) ]; then \
+		$(MAKE) -C $(VTPM_DIR) $@; \
+	else \
+		echo "=== Unable to build VTPMs. libgmp could not be found."; \
+	fi
 
 .PHONY: clean
 clean:
#1 lore raw

Olaf Hering writes ("[Xen-devel] [PATCH] tools/vtpm: do not install if vtpm can not be build"):

Quoted 5 lines

tools/vtpm: do not install if vtpm can not be build

A simple 'make tools' fails in vtpm because there is also a 'make install' during make tools. vtpm checks only in the build target wether it can be built at all, but the check is missing in the install target as well.

Thanks. I have two comments: firstly, I think it would be best to avoid repeating the test in the install rule. If necessary you can use a make variable to contain the runes.

But my second comment is: shouldn't this kind of test be done with autoconf nowadays ?

Ian.

#2 lore raw
Quoted 2 lines · Ian Jackson

But my second comment is: shouldn't this kind of test be done with autoconf nowadays ?

Yes, that was my thinking as well after poking around some more in the vtpm subdirectory. The header check for example can be done with autoconf.

Since I more or less enabled vtpm by accident, and currently lack the time to get this in shape for the 4.2 release, please drop this patch. I will look at this later.

Olaf