randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 567 forks source link

Commoncrypto does not build on Darwin? #1669

Closed mouse07410 closed 6 years ago

mouse07410 commented 6 years ago

MacOS 10.13.6 High Sierra. Xcode-9.4.1.

./configure.py --prefix=/opt/local --with-os-features=security_framework,commoncrypto,getentropy --with-openssl --with-boost --with-lzma --with-bzip2 --with-zlib --with-sqlite3 --with-python-version=2.7 --with-sphinx --with-pdf --cc-abi-flags='-maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include'
   INFO: ./configure.py invoked with options "--prefix=/opt/local --with-os-features=security_framework,commoncrypto,getentropy --with-openssl --with-boost --with-lzma --with-bzip2 --with-zlib --with-sqlite3 --with-python-version=2.7 --with-sphinx --with-pdf --cc-abi-flags=-maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include"
   INFO: Autodetected platform information: OS="Darwin" machine="x86_64" proc="i386"
   INFO: Guessing target OS is darwin (use --os to set)
   INFO: Guessing target processor is a x86_64 (use --cpu to set)
   INFO: Auto-detected compiler version 4.0
   INFO: Auto-detected compiler arch x86_64
   INFO: Target is clang:4.0-darwin-x86_64
   INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 pmull sha1_armv8 sha2_32_armv8 sm4_armv8
   INFO: Skipping (incompatible OS): proc_walk win32_stats
   INFO: Skipping (requires external dependency): bearssl commoncrypto tpm
   INFO: Using SIMD module simd_avx2
   INFO: Enabling use of external dependency boost
   INFO: Enabling use of external dependency bzip2
   INFO: Enabling use of external dependency lzma
   INFO: Enabling use of external dependency openssl
   INFO: Enabling use of external dependency sqlite3
   INFO: Enabling use of external dependency zlib
. . . . .

It complains about "external dependencies". What dependencies does it need???

randombit commented 6 years ago

It turns out not to require any extra dependencies beyond libSystem (#1667), so Common Crypto should in fact be automatically used on Mac and iOS. But right now it is being treated as identical to something like OpenSSL which must be explicitly enabled (in this case with --enable-commoncrypto).

mouse07410 commented 6 years ago

Turns out the correct form is --with-commoncrypto.

I wonder whether both need to be specified: --with-commoncrypto --with-os-features=commoncrypto.