Enable building tar for non-FreeBSD host

For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Add readpassphrase to libegacy to avoid the need for libbsd on Linux

src.opts.mk disable TESTS for host if MK_host_egacy is yes

Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39766
This commit is contained in:
Simon J. Gerraty 2023-04-24 10:20:17 -07:00
parent c5b5f2d808
commit 976ba7f02a
6 changed files with 41 additions and 0 deletions

View File

@ -100,7 +100,9 @@
#define HAVE_DIRENT_H 1
#define HAVE_DIRFD 1
#define HAVE_DLFCN_H 1
#ifndef __linux__
#define HAVE_D_MD_ORDER 1
#endif
#define HAVE_EFTYPE 1
#define HAVE_EILSEQ 1
#define HAVE_ERRNO_H 1

View File

@ -360,6 +360,12 @@ __DEFAULT_YES_OPTIONS+=NETLINK_SUPPORT
__DEFAULT_NO_OPTIONS+=NETLINK_SUPPORT
.endif
# MK_host_egacy is set by local.sys.mk so is valid here
.if ${MACHINE} == "host" && ${MK_host_egacy} == "yes"
# we cannot expect tests to work
BROKEN_OPTIONS+= TESTS
.endif
.-include <site.src.opts.mk>
.include <bsd.mkopt.mk>

View File

@ -208,6 +208,18 @@ CFLAGS.closefrom.c+= -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \
SRCS+= progname.c
# Stub implementations of fflagstostr/strtofflags
SRCS+= fflags.c
# tar needs readpassphrase
# the version from openssh is already "portable"
# but we need to take care with .PATH as we
# do not want getopt_long.c from crypto/openssh/openbsd-compat
# and we do not want readpassphrase.c from libc/gen
.PATH: ${SRCTOP}/crypto/openssh
OBJS_SRCS_FILTER= T R
SRCS+= openbsd-compat/readpassphrase.c
INCS+= ${SRCTOP}/crypto/openssh/openbsd-compat/readpassphrase.h
.endif # ${MAKE.OS} == "Linux"
.if ${.MAKE.OS} == "Darwin"

View File

@ -0,0 +1,4 @@
#include <sys/cdefs.h>
#include <paths.h>
#define DEF_WEAK(a)

View File

@ -0,0 +1,11 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -0,0 +1,6 @@
DIRDEPS_OPTIONS = host_egacy
DIRDEPS.host_egacy.yes = tools/build
.include <dirdeps-options.mk>