Skip to content

Commit

Permalink
autoconfigure PC/SC on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmorgner committed Aug 20, 2019
1 parent ccc68fd commit 7ccdadc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions pcsc-relay/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ AC_ARG_ENABLE(

# Checks for libraries.
PKG_CHECK_EXISTS([libpcsclite],
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
[AC_MSG_WARN([libpcsclite not found by pkg-config])])
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
[AC_MSG_WARN([libpcsclite not found by pkg-config])
case "$host" in
*-*-darwin*)
SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -t. -k2 -r | head -1)}"
# and set the PC/SC include path
PCSC_CFLAGS="-I$SDK_PATH/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers -DRESPONSECODE_DEFINED_IN_WINTYPES_H -I`pwd`/${top_srcdir}/MacOSX"
PCSC_LIBS="--framework PCSC"
esac
])

# Checks for libraries.
PKG_CHECK_EXISTS([libnfc >= 1.6],
Expand Down
2 changes: 1 addition & 1 deletion virtualsmartcard/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if test "${libpcsclite}" = no ; then
[AC_MSG_WARN([libpcsclite not found by pkg-config])
case "$host" in
*-*-darwin*)
SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
SDKS_PATH="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -t. -k2 -r | head -1)}"
# and set the PC/SC include path
PCSC_CFLAGS="-I$SDK_PATH/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers -DRESPONSECODE_DEFINED_IN_WINTYPES_H -I`pwd`/${top_srcdir}/MacOSX"
Expand Down

0 comments on commit 7ccdadc

Please sign in to comment.