Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a4f561

Browse files
committed
- Issue #21285: Refactor and fix curses configure check to always search
in a ncursesw directory.
1 parent 4a173bc commit 1a4f561

3 files changed

Lines changed: 53 additions & 38 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ IDLE
174174
Build
175175
-----
176176

177+
- Issue #21285: Refactor and fix curses configure check to always search
178+
in a ncursesw directory.
179+
177180
- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
178181
include directories if they aren't already being searched. This avoids
179182
an explicit runtime library dependency.

configure

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6969,11 +6969,9 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
69696969

69706970
fi
69716971

6972-
ac_save_cppflags="$CPPFLAGS"
6973-
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
6974-
for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
6972+
for ac_header in asm/types.h conio.h direct.h dlfcn.h errno.h \
69756973
fcntl.h grp.h \
6976-
ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
6974+
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
69776975
sched.h shadow.h signal.h stdint.h stropts.h termios.h \
69786976
unistd.h utime.h \
69796977
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
@@ -6997,7 +6995,6 @@ fi
69976995

69986996
done
69996997

7000-
CPPFLAGS=$ac_save_cppflags
70016998
ac_header_dirent=no
70026999
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
70037000
as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
@@ -7234,26 +7231,6 @@ fi
72347231
done
72357232

72367233

7237-
7238-
# On Solaris, term.h requires curses.h
7239-
for ac_header in term.h
7240-
do :
7241-
ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "
7242-
#ifdef HAVE_CURSES_H
7243-
#include <curses.h>
7244-
#endif
7245-
7246-
"
7247-
if test "x$ac_cv_header_term_h" = xyes; then :
7248-
cat >>confdefs.h <<_ACEOF
7249-
#define HAVE_TERM_H 1
7250-
_ACEOF
7251-
7252-
fi
7253-
7254-
done
7255-
7256-
72577234
# On Linux, netlink.h requires asm/types.h
72587235
for ac_header in linux/netlink.h
72597236
do :
@@ -14677,8 +14654,43 @@ $as_echo "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h
1467714654

1467814655
fi
1467914656

14657+
# first curses header check
1468014658
ac_save_cppflags="$CPPFLAGS"
1468114659
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
14660+
14661+
for ac_header in curses.h ncurses.h
14662+
do :
14663+
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
14664+
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
14665+
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
14666+
cat >>confdefs.h <<_ACEOF
14667+
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
14668+
_ACEOF
14669+
14670+
fi
14671+
14672+
done
14673+
14674+
14675+
# On Solaris, term.h requires curses.h
14676+
for ac_header in term.h
14677+
do :
14678+
ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "
14679+
#ifdef HAVE_CURSES_H
14680+
#include <curses.h>
14681+
#endif
14682+
14683+
"
14684+
if test "x$ac_cv_header_term_h" = xyes; then :
14685+
cat >>confdefs.h <<_ACEOF
14686+
#define HAVE_TERM_H 1
14687+
_ACEOF
14688+
14689+
fi
14690+
14691+
done
14692+
14693+
1468214694
# On HP/UX 11.0, mvwdelch is a block with a return statement
1468314695
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5
1468414696
$as_echo_n "checking whether mvwdelch is an expression... " >&6; }

configure.ac

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,11 +1546,9 @@ dnl AC_MSG_RESULT($cpp_type)
15461546

15471547
# checks for header files
15481548
AC_HEADER_STDC
1549-
ac_save_cppflags="$CPPFLAGS"
1550-
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
1551-
AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
1549+
AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
15521550
fcntl.h grp.h \
1553-
ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
1551+
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
15541552
sched.h shadow.h signal.h stdint.h stropts.h termios.h \
15551553
unistd.h utime.h \
15561554
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
@@ -1562,7 +1560,6 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
15621560
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
15631561
bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \
15641562
sys/endian.h)
1565-
CPPFLAGS=$ac_save_cppflags
15661563
AC_HEADER_DIRENT
15671564
AC_HEADER_MAJOR
15681565

@@ -1582,14 +1579,6 @@ AC_CHECK_HEADERS([net/if.h], [], [],
15821579
#endif
15831580
])
15841581

1585-
1586-
# On Solaris, term.h requires curses.h
1587-
AC_CHECK_HEADERS(term.h,,,[
1588-
#ifdef HAVE_CURSES_H
1589-
#include <curses.h>
1590-
#endif
1591-
])
1592-
15931582
# On Linux, netlink.h requires asm/types.h
15941583
AC_CHECK_HEADERS(linux/netlink.h,,,[
15951584
#ifdef HAVE_ASM_TYPES_H
@@ -4391,8 +4380,19 @@ then
43914380
[Define if you have struct stat.st_mtimensec])
43924381
fi
43934382

4383+
# first curses header check
43944384
ac_save_cppflags="$CPPFLAGS"
43954385
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
4386+
4387+
AC_CHECK_HEADERS(curses.h ncurses.h)
4388+
4389+
# On Solaris, term.h requires curses.h
4390+
AC_CHECK_HEADERS(term.h,,,[
4391+
#ifdef HAVE_CURSES_H
4392+
#include <curses.h>
4393+
#endif
4394+
])
4395+
43964396
# On HP/UX 11.0, mvwdelch is a block with a return statement
43974397
AC_MSG_CHECKING(whether mvwdelch is an expression)
43984398
AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,

0 commit comments

Comments
 (0)