toolchain: bump Codescape IMG MIPS version to 2016.05-06
[buildroot-gz.git] / package / util-linux / 0001-build-sys-prefer-pkg-config-for-ncurses.patch
blobca22ee2f54ef83ca4091beddefb1eba8375fa924
1 From 3f7429fd2d539c7f948f72bd829404b55ac19d9f Mon Sep 17 00:00:00 2001
2 From: Karel Zak <kzak@redhat.com>
3 Date: Mon, 12 Dec 2016 15:23:53 +0100
4 Subject: [PATCH] build-sys: prefer pkg-config for ncurses
6 and use ncurses{5,6}-config as fallback only.
8 Signed-off-by: Karel Zak <kzak@redhat.com>
9 ---
10 m4/ul.m4 | 48 ++++++++++++++++++++++++++++--------------------
11 1 file changed, 28 insertions(+), 20 deletions(-)
13 diff --git a/m4/ul.m4 b/m4/ul.m4
14 index c569c36..44c721e 100644
15 --- a/m4/ul.m4
16 +++ b/m4/ul.m4
17 @@ -438,28 +438,36 @@ dnl The expected <name> is ncurses or ncursesw.
18 dnl
19 AC_DEFUN([UL_NCURSES_CHECK], [
20 m4_define([suffix], $1)
21 + m4_define([suffixup], m4_toupper($1))
23 + # pkg-config
24 + PKG_CHECK_MODULES(suffixup, [$1], [
25 + have_[]suffix=yes
26 + NCURSES_LIBS=${suffixup[]_LIBS}
27 + NCURSES_CFLAGS=${suffixup[]_CFLAGS}
28 + ],[have_[]suffix=no])
30 # ncurses-config should be everywhere, pkg-config is not supported by default
31 # by ncurses upstream
33 - AC_MSG_CHECKING([$1])
34 - if AC_RUN_LOG([suffix[]6-config --version >/dev/null]); then
35 - have_[]suffix=yes
36 - NCURSES_LIBS=`suffix[]6-config --libs`
37 - NCURSES_CFLAGS=`suffix[]6-config --cflags`
38 - AC_MSG_RESULT([(v6) yes])
39 - elif AC_RUN_LOG([suffix[]5-config --version >/dev/null]); then
40 - have_[]suffix=yes
41 - NCURSES_LIBS=`suffix[]5-config --libs`
42 - NCURSES_CFLAGS=`suffix[]5-config --cflags`
43 - AC_MSG_RESULT([(v5) yes])
44 - else
45 - AC_MSG_RESULT([no])
47 - # fallback
48 - AC_CHECK_LIB([$1], [initscr], [have_[]suffix=yes], [have_[]suffix=no])
49 - AS_IF([test "x$have_[]suffix" = xyes], [
50 - NCURSES_LIBS="-l[]suffix"
51 - ])
52 - fi
53 + AS_IF([test "x$have_[]suffix" = xno], [
54 + AC_MSG_CHECKING([$1 config])
55 + if AC_RUN_LOG([suffix[]6-config --version >/dev/null]); then
56 + have_[]suffix=yes
57 + NCURSES_LIBS=`suffix[]6-config --libs`
58 + NCURSES_CFLAGS=`suffix[]6-config --cflags`
59 + AC_MSG_RESULT([(v6) yes])
60 + elif AC_RUN_LOG([suffix[]5-config --version >/dev/null]); then
61 + have_[]suffix=yes
62 + NCURSES_LIBS=`suffix[]5-config --libs`
63 + NCURSES_CFLAGS=`suffix[]5-config --cflags`
64 + AC_MSG_RESULT([(v5) yes])
65 + else
66 + AC_MSG_RESULT([no])
67 + AS_IF([test "x$have_[]suffix" = xno], [
68 + AC_CHECK_LIB([$1], [initscr], [have_[]suffix=yes], [have_[]suffix=no])
69 + AS_IF([test "x$have_[]suffix" = xyes], [NCURSES_LIBS="-l[]suffix"])
70 + ])
71 + fi
72 + ])
74 --
75 2.6.2