blob: 137c433527b63fd353384307a26722c891898bdc [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001--- a/configure.ac
2+++ b/configure.ac
3@@ -5839,20 +5839,13 @@ if test "$with_readline" != no; then
4 # library. NOTE: Keep the precedence of listed libraries synchronised
5 # with setup.py.
6 AC_MSG_CHECKING([how to link readline libs])
7- for py_libtermcap in "" tinfo ncursesw ncurses curses termcap; do
8- if test -z "$py_libtermcap"; then
9- READLINE_LIBS="-l$LIBREADLINE"
10- else
11- READLINE_LIBS="-l$LIBREADLINE -l$py_libtermcap"
12- fi
13- LIBS="$READLINE_LIBS $LIBS_no_readline"
14- AC_LINK_IFELSE(
15- [AC_LANG_CALL([],[readline])],
16- [py_cv_lib_readline=yes])
17- if test $py_cv_lib_readline = yes; then
18- break
19- fi
20- done
21+ PKG_CHECK_MODULES_STATIC(
22+ [READLINE], [readline], [
23+ py_cv_lib_readline=yes
24+ AC_DEFINE(HAVE_LIBREADLINE, 1,
25+ [Define to build the readline module.])
26+ ], py_cv_lib_readline=no
27+ )
28
29 # Uncomment this line if you want to use READLINE_LIBS in Makefile or scripts
30 #AC_SUBST([READLINE_LIBS])
31@@ -5860,8 +5853,6 @@ if test "$with_readline" != no; then
32 AC_MSG_RESULT([none])
33 else
34 AC_MSG_RESULT([$READLINE_LIBS])
35- AC_DEFINE(HAVE_LIBREADLINE, 1,
36- [Define to build the readline module.])
37 fi
38 fi
39
40@@ -6099,12 +6090,6 @@ then
41 [Define if you have struct stat.st_mtimensec])
42 fi
43
44-# first curses header check
45-ac_save_cppflags="$CPPFLAGS"
46-if test "$cross_compiling" = no; then
47- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
48-fi
49-
50 AC_CHECK_HEADERS(curses.h ncurses.h)
51
52 # On Solaris, term.h requires curses.h