Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
configure.ac | 5 +++++
src/Makefile.am | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7a634ca..2d05465 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,11 @@ if test "x$PHPIZE" = "xno"; then
AC_MSG_ERROR([phpize not found; please install the PHP SDK])
fi
+PHP_CFLAGS=$($PHPCONFIG --includes)
+PHP_LDFLAGS=$($PHPCONFIG --ldflags)
+AC_SUBST(PHP_CFLAGS)
+AC_SUBST(PHP_LDFLAGS)
+
LIBVIRT_CHECK_PHP_EXTENSIONDIR
LIBVIRT_CHECK_PHP_CONFDIR
diff --git a/src/Makefile.am b/src/Makefile.am
index 05ae534..d988a32 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,15 +1,15 @@
-PHPINC=$(shell $(PHPCONFIG) --includes)
DEFINES=-DHAVE_CONFIG_H
WL=@WL@
SHLIB_FLAGS=@SHLIB_FLAGS@
AM_CFLAGS = \
- $(PHPINC) $(LIBXML_CFLAGS) \
+ $(PHP_CFLAGS) $(LIBXML_CFLAGS) \
$(LIBVIRT_CFLAGS) $(QEMU_CFLAGS) $(DEFINES) \
-I$(top_srcdir)/winsrc
AM_LDFLAGS = \
$(SHLIB_LDFLAGS) \
+ $(PHP_LDFLAGS) \
$(LIBXML_LIBS) \
$(LIBVIRT_LIBS) \
$(QEMU_LIBS)
--
2.7.3