From: Hilko Bengen Date: Sat, 14 May 2016 11:34:07 +0000 (+0200) Subject: Make php buildable with builddir != srcdir X-Git-Tag: archive/raspbian/1%1.52.2-7+rpi1~2^2^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c9b5c7e7eebd4db38d294f06808c59776bc78f9a;p=libguestfs.git Make php buildable with builddir != srcdir Gbp-Pq: Name Make-php-buildable-with-builddir-srcdir.patch --- diff --git a/php/Makefile.am b/php/Makefile.am index c635abf4..6dacc4d1 100644 --- a/php/Makefile.am +++ b/php/Makefile.am @@ -36,26 +36,16 @@ 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: check-builddir-equals-srcdir extension/config.h +all: extension/config.h $(MAKE) -C extension \ EXTRA_INCLUDES="-I$(abs_srcdir)/../common/utils -I$(abs_srcdir)/../lib -I$(abs_srcdir)/../include" \ - EXTRA_LDFLAGS="-L$(abs_srcdir)/../lib/.libs -lguestfs" \ + EXTRA_LDFLAGS="-L$(abs_builddir)/../lib/.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 + if [ $(srcdir) != $(builddir) ]; then cp -rsft $(builddir)/extension $(abs_srcdir)/extension/.; fi + cd extension && $(PHPIZE) cd extension && ./configure --prefix=$(prefix) --libdir=$(libdir) test -f "$@" && touch -- $@ @@ -75,8 +65,13 @@ clean-local: rm -f extension/tests/*.out rm -f extension/tests/*.php rm -f extension/tests/*.sh + if [ $(srcdir) != $(builddir) ]; then rm -rf extension; fi install-data-hook: - $(MAKE) -C extension INSTALL_ROOT=$(DESTDIR) install + $(MAKE) -C extension \ + EXTRA_INCLUDES="-I$(abs_srcdir)/../common/utils -I$(abs_srcdir)/../lib" \ + EXTRA_LDFLAGS="-L$(abs_builddir)/../lib/.libs -lguestfs" \ + EXTRA_CFLAGS="-DGUESTFS_PRIVATE=1" \ + INSTALL_ROOT=$(DESTDIR) install endif