Le 27/11/2015 09:33, Remi Collet a écrit : > Notice: I think it will be simpler to switch to the standard PHP > extension build system (phpize; configure; make) See attached patch. This only manage the extension build (not the documentation) TODO: add a --enable-libvirt-debug option to avoid having it always build in. Remi
>From 5b6e08f23f5eb5388c8ac7274786edd12a6695f0 Mon Sep 17 00:00:00 2001 From: Remi Collet <fedora@xxxxxxxxxxxxxxxxx> Date: Fri, 27 Nov 2015 10:57:32 +0100 Subject: [PATCH] add config.m4 to allow standard PHP extension build system --- src/config.m4 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/config.m4 diff --git a/src/config.m4 b/src/config.m4 new file mode 100644 index 0000000..ee2b47d --- /dev/null +++ b/src/config.m4 @@ -0,0 +1,52 @@ +PHP_ARG_WITH(libvirt, for libvirt support, +[ --with-libvirt Include varnish support]) + +if test "$PHP_LIBVIRT" != "no"; then + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + if test -x "$PKG_CONFIG" && $PKG_CONFIG varnishapi --exists ; then + AC_MSG_CHECKING(libvirt version) + if $PKG_CONFIG libvirt --atleast-version=1.2.8 ; then + LIBVIRT_INCLUDE=`$PKG_CONFIG libvirt --cflags` + LIBVIRT_LIBRARY=`$PKG_CONFIG libvirt --libs` + LIBVIRT_VERSION=`$PKG_CONFIG libvirt --modversion` + AC_MSG_RESULT($LIBVIRT_VERSION) + else + AC_MSG_ERROR(version too old) + fi + PHP_EVAL_INCLINE($LIBVIRT_INCLUDE) + PHP_EVAL_LIBLINE($LIBVIRT_LIBRARY, LIBVIRT_SHARED_LIBADD) + + AC_MSG_CHECKING(libvirt-qemu version) + if $PKG_CONFIG libvirt-qemu --atleast-version=1.2.8 ; then + QEMU_INCLUDE=`$PKG_CONFIG libvirt-qemu --cflags` + QEMU_LIBRARY=`$PKG_CONFIG libvirt-qemu --libs` + QEMU_VERSION=`$PKG_CONFIG libvirt-qemu --modversion` + AC_MSG_RESULT($QEMU_VERSION) + else + AC_MSG_ERROR(version too old) + fi + PHP_EVAL_INCLINE($QEMU_INCLUDE) + PHP_EVAL_LIBLINE($QEMU_LIBRARY, LIBVIRT_SHARED_LIBADD) + + AC_MSG_CHECKING(libxml version) + if $PKG_CONFIG libxml-2.0 --atleast-version=1.2.8 ; then + LIBXML_INCLUDE=`$PKG_CONFIG libxml-2.0 --cflags` + LIBXML_LIBRARY=`$PKG_CONFIG libxml-2.0 --libs` + LIBXML_VERSION=`$PKG_CONFIG libxml-2.0 --modversion` + AC_MSG_RESULT($LIBXML_VERSION) + else + AC_MSG_ERROR(version too old) + fi + PHP_EVAL_INCLINE($LIBXML_INCLUDE) + PHP_EVAL_LIBLINE($LIBXML_LIBRARY, LIBVIRT_SHARED_LIBADD) + + CFLAGS="$CFLAGS -DCOMPILE_DL_LIBVIRT=1" + + PHP_SUBST(LIBVIRT_SHARED_LIBADD) + PHP_NEW_EXTENSION(libvirt, libvirt-php.c sockets.c vncfunc.c, $ext_shared) + else + AC_MSG_ERROR(pkg-config not found) + fi +fi -- 2.1.0
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list