HardenedBSD/usr.sbin/kbdcontrol/Makefile
Jessica Clarke 968a3db715 kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD
Systems that predate 971bac5ace ("kbd: consolidate kb interfaces
(phase one)") cannot build kbdcontrol since kbdelays and kbrates moved
to sys/kbio.h. Moreover, on non-FreeBSD, it requires all kinds of ioctls
and sysctls that are highly FreeBSD-specific to build, but we use it as
a bootstrap tool to generate the keymaps used by some kernels (LINT ones
in particular). Thus, when bootstrapping kbdcontrol, disable everything
that's not needed for that singular use, and use the in-tree kbio.h to
get the definitions of the necessary structures.

This allows KBDMUX_DFLT_KEYMAP, UKBD_DFLT_KEYMAP and ATKBD_DFLT_KEYMAP
to be enabled when building on non-FreeBSD, and thus LINT kernels.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41541
2023-08-22 21:00:28 +01:00

20 lines
386 B
Makefile

PACKAGE= console-tools
PROG= kbdcontrol
MAN= kbdcontrol.1 kbdmap.5
MLINKS= kbdmap.5 keymap.5
SRCS= kbdcontrol.c lex.l
WARNS?= 4
CFLAGS+= -I${.CURDIR}
.ifdef BOOTSTRAPPING
# Provide minimal load and dump functionality
CFLAGS+= -DBOOTSTRAP_KBDCONTROL
.else
# temporarily added for pre-Unicode accent key API/ABI compatibility
CFLAGS+= -DCOMPAT_FREEBSD13
.endif
.include <bsd.prog.mk>