Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | Use pkg-config to search for ncurses libraries |
| 2 | |
| 3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 4 | Upstream-Status: Pending |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 5 | --- a/Makefile |
| 6 | +++ b/Makefile |
| 7 | @@ -201,8 +201,8 @@ endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | |
| 9 | ifndef NCURSES_LDFLAGS |
| 10 | ifdef NEEDS_NCURSES5 |
| 11 | - NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null) |
| 12 | - NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null) |
| 13 | + NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 2>/dev/null) |
| 14 | + NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 2>/dev/null) |
| 15 | ifndef NO_PANEL |
| 16 | NCURSES_LDFLAGS += -lpanel |
| 17 | endif |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 18 | @@ -211,8 +211,8 @@ endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | |
| 20 | ifndef NCURSES_LDFLAGS |
| 21 | ifdef NEEDS_NCURSESW5 |
| 22 | - NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null) |
| 23 | - NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null) |
| 24 | + NCURSES_CFLAGS := $(shell p[k-config ncursesw --cflags 2>/dev/null) |
| 25 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
| 26 | ifndef NO_PANEL |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 27 | NCURSES_LDFLAGS += -lpanelw |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 28 | endif |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 29 | @@ -221,8 +221,8 @@ endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | |
| 31 | ifndef NCURSES_LDFLAGS |
| 32 | ifdef NEEDS_NCURSES6 |
| 33 | - NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null) |
| 34 | - NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null) |
| 35 | + NCURSES_CFLAGS := $(shell pkg-config ncurses6 --cflags 2>/dev/null) |
| 36 | + NCURSES_LDFLAGS := $(shell pkg-config ncurses6 --libs 2>/dev/null) |
| 37 | ifndef NO_PANEL |
| 38 | NCURSES_LDFLAGS += -lpanel |
| 39 | endif |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 40 | @@ -231,8 +231,8 @@ endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | |
| 42 | ifndef NCURSES_LDFLAGS |
| 43 | ifdef NEEDS_NCURSESW6 |
| 44 | - NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null) |
| 45 | - NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null) |
| 46 | + NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) |
| 47 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
| 48 | ifndef NO_PANEL |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 49 | NCURSES_LDFLAGS += -lpanelw |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | endif |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 51 | @@ -241,27 +241,27 @@ endif |
| 52 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 53 | # try find ncuses by autodetect |
| 54 | ifndef NCURSES_LDFLAGS |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 55 | - ifneq ($(shell ncursesw6-config --libs 2>/dev/null),) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 56 | - NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null) |
| 57 | - NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 58 | + ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),) |
| 59 | + NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) |
| 60 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
| 61 | ifndef NO_PANEL |
| 62 | NCURSES_LDFLAGS += -lpanelw |
| 63 | endif |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 64 | - else ifneq ($(shell ncurses6-config --libs 2>/dev/null),) |
| 65 | - NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null) |
| 66 | - NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 67 | + else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),) |
| 68 | + NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) |
| 69 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 70 | ifndef NO_PANEL |
| 71 | NCURSES_LDFLAGS += -lpanel |
| 72 | endif |
| 73 | - else ifneq ($(shell ncursesw5-config --libs 2>/dev/null),) |
| 74 | - NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null) |
| 75 | - NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null) |
| 76 | + else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),) |
| 77 | + NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) |
| 78 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
| 79 | ifndef NO_PANEL |
| 80 | NCURSES_LDFLAGS += -lpanelw |
| 81 | endif |
| 82 | - else ifneq ($(shell ncurses5-config --libs 2>/dev/null),) |
| 83 | - NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null) |
| 84 | - NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null) |
| 85 | + else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),) |
| 86 | + NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) |
| 87 | + NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) |
| 88 | ifndef NO_PANEL |
| 89 | NCURSES_LDFLAGS += -lpanel |
| 90 | endif |