Fix macOS compile and install issue

This commit is contained in:
Michael Farrell
2019-09-22 21:15:21 +10:00
parent 75779ea77a
commit 2b69dc7152
2 changed files with 45 additions and 5 deletions

View File

@@ -74,7 +74,7 @@ PKG_CHECK_EXISTS([libpcsclite],
SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -t. -k2 -r | head -1)}" SDK_PATH="${SDK_PATH:-$SDKS_PATH/$(ls -1 ${SDKS_PATH} | sort -n -t. -k2 -r | head -1)}"
# and set the PC/SC include path # 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_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" PCSC_LIBS="-framework PCSC"
esac esac
]) ])

View File

@@ -100,7 +100,17 @@ if test "${libpcsclite}" = no ; then
serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial" serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "/serial" ; then if test "${serialdropdir}" = "/serial" ; then
case "$host" in case "$host" in
*-*-darwin*) serialdropdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS; infoplist=yes ;; *-*-darwin*)
MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 * 1000 + $2}')
if test "$MAC_VERSION" -ge "10011"; then
# System Integrity Protection means we can't write
# to /usr/libexec; even as root!
serialdropdir=/usr/local/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS
else
serialdropdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS
fi
infoplist=yes
;;
*) AC_MSG_ERROR([use --enable-serialdropdir=DIR]) *) AC_MSG_ERROR([use --enable-serialdropdir=DIR])
esac esac
fi fi
@@ -108,7 +118,17 @@ if test "${libpcsclite}" = no ; then
serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial" serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "${prefix}/serial" ; then if test "${serialdropdir}" = "${prefix}/serial" ; then
case "$host" in case "$host" in
*-*-darwin*) serialdropdir=${prefix}/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS; infoplist=yes ;; *-*-darwin*)
MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 * 1000 + $2}')
if test "$MAC_VERSION" -ge "10011"; then
# System Integrity Protection means we can't write
# to /usr/libexec; even as root!
serialdropdir=${prefix}/usr/local/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS
else
serialdropdir=${prefix}/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS
fi
infoplist=yes
;;
*) AC_MSG_ERROR([use --enable-serialdropdir=DIR]) *) AC_MSG_ERROR([use --enable-serialdropdir=DIR])
esac esac
fi fi
@@ -126,7 +146,17 @@ if test "${libpcsclite}" = no ; then
serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`" serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "" ; then if test "${serialconfdir}" = "" ; then
case "$host" in case "$host" in
*-*-darwin*) serialconfdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents; infoplist=yes ;; *-*-darwin*)
MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 * 1000 + $2}')
if test "$MAC_VERSION" -ge "10011"; then
# System Integrity Protection means we can't write
# to /usr/libexec; even as root!
serialconfdir=/usr/local/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents
else
serialconfdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents
fi
infoplist=yes
;;
*) serialconfdir="/etc/reader.conf.d" *) serialconfdir="/etc/reader.conf.d"
esac esac
fi fi
@@ -134,7 +164,17 @@ if test "${libpcsclite}" = no ; then
serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`" serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "${prefix}" ; then if test "${serialconfdir}" = "${prefix}" ; then
case "$host" in case "$host" in
*-*-darwin*) serialconfdir=${prefix}/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents; infoplist=yes ;; *-*-darwin*)
MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 * 1000 + $2}')
if test "$MAC_VERSION" -ge "10011"; then
# System Integrity Protection means we can't write
# to /usr/libexec; even as root!
serialconfdir=${prefix}/usr/local/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents
else
serialconfdir=${prefix}/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents
fi
infoplist=yes
;;
*) serialconfdir="${prefix}/etc/reader.conf.d" *) serialconfdir="${prefix}/etc/reader.conf.d"
esac esac
fi fi