Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -356,6 +356,7 @@ COMPILER_FEATURES \ COMPILER_FREEBSD_VERSION \ COMPILER_RESOURCE_DIR \ + COMPILER_ABSOLUTE_PATH \ LINKER_VERSION \ LINKER_FEATURES \ LINKER_TYPE \ @@ -792,8 +793,12 @@ HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT .endif +# Note: Currently BUILD_TOOLS_CC does not add -legacy since all build-tools are +# simple tools that compile without custom flags on all supported build hosts. +# If this changes in the future we can add the required -I flags and -legacy CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ + BUILD_TOOLS_CC="${COMPILER_ABSOLUTE_PATH} -B${COMPILER_ABSOLUTE_PATH:H} ${CFLAGS} ${LDFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" LLVM_LINK="${XLLVM_LINK}" \ NM=${XNM} OBJCOPY="${XOBJCOPY}" \ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ @@ -2515,27 +2520,6 @@ # # build-tools: Build special purpose build tools # -.if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" -_share= share/syscons/scrnmaps -.endif - -.if ${MK_RESCUE} != "no" -# rescue includes programs that have build-tools targets -_rescue=rescue/rescue -.endif - -.if ${MK_TCSH} != "no" -_tcsh=bin/csh -.endif -.if ${MK_FILE} != "no" -_libmagic=lib/libmagic -.endif - -.if ${MK_PMC} != "no" && \ - (${TARGET_ARCH} == "aarch64" || ${TARGET_ARCH} == "amd64" || \ - ${TARGET_ARCH} == "i386") -_jevents=lib/libpmc/pmu-events -.endif # kernel-toolchain skips _cleanobj, so handle cleaning up previous # build-tools directories if needed. @@ -2543,17 +2527,11 @@ _bt_clean= ${CLEANDIR} .endif -.for _tool in \ - ${_tcsh} \ - bin/sh \ - ${LOCAL_TOOL_DIRS} \ - ${_jevents} \ - lib/ncurses/ncurses \ - ${_rescue} \ - ${_share} \ - usr.bin/awk \ - ${_libmagic} \ - usr.bin/vi/catalog +.if !empty(LOCAL_TOOL_DIRS) +.warning "LOCAL_TOOL_DIRS is deprecated, please use BUILD_TOOLS_CC instead" +.endif + +.for _tool in ${LOCAL_TOOL_DIRS} build-tools_${_tool}: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \ cd ${.CURDIR}/${_tool}; \ Index: Makefile.libcompat =================================================================== --- Makefile.libcompat +++ Makefile.libcompat @@ -16,10 +16,6 @@ LIBDIR=/usr/lib${libcompat} \ SHLIBDIR=/usr/lib${libcompat} \ DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}" -.if ${MK_META_MODE} != "no" -# Don't rebuild build-tools targets during normal build. -LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA -.endif LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \ CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ @@ -48,14 +44,6 @@ lib/ncurses/ncurses \ ${_LC_LIBDIRS.yes} -.if ${MK_FILE} != "no" -_libmagic= lib/libmagic -.endif -.if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64" -_jevents= lib/libpmc/pmu-events -.endif - - # Shared logic build${libcompat}: .PHONY @echo @@ -93,20 +81,6 @@ ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \ DIRPRFX=${_dir}/ ${_t} .endfor -.endfor -.for _dir in lib/ncurses/ncurses ${_libmagic} ${_jevents} -.for _t in ${_obj} build-tools - ${_+_}cd ${.CURDIR}/${_dir}; \ - WORLDTMP=${WORLDTMP} \ - MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - ${MAKE} SSP_CFLAGS= DESTDIR= \ - OBJTOP=${LIBCOMPAT_OBJTOP} \ - OBJROOT='$${OBJTOP}/' \ - MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ - MK_CTF=no MK_RETPOLINE=no MK_WERROR=no \ - ${_t} -.endfor .endfor ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries Index: bin/csh/Makefile =================================================================== --- bin/csh/Makefile +++ bin/csh/Makefile @@ -115,18 +115,16 @@ csh.1: tcsh.man cat ${.ALLSRC} > ${.TARGET} -build-tools: gethost - DEPENDOBJS+= gethost -gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} +gethost: gethost.c sh.err.h tc.const.h sh.h @rm -f ${.TARGET} - ${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ + ${BUILD_TOOLS_CC} -o gethost -I. -I${.CURDIR} -I${TCSHDIR} \ ${TCSHDIR}/gethost.c tc.defs.c: gethost ${TCSHDIR}/host.defs @rm -f ${.TARGET} @echo "/* Do not edit this file, make creates it */" > ${.TARGET} - ${BTOOLSPATH:U.}/gethost ${TCSHDIR}/host.defs >> ${.TARGET} + ./gethost ${TCSHDIR}/host.defs >> ${.TARGET} ed.defns.h: ed.defns.c @rm -f ${.TARGET} @@ -144,7 +142,7 @@ grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET} @echo '#endif /* _h_sh_err */' >> ${.TARGET} -tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h ${BUILD_TOOLS_META} +tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h @rm -f ${.TARGET} @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} @echo '#ifndef _h_tc_const' >> ${.TARGET} Index: bin/sh/Makefile =================================================================== --- bin/sh/Makefile +++ bin/sh/Makefile @@ -39,25 +39,26 @@ CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} -build-tools: mknodes mksyntax - .ORDER: builtins.c builtins.h builtins.h: .NOMETA builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} DEPENDOBJS+= mknodes mksyntax -mknodes mksyntax: ${BUILD_TOOLS_META} +mknodes: mknodes.c + ${BUILD_TOOLS_CC} ${.IMPSRC} -o ${.TARGET} +mksyntax: mksyntax.c + ${BUILD_TOOLS_CC} ${.IMPSRC} -o ${.TARGET} .ORDER: nodes.c nodes.h nodes.h: .NOMETA nodes.c nodes.h: mknodes nodetypes nodes.c.pat - ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat + ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat .ORDER: syntax.c syntax.h syntax.h: .NOMETA syntax.c syntax.h: mksyntax - ${BTOOLSPATH:U.}/mksyntax + ./mksyntax token.h: mktokens sh ${.CURDIR}/mktokens Index: lib/libmagic/Makefile =================================================================== --- lib/libmagic/Makefile +++ lib/libmagic/Makefile @@ -22,8 +22,10 @@ MAGICPATH?= /usr/share/misc -CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H -CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${CONTRDIR}/src +COMMON_CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H +COMMON_CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${CONTRDIR}/src +CFLAGS+= ${COMMON_CFLAGS} +MKMAGIC_CFLAGS+=${COMMON_CFLAGS} WARNS?= 3 @@ -53,22 +55,14 @@ cat ${.ALLSRC:O} > ${.TARGET} magic.mgc: magic - ${BTOOLSPATH:U.}/mkmagic magic + ./mkmagic magic -.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" CLEANFILES+= mkmagic DEPENDOBJS+= mkmagic -build-tools: mkmagic -mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \ +mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} + ${BUILD_TOOLS_CC} ${MKMAGIC_CFLAGS} -DCOMPILE_ONLY -o ${.TARGET} \ ${.ALLSRC:N*.h:O:u} ${LDADD} - -.endif -.if ${MK_DIRDEPS_BUILD} == "yes" -BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} -.else magic.mgc: mkmagic -.endif FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ ${.CURDIR}/config.h Index: lib/libmagic/config.h =================================================================== --- lib/libmagic/config.h +++ lib/libmagic/config.h @@ -1,12 +1,14 @@ /* $FreeBSD$ */ /* Get __FreeBSD_version. */ +#ifdef __FreeBSD__ #include /* Only specific versions of FreeBSD support xlocale */ #if __FreeBSD_version >= 1000002 || (__FreeBSD_version < 1000000 && __FreeBSD_version >= 900506) #define FREEBSD_XLOCALE_SUPPORT 1 #endif +#endif /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ Index: lib/libpmc/Makefile =================================================================== --- lib/libpmc/Makefile +++ lib/libpmc/Makefile @@ -18,22 +18,13 @@ EVENT_ARCH="powerpc" .endif -.if ${MK_DIRDEPS_BUILD} == "yes" -# avoid circular dependency -GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat -JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents -.else -JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents +CLEANFILES+=jevents +jevents: pmu-events/jevents.c pmu-events/jsmn.c pmu-events/json.c + ${BUILD_TOOLS_CC} ${.ALLSRC:M*.c} -I${.CURDIR}/pmu-events \ + -Wno-cast-qual -o ${.TARGET} -# This file is built in a subdirectory so never try to rebuild it here. -${JEVENTS}: .PHONY -.if make(*clean*) -SUBDIR+= pmu-events -.endif -.endif - -libpmc_events.c: ${JEVENTS} .META - ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch ${.TARGET}.tmp +libpmc_events.c: jevents .META + ./jevents ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch ${.TARGET}.tmp if [ ! -e ${.TARGET} ] || ! cmp -s ${.TARGET} ${.TARGET}.tmp; then \ mv -f ${.TARGET}.tmp ${.TARGET}; \ fi Index: lib/libpmc/pmu-events/Makefile =================================================================== --- lib/libpmc/pmu-events/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -PROG= jevents -SRCS= jevents.c jsmn.c json.c -CFLAGS+= -Wno-cast-qual -MAN= - -build-tools: jevents - -.include Index: lib/ncurses/ncurses/Makefile =================================================================== --- lib/ncurses/ncurses/Makefile +++ lib/ncurses/ncurses/Makefile @@ -353,7 +353,7 @@ echo | ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} > unctrl.c comp_captab.c: MKcaptab.sh MKcaptab.awk Caps Caps-ncurses make_hash - env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ + env PATH=.:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ ${USE_BIG_STRINGS} ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.awk \ ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > comp_captab.c @@ -365,7 +365,7 @@ mv -f ${.TARGET}.tmp ${.TARGET} comp_userdefs.c: MKuserdefs.sh Caps Caps-ncurses make_hash - env PATH=${BTOOLSPATH:U.}:${PATH} sh -x ${NCURSES_DIR}/ncurses/tinfo/MKuserdefs.sh "${AWK}" \ + env PATH=.:${PATH} sh -x ${NCURSES_DIR}/ncurses/tinfo/MKuserdefs.sh "${AWK}" \ ${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > ${.TARGET} # Generated headers @@ -374,7 +374,7 @@ "${AWK}" generated < curses.h | fgrep undef > $@ init_keytry.h: keys.list make_keys - ${BTOOLSPATH:U.}/make_keys keys.list > init_keytry.h + ./make_keys keys.list > init_keytry.h hashsize.h: MKhashsize.sh Caps Caps-ncurses sh ${NCURSES_DIR}/include/MKhashsize.sh ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > $@ @@ -403,14 +403,16 @@ # Build tools DEPENDOBJS+= make_hash make_keys -build-tools: make_hash make_keys +BUILD_TOOLS_CFLAGS+= -I. -I${.CURDIR}/../ncurses +BUILD_TOOLS_CFLAGS+= -I${NCURSES_DIR}/ncurses -I${NCURSES_DIR}/include -make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c +make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${SRCHDRS} + ${BUILD_TOOLS_CC} -o ${.TARGET} ${BUILD_TOOLS_CFLAGS} \ + ${NCURSES_DIR}/ncurses/tinfo/make_keys.c -make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ - ${NCURSES_DIR}/ncurses/tinfo/make_hash.c +make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${SRCHDRS} + ${BUILD_TOOLS_CC} -o ${.TARGET} ${BUILD_TOOLS_CFLAGS} -DMAIN_PROGRAM \ + ${NCURSES_DIR}/ncurses/tinfo/make_hash.c # ./configure generated MKterm.h.awk: MKterm.h.awk.in Index: rescue/rescue/Makefile =================================================================== --- rescue/rescue/Makefile +++ rescue/rescue/Makefile @@ -56,7 +56,6 @@ pkill ps pwd realpath rm rmdir setfacl sh sleep stty \ sync test CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -lelf -ltermcapw -lutil -lxo -CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs CRUNCH_ALIAS_test= [ @@ -71,7 +70,6 @@ .if ${MK_TCSH} != "no" CRUNCH_PROGS_bin+= csh CRUNCH_ALIAS_csh= -csh tcsh -tcsh -CRUNCH_BUILDTOOLS+= bin/csh CRUNCH_SUPPRESS_LINK_-csh= 1 CRUNCH_SUPPRESS_LINK_-tcsh= 1 .endif Index: share/mk/bsd.compiler.mk =================================================================== --- share/mk/bsd.compiler.mk +++ share/mk/bsd.compiler.mk @@ -144,7 +144,8 @@ # The value is only used/exported for the same environment that impacts # CC and COMPILER_* settings here. _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ - ${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR + ${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR \ + ${X_}COMPILER_ABSOLUTE_PATH ${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} ${X_}_cc_hash:= ${${X_}_cc_hash:hash} # Only import if none of the vars are set differently somehow else. @@ -218,6 +219,16 @@ ${X_}COMPILER_FEATURES+= retpoline init-all .endif +.if ${${cc}:N${CCACHE_BIN}:[1]:M/*} && exists(${${cc}:N${CCACHE_BIN}:[1]}) +${X_}COMPILER_ABSOLUTE_PATH= ${${cc}:N${CCACHE_BIN}:[1]} +.else +${X_}COMPILER_ABSOLUTE_PATH!= which ${${cc}:N${CCACHE_BIN}:[1]} +.endif +.if empty(${X_}COMPILER_ABSOLUTE_PATH) +.error Could not find $$CC (${${cc}:N${CCACHE_BIN}:[1]}) in $$PATH. \ + Please pass an absolute path to CC instead. +.endif + .else # Use CC's values X_COMPILER_TYPE= ${COMPILER_TYPE} @@ -225,6 +236,7 @@ X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION} X_COMPILER_FEATURES= ${COMPILER_FEATURES} X_COMPILER_RESOURCE_DIR= ${COMPILER_RESOURCE_DIR} +X_COMPILER_ABSOLUTE_PATH= ${COMPILER_ABSOLUTE_PATH} .endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) # Export the values so sub-makes don't have to look them up again, using the Index: share/mk/bsd.crunchgen.mk =================================================================== --- share/mk/bsd.crunchgen.mk +++ share/mk/bsd.crunchgen.mk @@ -11,8 +11,6 @@ # CRUNCH_LIBS: libraries to statically link with # CRUNCH_SHLIBS: libraries to dynamically link with # CRUNCH_BUILDOPTS: generic build options to be added to every program -# CRUNCH_BUILDTOOLS: lists programs that need build tools built in the -# local architecture. # # Special options can be specified for individual programs # CRUNCH_SRCDIR_${P}: base source directory for program ${P} @@ -140,18 +138,6 @@ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ ${MAKE} -f ${OUTMK} ${CRUNCHARGS} BUILD_TOOLS_META=.NOMETA objs -# Someone should replace the bin/csh and bin/sh build-tools with -# shell scripts so we can remove this nonsense. -.for _tool in ${CRUNCH_BUILDTOOLS} -build-tools-${_tool}: - ${_+_}cd ${.CURDIR}/../../${_tool}; \ - if [ "${MK_AUTO_OBJ}" = "no" ]; then \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - fi; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools -build-tools: build-tools-${_tool} -.endfor - # Use a separate build tree to hold files compiled for this crunchgen binary # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard Index: share/syscons/scrnmaps/Makefile =================================================================== --- share/syscons/scrnmaps/Makefile +++ share/syscons/scrnmaps/Makefile @@ -13,15 +13,14 @@ FILESDIR= ${SHAREDIR}/syscons/scrnmaps DEPENDOBJS+= ${SCRMAPS_MK} -build-tools: ${SCRMAPS_MK} ${SCRMAPS}: ${.TARGET:R}.mk - ${BTOOLSPATH:U.}/${.TARGET:R}.mk ${.TARGET:R}.tmp + ./${.TARGET:R}.mk ${.TARGET:R}.tmp uuencode ${.TARGET:R}.tmp ${.TARGET:R} > ${.TARGET} rm -f ${.TARGET:R}.tmp -${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" \ - ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/mkscrfil.c +${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c + ${BUILD_TOOLS_CC} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" \ + -o ${.TARGET} ${.CURDIR}/mkscrfil.c .include Index: share/syscons/scrnmaps/mkscrfil.c =================================================================== --- share/syscons/scrnmaps/mkscrfil.c +++ share/syscons/scrnmaps/mkscrfil.c @@ -28,8 +28,8 @@ * $FreeBSD$ */ -#include -#include +/* Use a relative path to always use the scrmap_t definition of the target. */ +#include "../../../sys/sys/_scrmap.h" #include #include FIL Index: sys/sys/_scrmap.h =================================================================== --- /dev/null +++ sys/sys/_scrmap.h @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1991-1996 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _SYS__SCRMAP_H_ +#define _SYS__SCRMAP_H_ + +struct _scrmap { + char scrmap[256]; +}; +typedef struct _scrmap scrmap_t; + +#endif Index: sys/sys/consio.h =================================================================== --- sys/sys/consio.h +++ sys/sys/consio.h @@ -36,6 +36,7 @@ #ifndef _KERNEL #include #endif +#include #include #include @@ -68,11 +69,6 @@ #define KDRASTER _IOW('K', 100, scr_size_t) /* get/set screen char map */ -struct _scrmap { - char scrmap[256]; -}; -typedef struct _scrmap scrmap_t; - #define GIO_SCRNMAP _IOR('k', 2, scrmap_t) #define PIO_SCRNMAP _IOW('k', 3, scrmap_t) Index: tools/bsdbox/Makefile =================================================================== --- tools/bsdbox/Makefile +++ tools/bsdbox/Makefile @@ -20,8 +20,6 @@ # CRUNCH_LIBS: libraries to statically link with # CRUNCH_SHLIBS: libraries to dynamically link with # CRUNCH_BUILDOPTS: generic build options to be added to every program -# CRUNCH_BUILDTOOLS: lists programs that need build tools built in the -# local architecture. # # Special options can be specified for individual programs # CRUNCH_SRCDIR_$(P): base source directory for program $(P) @@ -40,10 +38,6 @@ # Don't do symlinks as part of the install CRUNCH_GENERATE_LINKS= no -# Which sources have local-arch build tools? -# Define as blank; othrs need to override -CRUNCH_BUILDTOOLS= - ################################################################### # Programs from stock /bin # Index: tools/bsdbox/Makefile.base =================================================================== --- tools/bsdbox/Makefile.base +++ tools/bsdbox/Makefile.base @@ -29,7 +29,6 @@ CRUNCH_PROGS_bin+= sh CRUNCH_ALIAS_sh= -sh CRUNCH_SUPPRESS_LINK_-sh= 1 -CRUNCH_BUILDTOOLS+= bin/sh # chown CRUNCH_PROGS_usr.sbin+= chown Index: tools/bsdbox/Makefile.textproc =================================================================== --- tools/bsdbox/Makefile.textproc +++ tools/bsdbox/Makefile.textproc @@ -11,7 +11,6 @@ # Awk # Disable - it's big! -adrian #CRUNCH_PROGS_usr.bin+= awk -#CRUNCH_BUILDTOOLS+= usr.bin/awk # vi # Disable - it's big! -adrian Index: tools/build/Makefile =================================================================== --- tools/build/Makefile +++ tools/build/Makefile @@ -241,8 +241,6 @@ # vtfontcvt is using sys/font.h SYSINCS+= ${SRCTOP}/sys/sys/font.h -# For mkscrfil.c: -SYSINCS+= ${SRCTOP}/sys/sys/consio.h # for gencat: INCS+= ${SRCTOP}/include/nl_types.h # for vtfontcvt: Index: usr.bin/awk/Makefile =================================================================== --- usr.bin/awk/Makefile +++ usr.bin/awk/Makefile @@ -25,11 +25,11 @@ ln -sf ${.ALLSRC:M*.h} ${.TARGET} proctab.c: maketab - ${BTOOLSPATH:U.}/maketab awkgram.h > proctab.c + ./maketab awkgram.h > proctab.c DEPENDOBJS+= maketab -build-tools: maketab -maketab: ytab.h maketab.c ${BUILD_TOOLS_META} +maketab: maketab.c ytab.h + ${BUILD_TOOLS_CC} -I. ${.IMPSRC} -o ${.TARGET} # awk needs some work before we can connect these tests to the build #HAS_TESTS= Index: usr.bin/vi/catalog/Makefile =================================================================== --- usr.bin/vi/catalog/Makefile +++ usr.bin/vi/catalog/Makefile @@ -19,7 +19,6 @@ all: dump -build-tools: dump WARNS= 3 # Helper since iconv is non trivial to make a build tool @@ -99,7 +98,7 @@ .endfor english.base: dump ${SCAN} #Makefile - ${BTOOLSPATH:U.}/dump ${SCAN} |\ + ./dump ${SCAN} |\ sed -e '/|/!d' \ -e 's/|/ "/' \ -e 's/^"//' |\ @@ -107,7 +106,8 @@ DEPENDOBJS+= dump -dump: ${BUILD_TOOLS_META} +dump: dump.c + ${BUILD_TOOLS_CC} -o ${.TARGET} ${.IMPSRC} CLEANFILES+= dump ${CAT} english.base *.check __ck1 __ck2