我正在尝试使用官方 TPM 2.0 参考实现(由 Microsoft 提供)在 macOS Sonoma (14.2.1) 上运行 TPM2.0 模拟器,但它似乎无法生成用于执行的 make 文件。这是我执行以下步骤时得到的结果:
$ export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
$ ./bootstrap
Generating file lists: src.mk
Setting up build
Setting default vendor strings
$ PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" EXTRA_CFLAGS=-fno-common ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for libcrypto... yes
./configure: line 4650: syntax error near unexpected token `,'
./configure: line 4650: `AX_PTHREAD(, AC_MSG_ERROR([requires pthread]))'
所以当我尝试做一个
make
时,它最终会得到一个make: *** No targets specified and no makefile found. Stop
。我认为这可能是因为 ./configure
没有成功完成。我尝试检查 autoconf 和 autoconf-archive,两者都已安装:
$ brew info autoconf
==> autoconf: stable 2.72 (bottled)
Automatic configure script builder
https://www.gnu.org/software/autoconf
Installed
/usr/local/Cellar/autoconf/2.72 (71 files, 3.6MB) *
Poured from bottle using the formulae.brew.sh API on 2024-05-05 at 23:35:38
From: https://github.com/Homebrew/homebrew-
core/blob/HEAD/Formula/a/autoconf.rb
License: GPL-3.0-or-later and (GPL-3.0-or-later with Autoconf-exception-3.0)
==> Dependencies
Required: m4 ✔
==> Analytics
install: 80,276 (30 days), 271,841 (90 days), 651,247 (365 days)
install-on-request: 15,529 (30 days), 53,376 (90 days), 147,214 (365 days)
build-error: 67 (30 days)
$ brew info autoconf-archive
==> autoconf-archive: stable 2023.02.20 (bottled)
Collection of over 500 reusable autoconf macros
https://savannah.gnu.org/projects/autoconf-archive/
Conflicts with:
gnome-common (because both install ax_check_enable_debug.m4 and ax_code_coverage.m4)
Installed
/usr/local/Cellar/autoconf-archive/2023.02.20 (600 files, 3.6MB) *
Poured from bottle using the formulae.brew.sh API on 2024-05-06 at 12:08:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/autoconf-archive.rb
License: GPL-3.0-or-later
==> Dependencies
Required: autoconf ✔
==> Analytics
install: 489 (30 days), 1,581 (90 days), 6,361 (365 days)
install-on-request: 371 (30 days), 1,048 (90 days), 4,227 (365 days)
build-error: 0 (30 days)
我想检查是否有一些配置或 PATH 我可能缺少链接 autoconf 来修复错误。
你可能缺乏依赖性。该宏位于 GNU Autoconf Archive 包中(请参阅 docs)。 Debian 称之为“autoconf-archive”。确保您已安装并再试一次。
您可能还想考虑基于相同代码但针对 Linux 重新打包的 IBM 模拟器(与 Microsoft 参考代码相同的套接字接口),甚至功能丰富的 swtpm(不同的套接字接口,但也可以提供
/dev/tpm0
等等)。