From 0ec2726a522b1f9253378707ce0bd7766b12bfcd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 24 Apr 2013 20:35:05 +0100 Subject: [PATCH] php: Disallow separated builds. As it stands, this will just break. Until it is fixed, give a diagnostic message. --- php/Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/php/Makefile.am b/php/Makefile.am index 3f95c83f8..215295e95 100644 --- a/php/Makefile.am +++ b/php/Makefile.am @@ -39,13 +39,24 @@ php_DATA = guestfs_php.ini # In theory: EXTRA_LIBS="-lguestfs" In fact this doesn't work # and we need to add the library to EXTRA_LDFLAGS. -all: extension/config.h +all: check-builddir-equals-srcdir extension/config.h $(MAKE) -C extension \ EXTRA_INCLUDES="-I$(abs_srcdir)/../src" \ EXTRA_LDFLAGS="-L$(abs_srcdir)/../src/.libs -lguestfs" \ EXTRA_CFLAGS="-DGUESTFS_PRIVATE=1" \ all +# It looks like this is going to be very hard to make work, so +# disallow it for now. +check-builddir-equals-srcdir: + @if [ $(builddir) != $(srcdir) ]; then \ + echo "***"; \ + echo "PHP cannot be built with builddir != srcdir"; \ + echo "Use ./configure --disable-php"; \ + echo "***"; \ + exit 1; \ + fi + extension/config.h: extension/config.m4 ../config.status cd extension && phpize cd extension && ./configure --prefix=$(prefix) --libdir=$(libdir)