[Libguestfs] [PATCH 2/2] nbdkit: Retrieve libperl linking information from ExtUtils::Embed

Richard W.M. Jones rjones at redhat.com
Fri Feb 14 12:33:05 UTC 2014


On Thu, Feb 13, 2014 at 06:56:39PM +0100, Hilko Bengen wrote:
> perl -MConfig -e 'print $Config{ldflags}' gave me
> 
>     -lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
> 
> with Perl 5.18 as configured on Debian/unstable.
> ---
>  configure.ac             | 15 +++++----------
>  plugins/perl/Makefile.am |  4 +---
>  2 files changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index df31014..d129d5a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -132,7 +132,7 @@ AS_IF([test "x$PERL" != "xno" && test "x$enable_perl" != "xno"],[
>  
>      dnl Check for Perl CFLAGS.
>      AC_MSG_CHECKING([for Perl embed CFLAGS])
> -    PERL_CFLAGS="$($PERL -MConfig -e 'print $Config{ccflags}')"
> +    PERL_CFLAGS="$($PERL -MExtUtils::Embed -e 'ccflags')"
>      AS_IF([ test -n "$PERL_CFLAGS" ],[
>          AC_MSG_RESULT([$PERL_CFLAGS])
>      ],[
> @@ -140,21 +140,16 @@ AS_IF([test "x$PERL" != "xno" && test "x$enable_perl" != "xno"],[
>          enable_perl=no
>      ])
>  
> -    dnl Check for Perl LIBS.
> -    AC_MSG_CHECKING([for Perl embed LIBS])
> -    PERL_LIBS="$($PERL -MConfig -e 'print $Config{libs}')"
> -
> -    dnl Check for Perl LDFLAGS.
> -    AC_MSG_CHECKING([for Perl embed LDFLAGS])
> -    PERL_LDFLAGS="$($PERL -MConfig -e 'print $Config{ldflags}')"
> +    dnl Check for Perl LDOPTS.
> +    AC_MSG_CHECKING([for Perl embed LDOPTS])
> +    PERL_LDOPTS="$($PERL -MExtUtils::Embed -e 'ldopts')"
>  
>      dnl XXX Could check these actually work.
>  ])
>  AM_CONDITIONAL([HAVE_PERL],[test "x$enable_perl" != "xno" && test "x$PERL" != "xno"])
>  AC_SUBST([PERL_ARCHLIB])
>  AC_SUBST([PERL_CFLAGS])
> -AC_SUBST([PERL_LIBS])
> -AC_SUBST([PERL_LDFLAGS])
> +AC_SUBST([PERL_LDOPTS])
>  
>  dnl Check for libvirt (only if you want to compile the libvirt plugin).
>  AC_ARG_WITH([libvirt],[
> diff --git a/plugins/perl/Makefile.am b/plugins/perl/Makefile.am
> index a68db5d..70a7683 100644
> --- a/plugins/perl/Makefile.am
> +++ b/plugins/perl/Makefile.am
> @@ -50,11 +50,9 @@ nbdkit_perl_plugin_la_CFLAGS = \
>  	$(WARNINGS_CFLAGS) \
>  	$(PERL_CFLAGS) \
>  	-I$(PERL_ARCHLIB)/CORE
> -nbdkit_perl_plugin_la_LIBADD = \
> -	-lperl $(PERL_LIBS)
>  nbdkit_perl_plugin_la_LDFLAGS = \
>  	-module -avoid-version -shared \
> -	$(PERL_LDFLAGS)
> +	$(PERL_LDOPTS)

I checked the equivalent settings on Fedora, and it all seems
sensible, so ACK.

Thanks, Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)




More information about the Libguestfs mailing list