Check-in [fea904e63c]
Overview
Comment:Updated to include PCSC header "winstype.h"

Updated PCSC header inclusion to be more robust

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fea904e63c14bec0e9b95f8889000e5ff8297de6
User & Date: rkeene on 2010-07-11 06:32:09
Other Links: manifest | tags
Context
2010-07-11
06:53
Added support for Mac OS X headers and libraries check-in: 48bd3742a7 user: rkeene tags: trunk
06:32
Updated to include PCSC header "winstype.h"

Updated PCSC header inclusion to be more robust check-in: fea904e63c user: rkeene tags: trunk

2010-06-23
22:13
CACKey 0.5.13

Updated debugging messages check-in: b09d33f9bc user: rkeene tags: trunk, 0.5.13

Changes

Modified aclocal/dc_pcsc.m4 from [9403cfa6bd] to [a54fda935e].

     1      1   AC_DEFUN(DC_PCSC_HEADERS, [
     2      2   	SAVE_CFLAGS="${CFLAGS}"
     3      3   	SAVE_CPPFLAGS="${CPPFLAGS}"
     4      4   	ADD_CFLAGS=""
     5      5   	ADD_CPPFLAGS=""
            6  +
            7  +	found_pcsclite=0
            8  +	found_winscard=0
            9  +	found_wintypes=0
     6     10   
     7     11   	for headerpath in /usr/include /usr/local/include /usr/cac/include; do
     8     12   		for subdir in smartcard PCSC pcsc pcsclite ""; do
     9     13   			headerdir="${headerpath}/${subdir}"
    10     14   			CFLAGS="${SAVE_CFLAGS} -I${headerdir}"
    11     15   			CPPFLAGS="${SAVE_CPPFLAGS} -I${headerdir}"
    12     16   
    13     17   			unset ac_cv_header_pcsclite_h
    14     18   			unset ac_cv_header_winscard_h
           19  +			unset ac_cv_header_wintypes_h
           20  +
           21  +			just_found_pcsclite=0
           22  +			just_found_winscard=0
           23  +			just_found_wintypes=0
    15     24   
    16     25   			AC_CHECK_HEADER(pcsclite.h, [
    17     26   				AC_DEFINE(HAVE_PCSCLITE_H, [1], [Define if you have the PCSC-Lite header file (you should)])
    18     27   
    19         -				ADD_CFLAGS=" -I${headerdir}"
    20         -				ADD_CPPFLAGS=" -I${headerdir}"
    21         -
    22         -				break
           28  +				found_pcsclite=1
           29  +				just_found_pcsclite=1
    23     30   			])
    24     31   
    25     32   			AC_CHECK_HEADER(winscard.h, [
    26     33   				AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)])
    27     34   
           35  +				found_winscard=1
           36  +				just_found_winscard=1
           37  +			])
           38  +
           39  +			AC_CHECK_HEADER(wintypes.h, [
           40  +				AC_DEFINE(HAVE_WINTYPES_H, [1], [Define if you have the PCSC-Lite header file (you should)])
           41  +
           42  +				found_wintypes=1
           43  +				just_found_wintypes=1
           44  +			])
           45  +
           46  +			if test "${just_found_pcsclite}" = 1 -a "${just_found_winscard}" = 1 -a "${just_found_wintypes}" = 1; then
    28     47   				ADD_CFLAGS=" -I${headerdir}"
    29     48   				ADD_CPPFLAGS=" -I${headerdir}"
           49  +			fi
    30     50   
           51  +			if test "${found_pcsclite}" = 1 -a "${found_winscard}" = 1 -a "${found_wintypes}" = 1; then
    31     52   				break
    32         -			])
           53  +			fi
    33     54   		done
    34     55   
    35     56   		if test -n "${ADD_CFLAGS}" -o -n "${ADD_CPPFLAGS}"; then
    36     57   			break
    37     58   		fi
    38     59   	done
    39     60   
    40     61   	CFLAGS="${SAVE_CFLAGS}${ADD_CFLAGS}"
    41     62   	CPPFLAGS="${SAVE_CPPFLAGS}${ADD_CPPFLAGS}"
    42         -
    43         -	unset ac_cv_header_winscard_h
    44         -	AC_CHECK_HEADER(winscard.h, [
    45         -		AC_DEFINE(HAVE_WINSCARD_H, [1], [Define if you have the PCSC-Lite header file (you should)])
    46         -	], [
    47         -		AC_MSG_WARN([unable to find winscard.h from PC/SC, compilation will likely fail.])
    48         -	])
    49     63   ])
    50     64   
    51     65   AC_DEFUN(DC_PCSC_LIBS, [
    52     66   	foundlib="0"
    53     67   	for lib in pcsclite pcsc-lite pcsc; do
    54     68   		AC_CHECK_LIB(${lib}, SCardEstablishContext, [
    55     69   			LIBS="${LIBS} -l${lib}"

Modified cackey.c from [c6e4c2b8b9] to [ecdd31141d].

     1      1   #ifdef HAVE_CONFIG_H
     2      2   #include "config.h"
     3      3   #endif
     4      4   
            5  +#ifdef HAVE_WINTYPES_H
            6  +#  include <wintypes.h>
            7  +#endif
     5      8   #ifdef HAVE_PCSCLITE_H
     6      9   #  include <pcsclite.h>
     7     10   #endif
     8     11   #ifdef HAVE_WINSCARD_H
     9     12   #  include <winscard.h>
    10     13   #endif
    11     14   #ifdef HAVE_STDINT_H

Modified configure.ac from [f647f6952a] to [7238af48e2].

    79     79   dnl Check for ZLIB libraries
    80     80   AC_CHECK_LIB(z, uncompress)
    81     81   
    82     82   dnl Verify that a basic program will compile
    83     83   AC_MSG_CHECKING([if basic PC/SC program works])
    84     84   AC_LINK_IFELSE(
    85     85   	AC_LANG_PROGRAM([[
           86  +#ifdef HAVE_WINTYPES_H
           87  +#  include <wintypes.h>
           88  +#endif
    86     89   #ifdef HAVE_PCSCLITE_H
    87     90   #  include <pcsclite.h>
    88     91   #endif
    89     92   #ifdef HAVE_WINSCARD_H
    90     93   #  include <winscard.h>
    91     94   #endif
    92     95   #ifdef HAVE_STDINT_H