[Libguestfs] [PATCH v2 1/3] configure: handle older version of ncurses

Pino Toscano ptoscano at redhat.com
Tue Mar 8 09:42:12 UTC 2016


On Tuesday 08 March 2016 10:26:57 Cédric Bosdonnat wrote:
> ncurses didn't have pkg-config files in not-that-old versions. If those
> couldn't be found, then try the ncurses6-config tool.
> ---
>  m4/guestfs_libraries.m4 | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/m4/guestfs_libraries.m4 b/m4/guestfs_libraries.m4
> index c5a4a01..defd394 100644
> --- a/m4/guestfs_libraries.m4
> +++ b/m4/guestfs_libraries.m4
> @@ -113,7 +113,17 @@ struct sockaddr_un myaddr;
>  dnl tgetent, tputs and UP [sic] are all required.  They come from the lower
>  dnl tinfo library, but might be part of ncurses directly.
>  PKG_CHECK_MODULES([LIBTINFO], [tinfo], [], [
> -    PKG_CHECK_MODULES([LIBTINFO], [ncurses])
> +    PKG_CHECK_MODULES([LIBTINFO], [ncurses], [], [
> +        AC_CHECK_PROG([NCURSES_CONFIG], [ncurses6-config], [ncurses6-config], [no])
> +        if test "x$NCURSES_CONFIG" == "xno"; then
> +            AC_CHECK_PROG([NCURSES_CONFIG], [ncurses5-config], [ncurses5-config], [no])
> +        fi

I think this is what AC_CHECK_PROGS does, supplying more executables
to search.

> +        if test "x$NCURSES_CONFIG" == "xno"; then
> +            AC_MSG_ERROR([ncurses development package is not installed])
> +        fi
> +        LIBTINFO_CFLAGS=`$NCURSES_CONFIG --cflags`
> +        LIBTINFO_LIBS=`$NCURSES_CONFIG --libs`
> +    ])
>  ])
>  AC_SUBST([LIBTINFO_CFLAGS])
>  AC_SUBST([LIBTINFO_LIBS])

With the above change, it looks ok to me.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160308/caa830c7/attachment.sig>


More information about the Libguestfs mailing list