[Libguestfs] [PATCH 2/2] ruby: fix detection of ruby library

Richard W.M. Jones rjones at redhat.com
Thu Nov 6 16:55:36 UTC 2014


On Thu, Nov 06, 2014 at 05:23:43PM +0100, Pino Toscano wrote:
> Query RbConfig::CONFIG for "libdir", and use that when trying to link to
> the ruby library.  This fixes the libruby detection when it is installed
> in a non-standard library directory.
> 
> (This is the same change as 3d02e53c48266669675cc237f61ae2c4e1816e66
> in libguestfs.)
> ---
>  configure.ac | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 3d85afe..554ff87 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -376,9 +376,15 @@ AS_IF([test "x$enable_ruby" != "xno"],[
>          libruby="$(cat conftest)"
>          rm conftest
>          AS_IF([test -n "$libruby"],[
> +            ruby_cmd='puts RbConfig::CONFIG@<:@"libdir"@:>@'
> +            echo running: $RUBY -rrbconfig -e \'$ruby_cmd\' >&AS_MESSAGE_LOG_FD
> +            $RUBY -rrbconfig -e "$ruby_cmd" >conftest 2>&AS_MESSAGE_LOG_FD
> +            libruby_libdir="$(cat conftest)"
> +            rm conftest
> +            test -n "$libruby_libdir" && libruby_libdir="-L$libruby_libdir"
>              AC_MSG_RESULT([-l$libruby])
>              AC_CHECK_LIB([$libruby],[ruby_init],
> -                         [have_libruby=1],[have_libruby=])
> +                         [have_libruby=1],[have_libruby=],[$libruby_libdir])
>  
>              dnl Symbols that we substitute when missing.
>              AS_IF([test -n "$have_libruby"],[

ACK both.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list