Add HAVE_ACPI and HAVE_UEFI flags to bsd.own.mk and use them to

conditionally include ACPI and UEFI bits instead of relying on adhoc
MACHINE_ARCH tests.
This commit is contained in:
jmcneill 2020-09-12 15:25:41 +00:00
parent 46e01cf359
commit 0d54a9589a
16 changed files with 79 additions and 47 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: ad.aarch64,v 1.34 2020/09/11 14:06:00 jmcneill Exp $
# $NetBSD: ad.aarch64,v 1.35 2020/09/12 15:25:41 jmcneill Exp $
./lib/eabi base-compat-lib compat,llvm
./lib/eabi/npf base-compat-lib compat,llvm
./lib/eabihf base-compat-lib compat,llvm
@ -8,7 +8,6 @@
./libexec/ld.elf_so-eabi base-compat-shlib compat,pic,llvm
./libexec/ld.elf_so-eabihf base-compat-shlib compat,pic,llvm
./libexec/ld.elf_so-oabi base-sysutil-bin compat,pic,llvm
./usr/bin/iasl base-util-bin
./usr/lib/eabi base-compat-lib compat,llvm
./usr/lib/eabi/i18n base-compat-lib compat,llvm
./usr/lib/eabi/libarm.so.0 base-compat-shlib compat,pic,llvm
@ -37,8 +36,6 @@
./usr/libexec/ld.elf_so-eabi base-compat-shlib compat,pic,llvm
./usr/libexec/ld.elf_so-eabihf base-compat-shlib compat,pic,llvm
./usr/libexec/ld.elf_so-oabi base-sysutil-bin compat,pic,llvm
./usr/mdec/bootaa64.efi base-sysutil-bin
./usr/sbin/acpidump base-sysutil-bin
./usr/sbin/amldb base-sysutil-bin
./usr/mdec/bootaa64.efi base-sysutil-bin uefi
./usr/sbin/ofctl base-sysutil-bin
./usr/sbin/tpctl base-sysutil-bin

View File

@ -1,4 +1,4 @@
# $NetBSD: ad.arm,v 1.84 2020/09/11 15:21:48 jakllsch Exp $
# $NetBSD: ad.arm,v 1.85 2020/09/12 15:25:41 jmcneill Exp $
./libexec/ld.elf_so-oabi base-sysutil-bin compat,pic
./sbin/ldconfig base-sysutil-root pic,endian=1234
./usr/bin/fdformat base-util-bin
@ -17,7 +17,7 @@
./usr/mdec/boot26,ffa base-obsolete obsolete
./usr/mdec/boot32 base-sysutil-bin endian=1234
./usr/mdec/boot32,ffa base-sysutil-bin endian=1234
./usr/mdec/bootarm.efi base-sysutil-bin machine=evbarm,!machine_arch=arm,!machine_arch=earm,!machine_arch=earmeb,!machine_arch=earmv4,!machine_arch=earmv4eb,!machine_arch=earmv5,!machine_arch=earmv5eb,!machine_arch=earmv5hf,!machine_arch=earmv5hfeb,!machine_arch=earmv6,!machine_arch=earmv6eb,!machine_arch=earmv6hf,!machine_arch=earmv6hfeb,!machine_arch=earmv7,!machine_arch=earmv7eb
./usr/mdec/bootarm.efi base-sysutil-bin uefi
./usr/mdec/bootimx23 base-sysutil-bin endian=1234
./usr/mdec/bootmini2440 base-sysutil-bin
./usr/mdec/gzboot_ADI_BRH_0x00140000.bin base-sysutil-bin

View File

@ -1,9 +1,8 @@
# $NetBSD: md.amd64,v 1.281 2019/10/28 13:04:18 maxv Exp $
# $NetBSD: md.amd64,v 1.282 2020/09/12 15:25:41 jmcneill Exp $
./dev/lms0 base-obsolete obsolete
./dev/mms0 base-obsolete obsolete
./libexec/ld.elf_so-i386 base-sys-shlib compat,pic
./usr/bin/fdformat base-util-bin
./usr/bin/iasl base-util-bin
./usr/bin/pmc base-obsolete obsolete
./usr/lib/i386/libi386.so.2 base-compat-shlib compat,pic
./usr/lib/i386/libi386.so.2.0 base-compat-shlib compat,pic
@ -69,6 +68,4 @@
./usr/mdec/prekern base-sysutil-bin
./usr/mdec/pxeboot_ia32.bin base-sysutil-bin
./usr/mdec/pxeboot_ia32_com0.bin base-obsolete obsolete
./usr/sbin/acpidump base-sysutil-bin
./usr/sbin/amldb base-sysutil-bin
./usr/sbin/nvmmctl base-sysutil-bin

View File

@ -1,4 +1,4 @@
# $NetBSD: md.i386,v 1.154 2019/08/26 04:49:45 kamil Exp $
# $NetBSD: md.i386,v 1.155 2020/09/12 15:25:41 jmcneill Exp $
./dev/lms0 base-obsolete obsolete
./dev/mms0 base-obsolete obsolete
./dev/pms0 base-obsolete obsolete
@ -16,7 +16,6 @@
./sbin/ldconfig base-sysutil-root pic
./usr/bin/fdformat base-util-bin
./usr/bin/fontedit base-obsolete obsolete
./usr/bin/iasl base-util-bin
./usr/bin/pmc base-obsolete obsolete
./usr/bin/vttest base-obsolete obsolete
./usr/lib/libi386.so base-sys-shlib pic
@ -96,8 +95,6 @@
./usr/mdec/pxeboot_ia32_com0.bin base-obsolete obsolete
./usr/mdec/sdboot base-obsolete obsolete
./usr/mdec/wdboot base-obsolete obsolete
./usr/sbin/acpidump base-sysutil-bin
./usr/sbin/amldb base-sysutil-bin
./usr/sbin/apm base-sysutil-bin
./usr/sbin/apmd base-sysutil-bin
./usr/sbin/bad144 base-sysutil-bin

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1262 2020/09/10 01:53:22 rin Exp $
# $NetBSD: mi,v 1.1263 2020/09/12 15:25:41 jmcneill Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -796,6 +796,7 @@
./usr/bin/host base-netutil-bin
./usr/bin/hoststat base-mailwrapper-bin
./usr/bin/hxtool base-krb5-bin kerberos
./usr/bin/iasl base-util-bin acpi
./usr/bin/iconv base-util-bin
./usr/bin/id base-util-bin
./usr/bin/ident base-util-bin
@ -1707,9 +1708,11 @@
./usr/sbin base-sys-usr
./usr/sbin/ac base-sysutil-bin
./usr/sbin/accton base-sysutil-bin
./usr/sbin/acpidump base-sysutil-bin acpi
./usr/sbin/altqd base-router-bin
./usr/sbin/altqstat base-router-bin
./usr/sbin/amd base-amd-bin
./usr/sbin/amldb base-sysutil-bin acpi
./usr/sbin/amq base-amd-bin
./usr/sbin/arp base-netutil-bin
./usr/sbin/audit-packages base-pkgutil-bin

View File

@ -1,4 +1,4 @@
# $NetBSD: ad.aarch64,v 1.31 2020/06/03 02:55:17 rin Exp $
# $NetBSD: ad.aarch64,v 1.32 2020/09/12 15:25:42 jmcneill Exp $
./usr/lib/eabi/libarm_g.a comp-sys-debug debuglib,compat,llvm
./usr/lib/eabi/libc_vfp_g.a comp-sys-debug debuglib,compat,llvm
./usr/lib/eabihf/libarm_g.a comp-sys-debug debuglib,compat,llvm
@ -13,7 +13,6 @@
./usr/libdata/debug/libexec/ld.elf_so-eabi.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/libexec/ld.elf_so-eabihf.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/libexec/ld.elf_so-oabi.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/usr/bin/iasl.debug comp-util-debug debug
./usr/libdata/debug/usr/lib/eabi comp-sys-debug compat,llvm
./usr/libdata/debug/usr/lib/eabi/i18n comp-sys-debug compat,llvm
./usr/libdata/debug/usr/lib/eabi/libarm.so.0.0.debug comp-sys-debug debug,compat,pic,llvm
@ -34,7 +33,5 @@
./usr/libdata/debug/usr/libexec/ld.elf_so-eabi.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/usr/libexec/ld.elf_so-eabihf.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/usr/libexec/ld.elf_so-oabi.debug comp-sys-debug debug,compat,llvm
./usr/libdata/debug/usr/sbin/acpidump.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/amldb.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/ofctl.debug comp-util-debug debug
./usr/libdata/debug/usr/sbin/tpctl.debug comp-sysutil-debug debug

View File

@ -1,4 +1,4 @@
# $NetBSD: md.amd64,v 1.110 2020/05/17 15:28:27 martin Exp $
# $NetBSD: md.amd64,v 1.111 2020/09/12 15:25:42 jmcneill Exp $
./usr/lib/i386/12.202++_g.a comp-c-debuglib debuglib,compat,12.202xx
./usr/lib/i386/libi386_g.a comp-c-debuglib debuglib,compat
./usr/lib/i386/libiberty_g.a comp-obsolete obsolete
@ -6,7 +6,6 @@
./usr/lib/libx86_64_g.a comp-c-debuglib debuglib
./usr/libdata/debug/libexec/ld.elf_so-i386.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/bin/fdformat.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/iasl.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/pmc.debug comp-obsolete obsolete
./usr/libdata/debug/usr/lib/i386/libi386.so.2.0.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/i386/libpam.so.4.1.debug comp-compat-shlib compat,pic,debug,pam
@ -16,8 +15,6 @@
./usr/libdata/debug/usr/lib/libx86_64.so.0.0.debug comp-sys-shlib pic,debug
./usr/libdata/debug/usr/libexec/ld.elf_so-i386 comp-obsolete obsolete
./usr/libdata/debug/usr/libexec/ld.elf_so-i386.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/sbin/acpidump.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/amldb.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/nvmmctl.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait.debug tests-obsolete obsolete
./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait3.debug tests-obsolete obsolete

View File

@ -1,17 +1,14 @@
# $NetBSD: md.i386,v 1.18 2018/10/01 08:23:53 jmcneill Exp $
# $NetBSD: md.i386,v 1.19 2020/09/12 15:25:42 jmcneill Exp $
./usr/lib/libi386_g.a comp-c-debuglib debuglib
./usr/lib/libm387_g.a comp-c-debuglib debuglib
./usr/lib/libpmc_g.a comp-obsolete obsolete
./usr/libdata/debug/lib/libm387.so.0.1.debug comp-sys-debug pic,debug
./usr/libdata/debug/sbin/ldconfig.debug comp-sysutil-debug debug,pic
./usr/libdata/debug/usr/bin/fdformat.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/iasl.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/pmc.debug comp-obsolete obsolete
./usr/libdata/debug/usr/lib/libi386.so.2.0.debug comp-sys-debug pic,debug
./usr/libdata/debug/usr/lib/libm387.so.0.1.debug comp-sys-debug pic,debug
./usr/libdata/debug/usr/lib/libpmc.so.1.0.debug comp-obsolete obsolete
./usr/libdata/debug/usr/sbin/acpidump.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/amldb.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/apm.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/apmd.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/bad144.debug comp-sysutil-debug debug

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.332 2020/09/08 14:17:03 christos Exp $
# $NetBSD: mi,v 1.333 2020/09/12 15:25:42 jmcneill Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@ -593,6 +593,7 @@
./usr/libdata/debug/usr/bin/host.debug comp-netutil-debug debug
./usr/libdata/debug/usr/bin/hpftodit.debug comp-groff-debug groff,debug
./usr/libdata/debug/usr/bin/hxtool.debug comp-krb5-debug kerberos,debug
./usr/libdata/debug/usr/bin/iasl.debug comp-util-debug acpi,debug
./usr/libdata/debug/usr/bin/iconv.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/id.debug comp-util-debug debug
./usr/libdata/debug/usr/bin/ident.debug comp-util-debug debug
@ -1034,9 +1035,11 @@
./usr/libdata/debug/usr/libexec/vfontedpr.debug comp-groff-debug debug
./usr/libdata/debug/usr/sbin/ac.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/accton.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/acpidump.debug comp-sysutil-debug acpi,debug
./usr/libdata/debug/usr/sbin/altqd.debug comp-router-debug debug
./usr/libdata/debug/usr/sbin/altqstat.debug comp-router-debug debug
./usr/libdata/debug/usr/sbin/amd.debug comp-amd-debug debug
./usr/libdata/debug/usr/sbin/amldb.debug comp-sysutil-debug acpi,debug
./usr/libdata/debug/usr/sbin/amq.debug comp-amd-debug debug
./usr/libdata/debug/usr/sbin/arp.debug comp-netutil-debug debug
./usr/libdata/debug/usr/sbin/audit-packages.debug comp-obsolete obsolete

View File

@ -1,9 +1,10 @@
# $NetBSD: mkvars.mk,v 1.38 2020/04/04 19:50:53 christos Exp $
# $NetBSD: mkvars.mk,v 1.39 2020/09/12 15:25:41 jmcneill Exp $
MKEXTRAVARS= \
MACHINE \
MACHINE_ARCH \
MACHINE_CPU \
HAVE_ACPI \
HAVE_GCC \
HAVE_GDB \
HAVE_XORG_SERVER_VER \
@ -13,6 +14,7 @@ MKEXTRAVARS= \
HAVE_LIBGCC_EH \
HAVE_OPENSSL \
HAVE_SSP \
HAVE_UEFI \
OBJECT_FMT \
TOOLCHAIN_MISSING \
EXTSRCS \

View File

@ -1,4 +1,4 @@
# $NetBSD: sets.subr,v 1.191 2020/05/18 21:19:34 jmcneill Exp $
# $NetBSD: sets.subr,v 1.192 2020/09/12 15:25:41 jmcneill Exp $
#
#
@ -16,11 +16,13 @@
# MACHINE
# MACHINE_ARCH
# MACHINE_CPU
# HAVE_ACPI
# HAVE_BINUTILS
# HAVE_GCC
# HAVE_GDB
# HAVE_SSP
# HAVE_OPENSSL
# HAVE_UEFI
# TOOLCHAIN_MISSING
# OBJECT_FMT
# as well as:
@ -189,7 +191,7 @@ SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g"
# In each file, a record consists of a path and a System Package name,
# separated by whitespace. E.g.,
#
# # $NetBSD: sets.subr,v 1.191 2020/05/18 21:19:34 jmcneill Exp $
# # $NetBSD: sets.subr,v 1.192 2020/09/12 15:25:41 jmcneill Exp $
# . base-sys-root [keyword[,...]]
# ./altroot base-sys-root
# ./bin base-sys-root
@ -219,13 +221,15 @@ SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g"
# 1. The HAVE_<name>:
# ssp ${HAVE_SSP} != no
# libgcc_eh ${HAVE_LIBGCC_EH} != no
# acpi ${HAVE_ACPI} != no
# binutils=<n> <n> = value of ${HAVE_BINUTILS}
# gcc=<n> <n> = value of ${HAVE_GCC}
# gdb=<n> <n> = value of ${HAVE_GDB}
# mesa_ver=<n> <n> = value of ${HAVE_MESA_VER}
# openssl=<n> <n> = value of ${HAVE_OPENSSL}
# uefi ${HAVE_UEFI} != no
# xorg_server_ver=<n> <n> = value of ${HAVE_XORG_SERVER_VER}
# xorg_glamor ${HAVE_XORG_GLAMOR} != no
# mesa_ver=<n> <n> = value of ${HAVE_MESA_VER}
#
# 2. The USE_<name>:
# use_inet6 ${USE_INET6} != no
@ -330,14 +334,20 @@ list_set_files()
if ("gdb" in wanted)
wanted["gdb=" "'"${HAVE_GDB}"'"] = 1
}
if ("acpi" in wanted) {
wanted["acpi=" "'"${HAVE_ACPI}"'"] = 1
}
if ("mesa_ver" in wanted) {
wanted["mesa_ver=" "'"${HAVE_MESA_VER}"'"] = 1
}
if ("openssl" in wanted) {
wanted["openssl=" "'"${HAVE_OPENSSL}"'"] = 1
}
if ("xorg_server_ver" in wanted) {
wanted["xorg_server_ver=" "'"${HAVE_XORG_SERVER_VER}"'"] = 1
}
if ("mesa_ver" in wanted) {
wanted["mesa_ver=" "'"${HAVE_MESA_VER}"'"] = 1
if ("uefi" in wanted) {
wanted["uefi=" "'"${HAVE_UEFI}"'"] = 1
}
if (("man" in wanted) && ("catpages" in wanted))
wanted[".cat"] = 1

View File

@ -1,6 +1,8 @@
# $NetBSD: Makefile,v 1.26 2020/09/11 14:06:00 jmcneill Exp $
# $NetBSD: Makefile,v 1.27 2020/09/12 15:25:42 jmcneill Exp $
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || !empty(MACHINE_ARCH:Maarch64*))
.include <bsd.init.mk>
.if ${HAVE_ACPI:Uno} == "yes"
PROG= iasl
.endif
BINDIR= /usr/bin

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.1209 2020/09/12 08:31:39 mrg Exp $
# $NetBSD: bsd.own.mk,v 1.1210 2020/09/12 15:25:42 jmcneill Exp $
# This needs to be before bsd.init.mk
.if defined(BSD_MK_COMPAT_FILE)
@ -104,6 +104,32 @@ EXTERNAL_OPENSSL_SUBDIR=openssl.old
EXTERNAL_OPENSSL_SUBDIR=/does/not/exist
.endif
#
# Does the platform support ACPI?
#
.if ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "ia64" || \
!empty(MACHINE_ARCH:Maarch64*)
HAVE_ACPI= yes
.else
HAVE_ACPI= no
.endif
#
# Does the platform support UEFI?
#
.if ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "ia64" || \
!empty(MACHINE_ARCH:Mearmv7*) || \
!empty(MACHINE_ARCH:Maarch64*)
HAVE_UEFI= yes
.else
HAVE_UEFI= no
.endif
.if !empty(MACHINE_ARCH:Mearm*)
_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2020/09/08 16:39:36 jmcneill Exp $
# $NetBSD: Makefile,v 1.13 2020/09/12 15:25:41 jmcneill Exp $
.include <bsd.endian.mk>
@ -12,12 +12,12 @@ SUBDIR+= bootimx23
.endif
.endif
.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "aarch64eb"
.if ${HAVE_UEFI:Uno} == "yes"
. if !empty(MACHINE_ARCH:Maarch64*)
SUBDIR+= ../../../stand/efiboot/bootaa64
.endif
.if ${MACHINE_ARCH} == "earmv7hf" || ${MACHINE_ARCH} == "earmv7hfeb"
. else
SUBDIR+= ../../../stand/efiboot/bootarm
. endif
.endif
.include <bsd.subdir.mk>

View File

@ -1,7 +1,9 @@
# $NetBSD: Makefile,v 1.8 2020/09/11 14:06:00 jmcneill Exp $
# $NetBSD: Makefile,v 1.9 2020/09/12 15:25:42 jmcneill Exp $
# $FreeBSD: src/usr.sbin/acpi/acpidump/Makefile,v 1.7 2003/08/28 03:33:07 njl Exp $
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || !empty(MACHINE_ARCH:Maarch64*))
.include <bsd.init.mk>
.if ${HAVE_ACPI:Uno} == "yes"
CPPFLAGS+=-I${.CURDIR}/../../../sys -D_KERNTYPES
CPPFLAGS+=-I${.CURDIR}/..
PROG= acpidump

View File

@ -1,8 +1,10 @@
# $NetBSD: Makefile,v 1.7 2020/09/11 14:06:00 jmcneill Exp $
# $NetBSD: Makefile,v 1.8 2020/09/12 15:25:42 jmcneill Exp $
# Id: Makefile,v 1.5 2000/07/14 18:16:30 iwasaki Exp
# $FreeBSD: src/usr.sbin/acpi/amldb/Makefile,v 1.7 2001/10/22 17:25:32 iwasaki Exp $
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || !empty(MACHINE_ARCH:Maarch64*))
.include <bsd.init.mk>
.if ${HAVE_ACPI:Uno} == "yes"
PROG= amldb
SRCS= amldb.c debug.c region.c
SRCS+= aml_parse.c aml_name.c aml_amlmem.c aml_memman.c aml_store.c \