1

我正在尝试使用 XCode 12.3 编译 xerces 3.1.1 和 3.2.3 来为 Intel 和 M1 制作通用库。

我正在运行以下配置步骤:

./configure CFLAGS="-arch x86_64 -arch arm64" CXXFLAGS="-arch x86_64 -arch arm64"

我得到以下输出:

checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether UID '502' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to use rpath... yes
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/Users/prj/3rd Party/Apache/xerces-c-src_3_2_3':
configure: error: C++ compiler cannot create executables
See `config.log' for more details

因此,我想知道是否可以为英特尔和 M1 芯片构建 Xerces 3.1.1 或 3.2.3,即本质上作为 Mac 中的通用二进制文件。

谢谢,

4

1 回答 1

0

我建议您使用 CMake 来构建 Xerces 而不是配置脚本,并在您的cmake命令中添加以下变量:

CMAKE_OSX_ARCHITECTURES=arm64;x86_64

于 2022-01-12T01:59:49.997 回答