Skip to content

Commit

Permalink
Merge pull request frankmorgner#151 from micolous/macos-sip
Browse files Browse the repository at this point in the history
(partially) fix macOS 10.14/Xcode 11.0 compile and install issues
  • Loading branch information
frankmorgner committed Apr 28, 2020
2 parents 373bd18 + 39ed41e commit 4b709f0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pcsc-relay/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
# 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"
PCSC_LIBS="-framework PCSC"
esac
])

Expand Down
9 changes: 7 additions & 2 deletions virtualsmartcard/MacOSX/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ osx: $(OPENPACE_MAKEFILE)
rm -rf $(OSX_TARGETDIR) dmg $(top_builddir)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)_osx.dmg
@echo Configuring virtualsmartcard for IFD bundle
cd $(top_builddir) && ./configure --prefix=/Library/VirtualSmartCard \
CFLAGS="-arch i386 -arch x86_64" --enable-infoplist
CFLAGS="-arch x86_64" \
--enable-serialdropdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS \
--enable-serialconfdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents
@echo Compiling virtualsmartcard
make -C $(top_builddir) clean install DESTDIR=$(OSX_TARGETDIR)
@echo Configuring virtualsmartcard for builtin libpcsclite
cd $(top_builddir) && ./configure --prefix=/Library/VirtualSmartCard \
CFLAGS="-arch i386 -arch x86_64" --enable-libpcsclite
CFLAGS="-arch x86_64" \
--enable-serialdropdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents/MacOS \
--enable-serialconfdir=/usr/libexec/SmartCardServices/drivers/ifd-vpcd.bundle/Contents \
--enable-libpcsclite
@echo Compiling virtualsmartcard
make -C $(top_builddir) clean install DESTDIR=$(OSX_TARGETDIR)
pkgbuild --root $(OSX_TARGETDIR) --scripts MacOSX_install --identifier com.vsmartcard.virtualsmartcard.mac --version $(PACKAGE_VERSION) --install-location / VirtualSmartCard-$(PACKAGE_VERSION)_install.pkg
Expand Down
48 changes: 44 additions & 4 deletions virtualsmartcard/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,35 @@ if test "${libpcsclite}" = no ; then
serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "/serial" ; then
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])
esac
fi
else
serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "${prefix}/serial" ; then
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])
esac
fi
Expand All @@ -126,15 +146,35 @@ if test "${libpcsclite}" = no ; then
serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "" ; then
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"
esac
fi
else
serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "${prefix}" ; then
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"
esac
fi
Expand Down

0 comments on commit 4b709f0

Please sign in to comment.