Add /usr.bin/tic: terminfo entry-description compiler
authorJohn Marino <draco@marino.st>
Mon, 14 May 2012 08:38:29 +0000 (10:38 +0200)
committerJohn Marino <draco@marino.st>
Mon, 14 May 2012 10:24:32 +0000 (12:24 +0200)
The tic program is required to create the terminfo database.

usr.bin/Makefile
usr.bin/tic/Makefile [new file with mode: 0644]
usr.bin/tic/transform.h [new file with mode: 0644]

index 62e973e..3e67efc 100644 (file)
@@ -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 (file)
index 0000000..75924de
--- /dev/null
@@ -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 <bsd.prog.mk>
\ No newline at end of file
diff --git a/usr.bin/tic/transform.h b/usr.bin/tic/transform.h
new file mode 100644 (file)
index 0000000..708938f
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __TRANSFORM_H
+#define __TRANSFORM_H 1
+#include <progs.priv.h>
+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 */