[libvirt] [libvirt-php][PATCH] m4: Check for php modules more wisely

Christophe Fergeau cfergeau at redhat.com
Fri Sep 2 10:27:53 UTC 2016


Hey,

On Thu, Sep 01, 2016 at 01:30:33PM +0200, Michal Privoznik wrote:
> I've got two version of PHP installed on my system, however one
> of them has imagick the other one doesn't. During configure I've
> noticed that wrong assumption has been made. Configure script
> wrongly assumed the plugin missing. This is because for detecting
> php plugins we use plain 'php -m | grep $module'. On my system,
> php is a symlink and it defaults to the version without the
> plugin. However, I am explicitly supplying 'php-config' from the
> version that has the plugin installed:
> 
>   ./configure --with-php-config=/usr/lib64/php5.6/bin/php-config
> 
> The trick is to query provided php-config for path to php binary.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> 
> Pushed under php-auto-push rule.
> 
>  m4/virt-php-extension.m4 | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/m4/virt-php-extension.m4 b/m4/virt-php-extension.m4
> index 9040eb1..5aa3cb7 100644
> --- a/m4/virt-php-extension.m4
> +++ b/m4/virt-php-extension.m4
> @@ -25,7 +25,18 @@ dnl
>  AC_DEFUN([LIBVIRT_CHECK_PHP_EXTENSION],[
>    AC_MSG_CHECKING([for php module $1])
>  
> -  module="$(php -m | grep $1)"
> +  phpbinary="$($PHPCONFIG --php-binary)"
> +  if test "x$phpbinary" = "x"; then
> +    phpbinary="$($PHPCONFIG --prefix)/bin/php"
> +  fi
> +
> +  if test ! -x "$phpbinary"; then
> +    AC_MSG_ERROR([php binary not found])
> +  fi
> +
> +  AC_SUBST([phpbinary])

Is the AC_SUBST needed? Nothing outside of m4/virt-php-extension.m4
seems to be using it.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160902/636b8242/attachment-0001.sig>


More information about the libvir-list mailing list