frankmorgner / OpenSCToken

Use OpenSC in macOS CryptoTokenKit.
GNU General Public License v3.0
76 stars 14 forks source link

Conflict between pre-installed OpenSSL and Xcodeproj #25

Closed mouse07410 closed 4 years ago

mouse07410 commented 4 years ago

Problem

File OpenSCTokenApp.xcodeproj/project.pbxproj sets location for OpenSSL include files and libraries (actually, only libcrypto.a).

Asa result, if bootstrap script locates a suitable OpenSSL that's already installed on the system (via Macports, in my case), the build fails:

  1. Fails to compile, because cannot find include file <openssl/opensslv.h>. Could get through by manually adding the correct include files location to the .xcodeproj - but it is not a correct workaround (see below).
  2. Then it fails to start linking because it fails to locate the library $SRCROOT/openssl/lib/libcrypto.a. Removing this dependency and relying on $OPENSSL_LIBS did not help - linking failed with unresolved symbols.

To get past this, I had to modify the bootstrap script, forcing it to always build OpenSSL from the source (ugly, but it works).

Proposed solution

If possible - make the .xcodeproj use and depend upon $OPENSSL_CFLAGS and $OPENSSL_LIBS. If not - modify the bootstrap script to always build from the source, so xcodebuild always finds the headers and the library exactly where it is expecting them.