Cédric Bosdonnat
2016-Mar-08 13:19 UTC
[Libguestfs] [PATCH v3] configure: handle older version of ncurses
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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/m4/guestfs_libraries.m4 b/m4/guestfs_libraries.m4 index c5a4a01..e751db1 100644 --- a/m4/guestfs_libraries.m4 +++ b/m4/guestfs_libraries.m4 @@ -113,7 +113,14 @@ 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_PROGS([NCURSES_CONFIG], [ncurses6-config ncurses5-config], [no]) + 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]) -- 2.6.2
Pino Toscano
2016-Mar-08 14:09 UTC
Re: [Libguestfs] [PATCH v3] configure: handle older version of ncurses
On Tuesday 08 March 2016 14:19: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."... try the ncurses6-config and ncurses5-config tools"> --- > m4/guestfs_libraries.m4 | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/m4/guestfs_libraries.m4 b/m4/guestfs_libraries.m4 > index c5a4a01..e751db1 100644 > --- a/m4/guestfs_libraries.m4 > +++ b/m4/guestfs_libraries.m4 > @@ -113,7 +113,14 @@ 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_PROGS([NCURSES_CONFIG], [ncurses6-config ncurses5-config], [no]) > + if test "x$NCURSES_CONFIG" == "xno"; thenApologies for yet another roundtrip: this should be AS_IF instead, and with a single equal ('=' instead of '=='). With the above changes, the patch looks ok to me. Thanks, -- Pino Toscano