简体   繁体   中英

Problems in building Xerces library as a universal binary on Mac

I am trying to compile xerces 3.1.1 and 3.2.3 with XCode 12.3 to make universal library for both Intel and M1.

I am running the following for configuring step:

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

I am getting the following output:

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

I want to therefore know if Xerces 3.1.1 or 3.2.3 can be built for both intel and M1 chip, ie essentially as a universal binary in Mac.

Thanks,

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

CMAKE_OSX_ARCHITECTURES=arm64;x86_64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM