Enable ncurses wide character support
Approved by: delphij (mentor) Tested by: kris on pointyhat (early version), current@
This commit is contained in:
parent
557158de64
commit
31b4134f7b
@ -441,7 +441,7 @@ build32:
|
||||
.for _dir in usr.bin/lex/lib
|
||||
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
|
||||
.endfor
|
||||
.for _dir in lib/ncurses/ncurses lib/libmagic
|
||||
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
|
||||
cd ${.CURDIR}/${_dir}; \
|
||||
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools
|
||||
.endfor
|
||||
@ -921,6 +921,7 @@ build-tools:
|
||||
bin/sh \
|
||||
${_rescue} \
|
||||
lib/ncurses/ncurses \
|
||||
lib/ncurses/ncursesw \
|
||||
${_share} \
|
||||
${_aicasm} \
|
||||
usr.bin/awk \
|
||||
@ -1008,7 +1009,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
|
||||
lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \
|
||||
${_lib_libgssapi} ${_lib_libipx} \
|
||||
lib/libkiconv lib/libkvm lib/libmd \
|
||||
lib/ncurses/ncurses lib/libopie lib/libpam \
|
||||
lib/ncurses/ncurses lib/ncurses/ncursesw \
|
||||
lib/libopie lib/libpam \
|
||||
lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
|
||||
${_lib_libypclnt} lib/libz lib/msun \
|
||||
${_secure_lib_libcrypto} ${_secure_lib_libssh} \
|
||||
|
@ -1,5 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= ncurses form menu panel
|
||||
SUBDIR= ncurses form menu panel \
|
||||
ncursesw formw menuw panelw
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -4,7 +4,14 @@
|
||||
|
||||
NCURSES_DIR= ${.CURDIR}/../../../contrib/ncurses
|
||||
|
||||
.if defined(ENABLE_WIDEC)
|
||||
LIB_SUFFIX= w
|
||||
CFLAGS+= -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC
|
||||
NCURSES_CFG_H= ${.CURDIR}/../ncurses/ncurses_cfg.h
|
||||
.else
|
||||
LIB_SUFFIX=
|
||||
NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h
|
||||
.endif
|
||||
|
||||
CFLAGS+= -I.
|
||||
.if exists(${.OBJDIR}/../ncurses${LIB_SUFFIX})
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
SRCDIR= ${NCURSES_DIR}/form
|
||||
|
||||
LIB= form
|
||||
LIB= form${LIB_SUFFIX}
|
||||
|
||||
.PATH: ${SRCDIR}
|
||||
SRCS= \
|
||||
@ -54,8 +54,8 @@ CLEANFILES= ncurses_def.h
|
||||
CFLAGS+= -I${SRCDIR}
|
||||
CFLAGS+= -I${NCURSES_DIR}/menu
|
||||
|
||||
DPADD= ${LIBNCURSES}
|
||||
LDADD= -lncurses
|
||||
DPADD= ${LIBNCURSES${LIB_SUFFIX:U}}
|
||||
LDADD= -lncurses${LIB_SUFFIX}
|
||||
|
||||
INCS= form.h
|
||||
|
||||
|
5
lib/ncurses/formw/Makefile
Normal file
5
lib/ncurses/formw/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ENABLE_WIDEC=
|
||||
|
||||
.include "${.CURDIR}/../form/Makefile"
|
@ -4,7 +4,7 @@
|
||||
|
||||
SRCDIR= ${NCURSES_DIR}/menu
|
||||
|
||||
LIB= menu
|
||||
LIB= menu${LIB_SUFFIX}
|
||||
|
||||
.PATH: ${SRCDIR}
|
||||
SRCS= \
|
||||
@ -40,8 +40,8 @@ CLEANFILES= ncurses_def.h
|
||||
|
||||
CFLAGS+= -I${SRCDIR}
|
||||
|
||||
DPADD= ${LIBNCURSES}
|
||||
LDADD= -lncurses
|
||||
DPADD= ${LIBNCURSES${LIB_SUFFIX:U}}
|
||||
LDADD= -lncurses${LIB_SUFFIX}
|
||||
|
||||
INCS= menu.h eti.h
|
||||
|
||||
|
5
lib/ncurses/menuw/Makefile
Normal file
5
lib/ncurses/menuw/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ENABLE_WIDEC=
|
||||
|
||||
.include "${.CURDIR}/../menu/Makefile"
|
@ -6,7 +6,7 @@ SHLIBDIR?= /lib
|
||||
|
||||
.include "${.CURDIR}/../config.mk"
|
||||
|
||||
LIB= ncurses
|
||||
LIB= ncurses${LIB_SUFFIX}
|
||||
SHLIB_MAJOR= 6
|
||||
|
||||
NO_LINT=
|
||||
@ -16,8 +16,13 @@ NCURSES_MINOR!= egrep 'NCURSES_MINOR[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^
|
||||
NCURSES_PATCH!= egrep 'NCURSES_PATCH[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%'
|
||||
|
||||
# From autoconf (!)
|
||||
.if defined(ENABLE_WIDEC)
|
||||
NCURSES_CH_T= cchar_t
|
||||
NEED_WCHAR_H= 1
|
||||
.else
|
||||
NCURSES_CH_T= chtype
|
||||
NEED_WCHAR_H= 0
|
||||
.endif
|
||||
NCURSES_CONST= const
|
||||
NCURSES_EXT_COLORS= 0
|
||||
NCURSES_EXT_FUNCS= 1
|
||||
@ -211,6 +216,30 @@ SRCS+= \
|
||||
lib_vidattr.c \
|
||||
tty_update.c
|
||||
|
||||
.if defined(ENABLE_WIDEC)
|
||||
.PATH: ${NCURSES_DIR}/ncurses/widechar
|
||||
SRCS+= \
|
||||
charable.c \
|
||||
lib_add_wch.c \
|
||||
lib_box_set.c \
|
||||
lib_cchar.c \
|
||||
lib_erasewchar.c \
|
||||
lib_get_wch.c \
|
||||
lib_get_wstr.c \
|
||||
lib_hline_set.c \
|
||||
lib_in_wch.c \
|
||||
lib_in_wchnstr.c \
|
||||
lib_ins_wch.c \
|
||||
lib_inwstr.c \
|
||||
lib_pecho_wchar.c \
|
||||
lib_slk_wset.c \
|
||||
lib_unget_wch.c \
|
||||
lib_vid_attr.c \
|
||||
lib_vline_set.c \
|
||||
lib_wacs.c \
|
||||
lib_wunctrl.c
|
||||
.endif
|
||||
|
||||
.PATH: ${NCURSES_DIR}/ncurses/trace
|
||||
SRCS+= \
|
||||
lib_trace.c \
|
||||
@ -249,23 +278,23 @@ INCS= ${HEADERS} ${SRCHDRS}
|
||||
INCSLINKS= curses.h ${INCLUDEDIR}/ncurses.h
|
||||
|
||||
.if !defined(NO_INSTALLLIB)
|
||||
SYMLINKS+= libncurses.a ${LIBDIR}/libcurses.a
|
||||
SYMLINKS+= libncurses.a ${LIBDIR}/libtermcap.a
|
||||
SYMLINKS+= libncurses.a ${LIBDIR}/libtermlib.a
|
||||
SYMLINKS+= libncurses.a ${LIBDIR}/libtinfo.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.a ${LIBDIR}/libcurses${LIB_SUFFIX}.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtermcap${LIB_SUFFIX}.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtermlib${LIB_SUFFIX}.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.a ${LIBDIR}/libtinfo${LIB_SUFFIX}.a
|
||||
.endif
|
||||
.if !defined(NO_PIC)
|
||||
# no need for major at all, it's an ld-time redirection only
|
||||
SYMLINKS+= libncurses.so ${LIBDIR}/libcurses.so
|
||||
SYMLINKS+= libncurses.so ${LIBDIR}/libtermcap.so
|
||||
SYMLINKS+= libncurses.so ${LIBDIR}/libtermlib.so
|
||||
SYMLINKS+= libncurses.so ${LIBDIR}/libtinfo.so
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.so ${LIBDIR}/libcurses${LIB_SUFFIX}.so
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.so ${LIBDIR}/libtermcap${LIB_SUFFIX}.so
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.so ${LIBDIR}/libtermlib${LIB_SUFFIX}.so
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}.so ${LIBDIR}/libtinfo${LIB_SUFFIX}.so
|
||||
.endif
|
||||
.if ${MK_PROFILE} != "no"
|
||||
SYMLINKS+= libncurses_p.a ${LIBDIR}/libcurses_p.a
|
||||
SYMLINKS+= libncurses_p.a ${LIBDIR}/libtermcap_p.a
|
||||
SYMLINKS+= libncurses_p.a ${LIBDIR}/libtermlib_p.a
|
||||
SYMLINKS+= libncurses_p.a ${LIBDIR}/libtinfo_p.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libcurses${LIB_SUFFIX}_p.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libtermcap${LIB_SUFFIX}_p.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libtermlib${LIB_SUFFIX}_p.a
|
||||
SYMLINKS+= libncurses${LIB_SUFFIX}_p.a ${LIBDIR}/libtinfo${LIB_SUFFIX}_p.a
|
||||
.endif
|
||||
|
||||
DOCSDIR= ${SHAREDIR}/doc/ncurses
|
||||
@ -332,6 +361,9 @@ curses.h: curses.head MKkey_defs.sh Caps
|
||||
cat curses.head > $@.new
|
||||
AWK=${AWK} _POSIX2_VERSION=199209 sh ${NCURSES_DIR}/include/MKkey_defs.sh \
|
||||
${NCURSES_DIR}/include/Caps >> $@.new
|
||||
.if defined(ENABLE_WIDEC)
|
||||
cat ${NCURSES_DIR}/include/curses.wide >> $@.new
|
||||
.endif
|
||||
cat ${NCURSES_DIR}/include/curses.tail >> $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
@ -471,6 +503,21 @@ MAN= \
|
||||
resizeterm.3 \
|
||||
wresize.3
|
||||
|
||||
.if defined(ENABLE_WIDEC)
|
||||
MAN+= \
|
||||
curs_add_wch.3 \
|
||||
curs_add_wchstr.3 \
|
||||
curs_addwstr.3 \
|
||||
curs_get_wch.3 \
|
||||
curs_get_wstr.3 \
|
||||
curs_in_wch.3 \
|
||||
curs_in_wchstr.3 \
|
||||
curs_ins_wch.3 \
|
||||
curs_ins_wstr.3 \
|
||||
curs_printw.3 \
|
||||
curs_scanw.3
|
||||
.endif
|
||||
|
||||
CLEANFILES+= ${MAN:M*.3}
|
||||
|
||||
MAN+= term.5 terminfo.5
|
||||
@ -795,6 +842,89 @@ MLINKS= ncurses.3 curses.3 \
|
||||
resizeterm.3 is_term_resized.3 \
|
||||
resizeterm.3 resize_term.3
|
||||
|
||||
.if defined(ENABLE_WIDEC)
|
||||
MLINKS+=curs_add_wch.3 add_wch.3 \
|
||||
curs_add_wch.3 echo_wchar.3 \
|
||||
curs_add_wch.3 mvadd_wch.3 \
|
||||
curs_add_wch.3 mvwadd_wch.3 \
|
||||
curs_add_wch.3 wadd_wch.3 \
|
||||
curs_add_wch.3 wecho_wchar.3 \
|
||||
curs_add_wchstr.3 add_wchnstr.3 \
|
||||
curs_add_wchstr.3 add_wchstr.3 \
|
||||
curs_add_wchstr.3 mvadd_wchnstr.3 \
|
||||
curs_add_wchstr.3 mvadd_wchstr.3 \
|
||||
curs_add_wchstr.3 mvwadd_wchnstr.3 \
|
||||
curs_add_wchstr.3 mvwadd_wchstr.3 \
|
||||
curs_add_wchstr.3 wadd_wchnstr.3 \
|
||||
curs_add_wchstr.3 wadd_wchstr.3 \
|
||||
curs_addwstr.3 addnwstr.3 \
|
||||
curs_addwstr.3 addwstr.3 \
|
||||
curs_addwstr.3 mvaddnwstr.3 \
|
||||
curs_addwstr.3 mvaddwstr.3 \
|
||||
curs_addwstr.3 mvwaddnwstr.3 \
|
||||
curs_addwstr.3 mvwaddwstr.3 \
|
||||
curs_addwstr.3 waddnwstr.3 \
|
||||
curs_addwstr.3 waddwstr.3 \
|
||||
curs_get_wch.3 get_wch.3 \
|
||||
curs_get_wch.3 mvget_wch.3 \
|
||||
curs_get_wch.3 mvwget_wch.3 \
|
||||
curs_get_wch.3 unget_wch.3 \
|
||||
curs_get_wch.3 wget_wch.3 \
|
||||
curs_get_wstr.3 get_wstr.3 \
|
||||
curs_get_wstr.3 getn_wstr.3 \
|
||||
curs_get_wstr.3 mvget_wstr.3 \
|
||||
curs_get_wstr.3 mvgetn_wstr.3 \
|
||||
curs_get_wstr.3 mvwget_wstr.3 \
|
||||
curs_get_wstr.3 mvwgetn_wstr.3 \
|
||||
curs_get_wstr.3 wget_wstr.3 \
|
||||
curs_get_wstr.3 wgetn_wstr.3 \
|
||||
curs_in_wch.3 in_wch.3 \
|
||||
curs_in_wch.3 mvin_wch.3 \
|
||||
curs_in_wch.3 mvwin_wch.3 \
|
||||
curs_in_wch.3 win_wch.3 \
|
||||
curs_in_wchstr.3 in_wchnstr.3 \
|
||||
curs_in_wchstr.3 in_wchstr.3 \
|
||||
curs_in_wchstr.3 mvin_wchnstr.3 \
|
||||
curs_in_wchstr.3 mvin_wchstr.3 \
|
||||
curs_in_wchstr.3 mvwin_wchnstr.3 \
|
||||
curs_in_wchstr.3 mvwin_wchstr.3 \
|
||||
curs_in_wchstr.3 win_wchnstr.3 \
|
||||
curs_in_wchstr.3 win_wchstr.3 \
|
||||
curs_ins_wch.3 ins_wch.3 \
|
||||
curs_ins_wch.3 mvins_wch.3 \
|
||||
curs_ins_wch.3 mvwins_wch.3 \
|
||||
curs_ins_wch.3 wins_wch.3 \
|
||||
curs_ins_wstr.3 ins_nwstr.3 \
|
||||
curs_ins_wstr.3 ins_wstr.3 \
|
||||
curs_ins_wstr.3 mvins_nwstr.3 \
|
||||
curs_ins_wstr.3 mvins_wstr.3 \
|
||||
curs_ins_wstr.3 mvwins_nwstr.3 \
|
||||
curs_ins_wstr.3 mvwins_wstr.3 \
|
||||
curs_ins_wstr.3 wins_nwstr.3 \
|
||||
curs_ins_wstr.3 wins_wstr.3 \
|
||||
curs_inwstr.3 innwstr.3 \
|
||||
curs_inwstr.3 inwstr.3 \
|
||||
curs_inwstr.3 mvinnwstr.3 \
|
||||
curs_inwstr.3 mvinwstr.3 \
|
||||
curs_inwstr.3 mvwinnwstr.3 \
|
||||
curs_inwstr.3 mvwinwstr.3 \
|
||||
curs_inwstr.3 winnwstr.3 \
|
||||
curs_inwstr.3 winwstr.3 \
|
||||
curs_printw.3 mvprintw.3 \
|
||||
curs_printw.3 mvwprintw.3 \
|
||||
curs_printw.3 printw.3 \
|
||||
curs_printw.3 vw_printw.3 \
|
||||
curs_printw.3 vwprintw.3 \
|
||||
curs_printw.3 wprintw.3 \
|
||||
curs_scanw.3 mvscanw.3 \
|
||||
curs_scanw.3 mvwscanw.3 \
|
||||
curs_scanw.3 scanw.3 \
|
||||
curs_scanw.3 vw_scanw.3 \
|
||||
curs_scanw.3 vwscanw.3 \
|
||||
curs_scanw.3 wscanw.3
|
||||
.endif
|
||||
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
# Keep the .SUFFIXES line after the include of bsd.lib.mk
|
||||
|
@ -142,7 +142,6 @@
|
||||
#define HAVE_WORKING_POLL 1
|
||||
#define HAVE_WRESIZE 1
|
||||
#define MIXEDCASE_FILENAMES 1
|
||||
#define MIXEDCASE_FILENAMES 1
|
||||
#define NCURSES_EXT_FUNCS 1
|
||||
#define NCURSES_NO_PADDING 1
|
||||
#define NCURSES_PATHSEP ':'
|
||||
@ -164,6 +163,18 @@
|
||||
#define USE_STDIO_VSCAN 1
|
||||
#define USE_SYSMOUSE 1
|
||||
#define USE_TERMCAP 1
|
||||
#ifdef ENABLE_WIDEC
|
||||
#define USE_WIDEC_SUPPORT 1
|
||||
#define HAVE_PUTWC 1
|
||||
#define HAVE_BTOWC 1
|
||||
#define HAVE_WCTOB 1
|
||||
#define HAVE_MBTOWC 1
|
||||
#define HAVE_WCTOMB 1
|
||||
#define HAVE_MBLEN 1
|
||||
#define HAVE_MBRLEN 1
|
||||
#define HAVE_MBRTOWC 1
|
||||
#define NEED_WCHAR_H 1
|
||||
#endif
|
||||
|
||||
#include <ncurses_def.h>
|
||||
|
||||
|
7
lib/ncurses/ncursesw/Makefile
Normal file
7
lib/ncurses/ncursesw/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ENABLE_WIDEC=
|
||||
|
||||
.PATH: ${.CURDIR}/../ncurses
|
||||
|
||||
.include "${.CURDIR}/../ncurses/Makefile"
|
@ -4,7 +4,7 @@
|
||||
|
||||
SRCDIR= ${NCURSES_DIR}/panel
|
||||
|
||||
LIB= panel
|
||||
LIB= panel${LIB_SUFFIX}
|
||||
|
||||
.PATH: ${SRCDIR}
|
||||
SRCS= \
|
||||
@ -29,8 +29,8 @@ CLEANFILES= ncurses_def.h
|
||||
|
||||
CFLAGS+= -I${SRCDIR}
|
||||
|
||||
DPADD= ${LIBNCURSES}
|
||||
LDADD= -lncurses
|
||||
DPADD= ${LIBNCURSES${LIB_SUFFIX:U}}
|
||||
LDADD= -lncurses${LIB_SUFFIX}
|
||||
|
||||
INCS= panel.h
|
||||
|
||||
|
5
lib/ncurses/panelw/Makefile
Normal file
5
lib/ncurses/panelw/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ENABLE_WIDEC=
|
||||
|
||||
.include "${.CURDIR}/../panel/Makefile"
|
@ -85,6 +85,7 @@ LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a
|
||||
LIBNCP?= ${DESTDIR}${LIBDIR}/libncp.a
|
||||
.endif
|
||||
LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a
|
||||
LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a
|
||||
LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a
|
||||
LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a
|
||||
LIBOBJC?= ${DESTDIR}${LIBDIR}/libobjc.a
|
||||
|
Loading…
Reference in New Issue
Block a user