summaryrefslogtreecommitdiff
path: root/games-roguelike/hengband/files/hengband-2.1.2-autoconf-ncurses.patch
blob: 4f695310d7b5247da88c5a1447262c57eb5b0f89 (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
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac	2018-03-19 11:04:42.000000000 +0000
+++ b/configure.ac	2022-05-31 22:18:52.959822579 +0100
@@ -51,16 +51,14 @@
 
 dnl Checks for libraries.
 dnl Replace `main' with a function in -lncurses:
-AC_CHECK_LIB(ncursesw, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncursesw"])
-if test "$ac_cv_lib_ncursesw_initscr" != yes; then
-  AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncurses"])
-  if test "$ac_cv_lib_ncurses_initscr" != yes; then
-    AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) LIBS="$LIBS -lcurses"])
-    if test "$ac_cv_lib_curses_initscr" != yes; then
-      AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP, 1, [Allow -mCAP environment]) LIBS="$LIBS -ltermcap"])
-    fi
-  fi
-fi
+PKG_CHECK_MODULES(
+    [NCURSES],
+    [ncurses],
+    [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment])
+     AC_DEFINE(USE_NCURSES, 1, [Use ncurses])
+     [LIBS="${LIBS} ${NCURSES_LIBS}"]
+    ]
+)
 
 AC_CHECK_LIB(iconv, iconv_open)