From 6b52ddbd5d859d6b351e4b8ba07b29ca9a3b180c Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 7 Dec 2009 00:15:43 +0000 Subject: [PATCH] - (dtucker) Bug #1160: use pkg-config for opensc config if it's available. Tested by Martin Paljak. --- ChangeLog | 4 ++++ configure.ac | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41c272ec..1c3c93b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20091207 + - (dtucker) Bug #1160: use pkg-config for opensc config if it's available. + Tested by Martin Paljak. + 20091121 - (tim) [opensshd.init.in] If PidFile is set in sshd_config, use it. Bug 1628. OK dtucker@ diff --git a/configure.ac b/configure.ac index a0c50e30..2de30f33 100644 --- a/configure.ac +++ b/configure.ac @@ -3295,11 +3295,18 @@ AC_ARG_WITH(opensc, [ --with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)], [ if test "x$withval" != "xno" ; then - if test "x$withval" != "xyes" ; then - OPENSC_CONFIG=$withval/bin/opensc-config + AC_PATH_PROG(PKGCONFIG, pkg-config, no) + AC_MSG_CHECKING(how to get opensc config) + if test "x$withval" != "xyes" -a "x$PKGCONFIG" = "xno"; then + OPENSC_CONFIG="$withval/bin/opensc-config" + elif test -f "$withval/src/libopensc/libopensc.pc"; then + OPENSC_CONFIG="$PKGCONFIG $withval/src/libopensc/libopensc.pc" + elif test "x$PKGCONFIG" != "xno"; then + OPENSC_CONFIG="$PKGCONFIG libopensc" else - AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) + AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) fi + AC_MSG_RESULT($OPENSC_CONFIG) if test "$OPENSC_CONFIG" != "no"; then LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` -- 2.45.1