From 7f5fee6fd53d3ba216d9ef90930041e1dc828914 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 25 Sep 2016 20:12:13 +0100 Subject: [PATCH] Fix pcsclite dependency in openconnect.pc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On Windows and OSX, the PCSC support is provided by the system and not a separate installation of libpcsclite. So don't require the pcsclite package in the openconnect.pc file; instead add the appropriate thing to Libs.private. Reported-by: Björn Ketelaars Signed-off-by: David Woodhouse --- configure.ac | 23 ++++++++++++++++------- openconnect.pc.in | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index fcb2bad9..696f5132 100644 --- a/configure.ac +++ b/configure.ac @@ -55,12 +55,12 @@ case $host_os in AC_DEFINE(_GNU_SOURCE, 1, [_GNU_SOURCE]) symver_win32_strerror="openconnect__win32_strerror;" # Win32 does have the SCard API - LIBPCSCLITE_LIBS=-lwinscard - LIBPCSCLITE_CFLAGS=" " + system_pcsc_libs="-lwinscard" + system_pcsc_cflags= ;; *darwin*) - LIBPCSCLITE_LIBS="-Wl,-framework -Wl,PCSC" - LIBPCSCLITE_CFLAGS=" " + system_pcsc_libs="-Wl,-framework -Wl,PCSC" + system_pcsc_cflags= ;; *) # On FreeBSD the only way to get vsyslog() visible is to define @@ -682,12 +682,21 @@ AC_ARG_WITH([libpcsclite], AS_HELP_STRING([--without-libpcsclite], [Build without libpcsclite library (for Yubikey support) [default=auto]])) AS_IF([test "x$with_libpcsclite" != "xno"], [ - PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, + if test "$system_pcsc_libs" != ""; then + AC_SUBST(LIBPCSCLITE_LIBS, "$system_pcsc_libs") + AC_SUBST(LIBPCSCLITE_CFLAGS, "$system_pcsc_cflags") + AC_SUBST(system_pcsc_libs) + libpcsclite_pkg=yes + else + PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [AC_SUBST(LIBPCSCLITE_PC, libpcsclite) - AC_DEFINE([HAVE_LIBPCSCLITE], 1, [Have libpcsclite]) libpcsclite_pkg=yes], - libpcsclite_pkg=no) + libpcsclite_pkg=no) + fi ], [libpcsclite_pkg=disabled]) +if test "$libpcsclite_pkg" = "yes"; then + AC_DEFINE([HAVE_LIBPCSCLITE], 1, [Have libpcsclite]) +fi AM_CONDITIONAL(OPENCONNECT_LIBPCSCLITE, [test "$libpcsclite_pkg" = "yes"]) AC_ARG_WITH([libpskc], diff --git a/openconnect.pc.in b/openconnect.pc.in index c4c542c4..ef660713 100644 --- a/openconnect.pc.in +++ b/openconnect.pc.in @@ -9,5 +9,5 @@ Description: OpenConnect VPN client Version: @VERSION@ Requires.private: @LIBPROXY_PC@ @ZLIB_PC@ @LIBLZ4_PC@ @SSL_PC@ @P11KIT_PC@ @LIBSTOKEN_PC@ @LIBPSKC_PC@ @LIBPCSCLITE_PC@ libxml-2.0 Libs: -L${libdir} -lopenconnect -Libs.private: @INTL_LIBS@ +Libs.private: @INTL_LIBS@ @system_pcsc_libs@ Cflags: -I${includedir} -- 2.49.0