summaryrefslogtreecommitdiff
path: root/net-misc/dhcpcd-ui/files/dhcpcd-ui-0.7.7-tinfo.patch
blob: 675b1edad4a9f825b11327f7c1cfe0680a01856e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 988c171aa06bee85e393b28a482c894ccbbf8f58 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Mon, 10 Aug 2020 07:45:34 +0200
Subject: [PATCH] configure: Fix build against ncurses with separate tinfo lib

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---
 configure | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/configure b/configure
index ed83221..f77bde5 100755
--- a/configure
+++ b/configure
@@ -472,6 +472,21 @@ EOF
 		LIB_CURSES=-lcurses
 	fi
 	rm -f _curses.c _curses
+
+	#Check for -ltinfo requirement
+	cat <<EOF >_curses.c
+#include <curses.h>
+int main(void) {
+	curs_set(1);
+	return 0;
+}
+EOF
+	if ! $XCC _curses.c -o _curses -lcurses 2>&3; then
+		if $XCC _curses.c -o _curses -ltinfo 2>&3; then
+			LIB_CURSES="$LIB_CURSES -ltinfo"
+		fi
+	fi
+	rm -f _curses.c _curses
 fi
 if [ -n "$LIB_CURSES" ]; then
 	echo "$LIB_CURSES"
-- 
2.28.0