[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gtypist] gtypist fails to build with ncurses[tinfo]
From: |
Felix Natter |
Subject: |
Re: [bug-gtypist] gtypist fails to build with ncurses[tinfo] |
Date: |
Wed, 30 Oct 2013 21:55:17 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (gnu/linux) |
Felix Natter <address@hidden> writes:
hi Tim,
> Tim Marston <address@hidden> writes:
>> I also found a discussion[5] suggesting that you can "invoke
>> AC_CHECK_LIBS first, then conditionally invoke PKG_CHECK_MODULES, and
>> then invoke AC_CHECK_LIBS again to validate the information found by
>> PKG_CHECK_MODULES". This sounds a lot more complicat ed and (as far as
>> I can see) only gives us the benefit of including pkg-config in the
>> build process. But since that's not really the goal here -- it was
>> just a proposed solution -- I suggest we try one of the above first.
>
> Why not try PKG_CHECK_MODULES, and use AC_CHECK_LIB/AC_CHECK_HEADER as a
> fallback? Ok, I realize that this a problem with systems using
> pkg-config, but in a broken way (see [5]).
>
>> [1] http://lists.gnu.org/archive/html/autoconf/2009-10/msg00132.html
>> [2] https://bugs.gentoo.org/show_bug.cgi?id=483778
>> [3] http://lists.gnu.org/archive/html/autoconf/2009-10/msg00149.html
>> [4]
>> https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Libraries.html
>> [5]
>> http://stackoverflow.com/questions/10220946/pkg-check-modules-considered-harmful
>
> Ok, now I see
> (http://stackoverflow.com/questions/10220946/pkg-check-modules-considered-harmful):
>
> "In short, to use PKG_CHECK_MODULES correctly, it is necessary to invoke
> AC_CHECK_LIBS first, then conditionally invoke PKG_CHECK_MODULES, and
> then invoke AC_CHECK_LIBS again to validate the information found by
> PKG_CHECK_MODULES."
>
> But we only need to cover gentoo's pkg-config setup...
>
> What do you think, shall I try the above solution (AC_CHECK_LIB(S),
> PKG_CHECK_MODULES, AC_CHECK_LIB(S)) can you think of easier solution?
I coded a very simple solution (PKG_CHECK_MODULES, if that fails use
AC_CHECK_HEADER/LIB), which works both with "ncursesw.pc" and without:
diff --git a/configure.ac b/configure.ac
index c1d23f0..4772cd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,17 +45,20 @@ AC_FUNC_STRTOD
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext getcwd
getwd mempcpy memset munmap nl_langinfo setlocale stpcpy strcasecmp strchr
strcspn strdup strstr strtoul])
# check for libncursesw
-
-AC_CHECK_HEADER(ncursesw/ncurses.h, HAVE_NCURSESW_H=1)
-AC_CHECK_LIB(ncursesw, add_wch, HAVE_LIBNCURSESW=1)
-if test -n "$HAVE_NCURSESW_H" -a -n "$HAVE_LIBNCURSESW"; then
- LIBS="-lncursesw $LIBS"
-else
- echo -e "Error: both library and header files for the ncursesw library\n"\
- "are required to build this package. See INSTALL file for"\
- "further information. On Debian/Ubuntu you need to install
libncursesw5-dev."
- exit 1;
-fi
+PKG_CHECK_MODULES(NCURSESW, ncursesw, [
+ LIBS="$NCURSESW_LIBS $LIBS"
+ CFLAGS="$NCURSESW_CFLAGS $CFLAGS"], [
+ AC_CHECK_HEADER(ncursesw/ncurses.h, HAVE_NCURSESW_H=1)
+ AC_CHECK_LIB(ncursesw, add_wch, HAVE_LIBNCURSESW=1)
+ if test -n "$HAVE_NCURSESW_H" -a -n "$HAVE_LIBNCURSESW"; then
+ LIBS="-lncursesw $LIBS"
+ else
+ echo -e "Error: both library and header files for the ncursesw
library\n"\
+ "are required to build this package. See INSTALL file for"\
+ "further information. On Debian/Ubuntu you need to install
libncursesw5-dev."
+ exit 1;
+ fi
+])
# iconv
=> this will break if there is a broken ncursesw.pc, but I don't care
much about that. What do you think?
Best Regards,
--
Felix Natter
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug-gtypist] gtypist fails to build with ncurses[tinfo],
Felix Natter <=