aboutsummaryrefslogtreecommitdiffstats
path: root/main/mc/ncurses.patch
blob: 8c6f1dc58ba117a11841c1526f126447293ab30d (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
40
41
42
43
44
45
46
47
48
49
50
Gentoo-bug: https://bugs.gentoo.org/527118
--- a/m4.include/mc-with-screen-ncurses.m4
+++ b/m4.include/mc-with-screen-ncurses.m4
@@ -101,6 +101,9 @@
         LIBS=
         AC_SEARCH_LIBS([has_colors], [ncurses], [MCLIBS="$MCLIBS $LIBS"], 
                        [AC_MSG_ERROR([Cannot find ncurses library])])
+        AC_SEARCH_LIBS([stdscr],[tinfo ncurses],[MCLIBS="$MCLIBS $LIBS"],
+                       [AC_MSG_ERROR([Cannot find a library providing stdscr])])
+
 
         screen_type=ncurses
         screen_msg="Ncurses library"
@@ -111,10 +114,15 @@
         AC_SEARCH_LIBS([addwstr], [ncursesw ncurses curses], [MCLIBS="$MCLIBS $LIBS";ncursesw_found=yes],
                        [AC_MSG_WARN([Cannot find ncurses library, that support wide characters])])
 
+        AC_SEARCH_LIBS([stdscr],[tinfo ncursesw ncurses curses],[MCLIBS="$MCLIBS $LIBS"],
+                       [AC_MSG_ERROR([Cannot find a library providing stdscr])])
+
         if test x"$ncursesw_found" = "x"; then
             LIBS=
             AC_SEARCH_LIBS([has_colors], [ncurses curses], [MCLIBS="$MCLIBS $LIBS"], 
                            [AC_MSG_ERROR([Cannot find ncurses library])])
+            AC_SEARCH_LIBS([stdscr],[tinfo ncurses curses],[MCLIBS="$MCLIBS $LIBS"],
+                           [AC_MSG_ERROR([Cannot find a library providing stdscr])])
         fi
 
         dnl Check the header
@@ -166,6 +174,9 @@
     LIBS=
     AC_SEARCH_LIBS([has_colors], [ncursesw], [MCLIBS="$MCLIBS $LIBS"],
 		   [AC_MSG_ERROR([Cannot find ncursesw library])])
+    AC_SEARCH_LIBS([stdscr],[tinfow ncursesw],[MCLIBS="$MCLIBS $LIBS"],
+           [AC_MSG_ERROR([Cannot find a library providing stdscr])])
+
 
     dnl Check the header
     ncurses_h_found=
--- a/lib/tty/tty-ncurses.c
+++ b/lib/tty/tty-ncurses.c
@@ -66,7 +66,7 @@
 
 /*** file scope macro definitions ****************************************************************/
 
-#if defined(_AIX) && !defined(CTRL)
+#if !defined(CTRL)
 #define CTRL(x) ((x) & 0x1f)
 #endif