Changeset 542 for branches

Show
Ignore:
Timestamp:
07/19/04 21:03:22 (4 years ago)
Author:
aj
Message:

Try pkg-config for detection, fall back to conventional code.

Location:
branches/openct-0.6
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/openct-0.6/configure.ac

    r525 r542  
    1717#   (Interfaces removed:                AGE=0) 
    1818OPENCT_LT_CURRENT=0 
    19 OPENCT_LT_REVISION=1 
     19OPENCT_LT_REVISION=2 
    2020OPENCT_LT_AGE=0 
    2121 
     
    199199PCSC_MSG=no 
    200200pcsc_path=/usr 
    201 AC_SUBST(CFLAGS_PCSC) 
    202 AC_SUBST(LIBPCSC) 
     201AC_SUBST(PCSC_CFLAGS) 
     202AC_SUBST(PCSC_LIBS) 
    203203 
    204204case "$host" in 
    205205*-*-darwin*) 
    206206        PCSC_MSG=yes 
    207         CFLAGS_PCSC="" 
    208         LIBPCSC="-Wl,-framework,PCSC" 
     207        PCSC_CFLAGS="" 
     208        PCSC_LIBS="-Wl,-framework,PCSC" 
    209209        ;; 
    210210esac 
     
    221221if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then 
    222222        AC_MSG_CHECKING(for PC/SC Lite support) 
    223         for pcscdir in /pcsc ""; do 
     223        PKG_CHECK_MODULES(PCSC, libpcsclite, [ 
     224                PCSC_MSG="yes"  
     225                AC_MSG_RESULT($PCSC_MSG) 
     226                ], [ 
     227        for pcscdir in "" /pcsc /PCSC; do 
    224228                CPPFLAGS="$saved_CPPFLAGS" 
    225229                LDFLAGS="$saved_LDFLAGS" 
    226230                LIBS="-lpcsclite $saved_LIBS" 
    227                 CFLAGS_PCSC="" 
     231                PCSC_CFLAGS="" 
    228232 
    229233                for pcsc_libdir in $pcsc_path/lib$pcscdir \ 
     
    242246                              $pcsc_path$pcscdir; do 
    243247                      if test -d $pcsc_incdir; then 
    244                                 CFLAGS_PCSC="-I${pcsc_incdir}" 
     248                                PCSC_CFLAGS="-I${pcsc_incdir}" 
    245249                                break; 
    246250                      fi 
    247251                done 
    248252 
    249                 CPPFLAGS="${CFLAGS_PCSC} ${CPPFLAGS}" 
     253                CPPFLAGS="${PCSC_CFLAGS} ${CPPFLAGS}" 
    250254                AC_TRY_LINK([#include <stdlib.h> 
    251255#include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes) 
     
    257261                LDFLAGS="$saved_LDFLAGS" 
    258262                LIBS="$saved_LIBS" 
    259                 CFLAGS_PCSC="" 
     263                PCSC_CFLAGS="" 
    260264        done 
    261265        AC_MSG_RESULT($PCSC_MSG) 
    262266        if test "x$PCSC_MSG" = "xyes" ; then 
    263                 LIBPCSC="-lpcsclite" 
     267                PCSC_LIBS="-lpcsclite" 
    264268                CPPFLAGS="$saved_CPPFLAGS" 
    265269                LIBS="$saved_LIBS" 
    266270        fi 
     271        ]) 
    267272fi 
    268273AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes") 
     
    270275        AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation]) 
    271276else 
    272         LIBPCSC="" 
    273         CFLAGS_PCSC="" 
     277        PCSC_LIBS="" 
     278        PCSC_CFLAGS="" 
    274279fi 
    275280 
  • branches/openct-0.6/src/ifd/Makefile.am

    r507 r542  
    33MAINTAINERCLEANFILES = Makefile.in 
    44 
    5 INCLUDES = -I$(top_srcdir)/src/scdl @CPPFLAGS@ @CFLAGS_PCSC@ 
     5INCLUDES = -I$(top_srcdir)/src/scdl @CPPFLAGS@ @PCSC_CFLAGS@ 
    66 
    77lib_LTLIBRARIES = libifd.la 
  • branches/openct-0.6/src/pcsc/Makefile.am

    r531 r542  
    55MAINTAINERCLEANFILES = Makefile.in 
    66 
    7 INCLUDES = -I$(top_srcdir)/src/ctapi @CPPFLAGS@ @CFLAGS_PCSC@ 
     7INCLUDES = -I$(top_srcdir)/src/ctapi @CPPFLAGS@ @PCSC_CFLAGS@ 
    88 
    99if HAVE_PCSC