From 9e71362f55314ef99f915b086e032a7b099f4568 Mon Sep 17 00:00:00 2001 From: John Marino Date: Mon, 14 May 2012 10:38:29 +0200 Subject: [PATCH] Add /usr.bin/tic: terminfo entry-description compiler The tic program is required to create the terminfo database. --- usr.bin/Makefile | 1 + usr.bin/tic/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++ usr.bin/tic/transform.h | 9 ++++++++ 3 files changed, 59 insertions(+), 0 deletions(-) create mode 100644 usr.bin/tic/Makefile create mode 100644 usr.bin/tic/transform.h diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 62e973e..3e67efc 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -193,6 +193,7 @@ SUBDIR= alias \ telnet \ tftp \ time \ + tic \ tip \ top \ touch \ diff --git a/usr.bin/tic/Makefile b/usr.bin/tic/Makefile new file mode 100644 index 0000000..75924de --- /dev/null +++ b/usr.bin/tic/Makefile @@ -0,0 +1,49 @@ +NCURSESDIR= ${.CURDIR}/../../contrib/ncurses +TERMINFO_CAPS= ${NCURSESDIR}/include/Caps +PROGSDIR= ${NCURSESDIR}/progs +.PATH: ${PROGSDIR} + +PROG= tic +NOMAN= + +CFLAGS+= -D_XOPEN_SOURCE_EXTENDED +CFLAGS+= -DENABLE_WIDEC +CFLAGS+= -DSET_NCURSES_CH_T=cchar_t +CFLAGS+= -DSET_NEED_WCHAR_H=1 +CFLAGS+= -I${PROGSDIR} +CFLAGS+= -I. +CFLAGS+= -I${NCURSESDIR}/include +CFLAGS+= -I${.CURDIR}/../../lib/libncurses/include +CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.OBJDIR} + +DPADD= ${LIBNCURSES} ${LIBNCURSESW} +LDADD= -lncurses -lncursesw + +ncurses_def.h: + AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \ + ${NCURSESDIR}/include/ncurses_defs > ${.TARGET} + +parametrized.h: + AWK=awk sh ${NCURSESDIR}/include/MKparametrized.sh \ + ${TERMINFO_CAPS} > ${.TARGET} + +# Hack: It's really termsort.c, but bootstrap stage chokes on it +termsort.h: + sh ${PROGSDIR}/MKtermsort.sh awk ${TERMINFO_CAPS} > termsort.c + +tic.o: ${PROGSDIR}/tic.c + ${CC} ${CFLAGS} -c ${PROGSDIR}/tic.c -o ${.TARGET} + +transform.o: ${PROGSDIR}/transform.c + ${CC} ${CFLAGS} -c ${PROGSDIR}/transform.c -o ${.TARGET} + +dump_entry.o: ${PROGSDIR}/dump_entry.c termsort.h + ${CC} ${CFLAGS} -c ${PROGSDIR}/dump_entry.c -o ${.TARGET} + +CLEANFILES= ncurses_def.h parametrized.h termsort.c + +SRCS= ncurses_def.h parametrized.h termsort.h +SRCS+= tic.c dump_entry.c transform.c + +.include \ No newline at end of file diff --git a/usr.bin/tic/transform.h b/usr.bin/tic/transform.h new file mode 100644 index 0000000..708938f --- /dev/null +++ b/usr.bin/tic/transform.h @@ -0,0 +1,9 @@ +#ifndef __TRANSFORM_H +#define __TRANSFORM_H 1 +#include +extern bool same_program(const char *, const char *); +#define PROG_CAPTOINFO "captoinfo" +#define PROG_INFOTOCAP "infotocap" +#define PROG_RESET "reset" +#define PROG_INIT "init" +#endif /* __TRANSFORM_H */ -- 1.7.7.2