Hex Artifact Content

Artifact e054aaf31590b4faefac9d3bbc31ab3fe6e408f3:


0000: 41 43 5f 49 4e 49 54 28 63 61 63 6b 65 79 2c 20  AC_INIT(cackey, 
0010: 30 2e 37 2e 39 29 20 0a 41 43 5f 43 4f 4e 46 49  0.7.9) .AC_CONFI
0020: 47 5f 48 45 41 44 45 52 53 28 63 6f 6e 66 69 67  G_HEADERS(config
0030: 2e 68 29 0a 0a 64 6e 6c 20 4c 6f 63 61 74 65 20  .h)..dnl Locate 
0040: 73 74 61 6e 64 61 72 64 20 74 6f 6f 6c 73 0a 41  standard tools.A
0050: 43 5f 50 52 4f 47 5f 43 43 0a 41 43 5f 50 52 4f  C_PROG_CC.AC_PRO
0060: 47 5f 4d 41 4b 45 5f 53 45 54 0a 41 43 5f 50 52  G_MAKE_SET.AC_PR
0070: 4f 47 5f 49 4e 53 54 41 4c 4c 0a 41 43 5f 41 49  OG_INSTALL.AC_AI
0080: 58 0a 41 43 5f 4c 41 4e 47 28 43 29 0a 0a 64 6e  X.AC_LANG(C)..dn
0090: 6c 20 44 65 74 65 72 6d 69 6e 65 20 74 68 69 73  l Determine this
00a0: 20 70 6c 61 74 66 6f 72 6d 0a 44 43 5f 43 48 4b   platform.DC_CHK
00b0: 5f 4f 53 5f 49 4e 46 4f 0a 0a 64 6e 6c 20 44 65  _OS_INFO..dnl De
00c0: 74 65 72 6d 69 6e 65 20 68 6f 77 20 74 6f 20 63  termine how to c
00d0: 72 65 61 74 65 20 73 68 61 72 65 64 20 6f 62 6a  reate shared obj
00e0: 65 63 74 73 20 6f 6e 20 74 68 69 73 20 70 6c 61  ects on this pla
00f0: 74 66 6f 72 6d 0a 44 43 5f 47 45 54 5f 53 48 4f  tform.DC_GET_SHO
0100: 42 4a 46 4c 41 47 53 0a 0a 41 43 58 5f 50 54 48  BJFLAGS..ACX_PTH
0110: 52 45 41 44 28 2c 20 5b 0a 09 41 43 5f 4d 53 47  READ(, [..AC_MSG
0120: 5f 57 41 52 4e 28 5b 43 61 6e 20 6e 6f 74 20 66  _WARN([Can not f
0130: 69 67 75 72 65 20 6f 75 74 20 68 6f 77 20 74 6f  igure out how to
0140: 20 63 6f 6d 70 69 6c 65 20 77 69 74 68 20 70 74   compile with pt
0150: 68 72 65 61 64 73 20 73 75 70 70 6f 72 74 2c 20  hreads support, 
0160: 72 75 6e 2d 74 69 6d 65 20 77 69 6c 6c 20 6c 69  run-time will li
0170: 6b 65 6c 79 20 66 61 69 6c 2e 5d 29 0a 5d 29 0a  kely fail.]).]).
0180: 0a 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 68  .dnl Determine h
0190: 6f 77 20 74 6f 20 63 72 65 61 74 65 20 73 74 61  ow to create sta
01a0: 74 69 63 20 61 72 63 68 69 76 65 73 20 6f 6e 20  tic archives on 
01b0: 74 68 69 73 20 70 6c 61 74 66 6f 72 6d 0a 41 43  this platform.AC
01c0: 5f 43 48 45 43 4b 5f 54 4f 4f 4c 28 41 52 2c 20  _CHECK_TOOL(AR, 
01d0: 61 72 29 0a 41 43 5f 43 48 45 43 4b 5f 54 4f 4f  ar).AC_CHECK_TOO
01e0: 4c 28 52 41 4e 4c 49 42 2c 20 72 61 6e 6c 69 62  L(RANLIB, ranlib
01f0: 29 0a 0a 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65  )..dnl Determine
0200: 20 68 6f 77 20 74 6f 20 73 74 72 69 70 20 65 78   how to strip ex
0210: 65 63 75 74 61 62 6c 65 73 20 61 6e 64 20 72 65  ecutables and re
0220: 6d 6f 76 65 20 73 79 6d 62 6f 6c 73 0a 44 43 5f  move symbols.DC_
0230: 46 49 4e 44 5f 53 54 52 49 50 5f 41 4e 44 5f 52  FIND_STRIP_AND_R
0240: 45 4d 4f 56 45 53 59 4d 53 28 6c 69 62 63 61 63  EMOVESYMS(libcac
0250: 6b 65 79 2e 73 79 6d 73 29 0a 0a 64 6e 6c 20 43  key.syms)..dnl C
0260: 68 65 63 6b 20 66 6f 72 20 61 6c 6c 20 72 65 71  heck for all req
0270: 75 69 72 65 64 20 68 65 61 64 65 72 73 0a 41 43  uired headers.AC
0280: 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 53 28 61  _CHECK_HEADERS(a
0290: 72 70 61 2f 69 6e 65 74 2e 68 20 69 6e 74 74 79  rpa/inet.h intty
02a0: 70 65 73 2e 68 20 73 74 64 61 72 67 2e 68 20 73  pes.h stdarg.h s
02b0: 74 64 69 6e 74 2e 68 20 73 74 64 69 6f 2e 68 20  tdint.h stdio.h 
02c0: 73 74 64 6c 69 62 2e 68 20 73 74 72 69 6e 67 2e  stdlib.h string.
02d0: 68 20 73 79 73 2f 73 6f 63 6b 65 74 2e 68 20 73  h sys/socket.h s
02e0: 79 73 2f 74 79 70 65 73 2e 68 20 73 79 73 2f 75  ys/types.h sys/u
02f0: 6e 2e 68 20 74 69 6d 65 2e 68 20 75 6e 69 73 74  n.h time.h unist
0300: 64 2e 68 20 70 74 68 72 65 61 64 2e 68 20 7a 6c  d.h pthread.h zl
0310: 69 62 2e 68 20 6c 69 6d 69 74 73 2e 68 2c 2c 5b  ib.h limits.h,,[
0320: 0a 09 41 43 5f 57 41 52 4e 28 5b 52 65 71 75 69  ..AC_WARN([Requi
0330: 72 65 64 20 68 65 61 64 65 72 20 6d 69 73 73 69  red header missi
0340: 6e 67 2c 20 63 6f 6d 70 69 6c 61 74 69 6f 6e 20  ng, compilation 
0350: 77 69 6c 6c 20 6c 69 6b 65 6c 79 20 66 61 69 6c  will likely fail
0360: 2e 5d 29 0a 5d 2c 20 5b 0a 23 69 66 64 65 66 20  .]).], [.#ifdef 
0370: 48 41 56 45 5f 41 52 50 41 5f 49 4e 45 54 5f 48  HAVE_ARPA_INET_H
0380: 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 61 72 70  .#  include <arp
0390: 61 2f 69 6e 65 74 2e 68 3e 0a 23 65 6e 64 69 66  a/inet.h>.#endif
03a0: 0a 23 69 66 64 65 66 20 48 41 56 45 5f 49 4e 54  .#ifdef HAVE_INT
03b0: 54 59 50 45 53 5f 48 0a 23 20 20 69 6e 63 6c 75  TYPES_H.#  inclu
03c0: 64 65 20 3c 69 6e 74 74 79 70 65 73 2e 68 3e 0a  de <inttypes.h>.
03d0: 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48 41  #endif.#ifdef HA
03e0: 56 45 5f 53 54 44 41 52 47 5f 48 0a 23 20 20 69  VE_STDARG_H.#  i
03f0: 6e 63 6c 75 64 65 20 3c 73 74 64 61 72 67 2e 68  nclude <stdarg.h
0400: 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20  >.#endif.#ifdef 
0410: 48 41 56 45 5f 53 54 44 49 4e 54 5f 48 0a 23 20  HAVE_STDINT_H.# 
0420: 20 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6e 74   include <stdint
0430: 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65  .h>.#endif.#ifde
0440: 66 20 48 41 56 45 5f 53 54 44 49 4f 5f 48 0a 23  f HAVE_STDIO_H.#
0450: 20 20 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f    include <stdio
0460: 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65  .h>.#endif.#ifde
0470: 66 20 48 41 56 45 5f 53 54 44 4c 49 42 5f 48 0a  f HAVE_STDLIB_H.
0480: 23 20 20 69 6e 63 6c 75 64 65 20 3c 73 74 64 6c  #  include <stdl
0490: 69 62 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69 66  ib.h>.#endif.#if
04a0: 64 65 66 20 48 41 56 45 5f 53 54 52 49 4e 47 5f  def HAVE_STRING_
04b0: 48 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 73 74  H.#  include <st
04c0: 72 69 6e 67 2e 68 3e 0a 23 65 6e 64 69 66 0a 23  ring.h>.#endif.#
04d0: 69 66 64 65 66 20 48 41 56 45 5f 53 59 53 5f 53  ifdef HAVE_SYS_S
04e0: 4f 43 4b 45 54 5f 48 0a 23 20 20 69 6e 63 6c 75  OCKET_H.#  inclu
04f0: 64 65 20 3c 73 79 73 2f 73 6f 63 6b 65 74 2e 68  de <sys/socket.h
0500: 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20  >.#endif.#ifdef 
0510: 48 41 56 45 5f 53 59 53 5f 54 59 50 45 53 5f 48  HAVE_SYS_TYPES_H
0520: 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 73 79 73  .#  include <sys
0530: 2f 74 79 70 65 73 2e 68 3e 0a 23 65 6e 64 69 66  /types.h>.#endif
0540: 0a 23 69 66 64 65 66 20 48 41 56 45 5f 53 59 53  .#ifdef HAVE_SYS
0550: 5f 55 4e 5f 48 0a 23 20 20 69 6e 63 6c 75 64 65  _UN_H.#  include
0560: 20 3c 73 79 73 2f 75 6e 2e 68 3e 0a 23 65 6e 64   <sys/un.h>.#end
0570: 69 66 0a 23 69 66 64 65 66 20 48 41 56 45 5f 55  if.#ifdef HAVE_U
0580: 4e 49 53 54 44 5f 48 0a 23 20 20 69 6e 63 6c 75  NISTD_H.#  inclu
0590: 64 65 20 3c 75 6e 69 73 74 64 2e 68 3e 0a 23 65  de <unistd.h>.#e
05a0: 6e 64 69 66 0a 23 69 66 64 65 66 20 48 41 56 45  ndif.#ifdef HAVE
05b0: 5f 54 49 4d 45 5f 48 0a 23 20 20 69 6e 63 6c 75  _TIME_H.#  inclu
05c0: 64 65 20 3c 74 69 6d 65 2e 68 3e 0a 23 65 6e 64  de <time.h>.#end
05d0: 69 66 0a 23 69 66 64 65 66 20 48 41 56 45 5f 50  if.#ifdef HAVE_P
05e0: 54 48 52 45 41 44 5f 48 0a 23 20 20 69 6e 63 6c  THREAD_H.#  incl
05f0: 75 64 65 20 3c 70 74 68 72 65 61 64 2e 68 3e 0a  ude <pthread.h>.
0600: 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48 41  #endif.#ifdef HA
0610: 56 45 5f 4c 49 4d 49 54 53 5f 48 0a 23 20 20 69  VE_LIMITS_H.#  i
0620: 6e 63 6c 75 64 65 20 3c 6c 69 6d 69 74 73 2e 68  nclude <limits.h
0630: 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20  >.#endif.#ifdef 
0640: 48 41 56 45 5f 5a 4c 49 42 5f 48 0a 23 20 20 69  HAVE_ZLIB_H.#  i
0650: 6e 63 6c 75 64 65 20 3c 7a 6c 69 62 2e 68 3e 0a  nclude <zlib.h>.
0660: 23 65 6e 64 69 66 0a 5d 29 0a 0a 64 6e 6c 20 43  #endif.])..dnl C
0670: 68 65 63 6b 20 66 6f 72 20 50 43 2f 53 43 20 68  heck for PC/SC h
0680: 65 61 64 65 72 73 20 61 6e 64 20 6c 69 62 72 61  eaders and libra
0690: 72 69 65 73 0a 44 43 5f 50 43 53 43 0a 0a 64 6e  ries.DC_PCSC..dn
06a0: 6c 20 43 68 65 63 6b 20 66 6f 72 20 5a 4c 49 42  l Check for ZLIB
06b0: 20 6c 69 62 72 61 72 69 65 73 0a 41 43 5f 43 48   libraries.AC_CH
06c0: 45 43 4b 5f 4c 49 42 28 7a 2c 20 75 6e 63 6f 6d  ECK_LIB(z, uncom
06d0: 70 72 65 73 73 29 0a 0a 64 6e 6c 20 56 65 72 69  press)..dnl Veri
06e0: 66 79 20 74 68 61 74 20 61 20 62 61 73 69 63 20  fy that a basic 
06f0: 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 63 6f 6d  program will com
0700: 70 69 6c 65 0a 41 43 5f 43 41 43 48 45 5f 43 48  pile.AC_CACHE_CH
0710: 45 43 4b 28 5b 69 66 20 62 61 73 69 63 20 50 43  ECK([if basic PC
0720: 2f 53 43 20 70 72 6f 67 72 61 6d 20 77 6f 72 6b  /SC program work
0730: 73 5d 2c 20 63 61 63 6b 65 79 5f 63 76 5f 70 63  s], cackey_cv_pc
0740: 73 63 5f 77 6f 72 6b 73 2c 20 5b 0a 09 41 43 5f  sc_works, [..AC_
0750: 4c 49 4e 4b 5f 49 46 45 4c 53 45 28 0a 09 09 41  LINK_IFELSE(...A
0760: 43 5f 4c 41 4e 47 5f 50 52 4f 47 52 41 4d 28 5b  C_LANG_PROGRAM([
0770: 5b 0a 23 69 66 64 65 66 20 48 41 56 45 5f 57 49  [.#ifdef HAVE_WI
0780: 4e 54 59 50 45 53 5f 48 0a 23 20 20 69 6e 63 6c  NTYPES_H.#  incl
0790: 75 64 65 20 3c 77 69 6e 74 79 70 65 73 2e 68 3e  ude <wintypes.h>
07a0: 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48  .#endif.#ifdef H
07b0: 41 56 45 5f 50 43 53 43 4c 49 54 45 5f 48 0a 23  AVE_PCSCLITE_H.#
07c0: 20 20 69 6e 63 6c 75 64 65 20 3c 70 63 73 63 6c    include <pcscl
07d0: 69 74 65 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69  ite.h>.#endif.#i
07e0: 66 64 65 66 20 48 41 56 45 5f 57 49 4e 53 43 41  fdef HAVE_WINSCA
07f0: 52 44 5f 48 0a 23 20 20 69 6e 63 6c 75 64 65 20  RD_H.#  include 
0800: 3c 77 69 6e 73 63 61 72 64 2e 68 3e 0a 23 65 6e  <winscard.h>.#en
0810: 64 69 66 0a 23 69 66 64 65 66 20 48 41 56 45 5f  dif.#ifdef HAVE_
0820: 53 54 44 49 4e 54 5f 48 0a 23 20 20 69 6e 63 6c  STDINT_H.#  incl
0830: 75 64 65 20 3c 73 74 64 69 6e 74 2e 68 3e 0a 23  ude <stdint.h>.#
0840: 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48 41 56  endif.#ifdef HAV
0850: 45 5f 49 4e 54 54 59 50 45 53 5f 48 0a 23 20 20  E_INTTYPES_H.#  
0860: 69 6e 63 6c 75 64 65 20 3c 69 6e 74 74 79 70 65  include <inttype
0870: 73 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64  s.h>.#endif.#ifd
0880: 65 66 20 48 41 56 45 5f 53 54 44 4c 49 42 5f 48  ef HAVE_STDLIB_H
0890: 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 73 74 64  .#  include <std
08a0: 6c 69 62 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69  lib.h>.#endif.#i
08b0: 66 64 65 66 20 48 41 56 45 5f 55 4e 49 53 54 44  fdef HAVE_UNISTD
08c0: 5f 48 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 75  _H.#  include <u
08d0: 6e 69 73 74 64 2e 68 3e 0a 23 65 6e 64 69 66 0a  nistd.h>.#endif.
08e0: 23 69 66 64 65 66 20 48 41 56 45 5f 53 54 52 49  #ifdef HAVE_STRI
08f0: 4e 47 5f 48 0a 23 20 20 69 6e 63 6c 75 64 65 20  NG_H.#  include 
0900: 3c 73 74 72 69 6e 67 2e 68 3e 0a 23 65 6e 64 69  <string.h>.#endi
0910: 66 0a 23 69 66 64 65 66 20 48 41 56 45 5f 50 54  f.#ifdef HAVE_PT
0920: 48 52 45 41 44 5f 48 0a 23 20 20 69 6e 63 6c 75  HREAD_H.#  inclu
0930: 64 65 20 3c 70 74 68 72 65 61 64 2e 68 3e 0a 23  de <pthread.h>.#
0940: 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48 41 56  endif.#ifdef HAV
0950: 45 5f 4c 49 4d 49 54 53 5f 48 0a 23 20 20 69 6e  E_LIMITS_H.#  in
0960: 63 6c 75 64 65 20 3c 6c 69 6d 69 74 73 2e 68 3e  clude <limits.h>
0970: 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48  .#endif.#ifdef H
0980: 41 56 45 5f 53 54 44 49 4f 5f 48 0a 23 20 20 69  AVE_STDIO_H.#  i
0990: 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e  nclude <stdio.h>
09a0: 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 48  .#endif.#ifdef H
09b0: 41 56 45 5f 5a 4c 49 42 5f 48 0a 23 20 20 69 66  AVE_ZLIB_H.#  if
09c0: 64 65 66 20 48 41 56 45 5f 4c 49 42 5a 0a 23 20  def HAVE_LIBZ.# 
09d0: 20 20 20 69 6e 63 6c 75 64 65 20 3c 7a 6c 69 62     include <zlib
09e0: 2e 68 3e 0a 23 20 20 65 6e 64 69 66 0a 23 65 6e  .h>.#  endif.#en
09f0: 64 69 66 0a 09 09 5d 5d 2c 20 5b 5b 0a 09 09 09  dif...]], [[....
0a00: 4c 50 53 43 41 52 44 48 41 4e 44 4c 45 20 68 43  LPSCARDHANDLE hC
0a10: 61 72 64 3b 0a 09 09 09 53 43 41 52 44 43 4f 4e  ard;....SCARDCON
0a20: 54 45 58 54 20 68 43 6f 6e 74 65 78 74 3b 0a 09  TEXT hContext;..
0a30: 09 09 44 57 4f 52 44 20 64 77 41 63 74 69 76 65  ..DWORD dwActive
0a40: 50 72 6f 74 6f 63 6f 6c 3b 0a 09 09 09 4c 4f 4e  Protocol;....LON
0a50: 47 20 73 63 61 72 64 5f 63 6f 6e 6e 5f 72 65 74  G scard_conn_ret
0a60: 2c 20 73 63 61 72 64 5f 65 73 74 5f 63 6f 6e 74  , scard_est_cont
0a70: 65 78 74 5f 72 65 74 3b 0a 0a 09 09 09 73 63 61  ext_ret;.....sca
0a80: 72 64 5f 65 73 74 5f 63 6f 6e 74 65 78 74 5f 72  rd_est_context_r
0a90: 65 74 20 3d 20 53 43 61 72 64 45 73 74 61 62 6c  et = SCardEstabl
0aa0: 69 73 68 43 6f 6e 74 65 78 74 28 53 43 41 52 44  ishContext(SCARD
0ab0: 5f 53 43 4f 50 45 5f 53 59 53 54 45 4d 2c 20 4e  _SCOPE_SYSTEM, N
0ac0: 55 4c 4c 2c 20 4e 55 4c 4c 2c 20 26 68 43 6f 6e  ULL, NULL, &hCon
0ad0: 74 65 78 74 29 3b 0a 0a 09 09 09 68 43 61 72 64  text);.....hCard
0ae0: 20 3d 20 4e 55 4c 4c 3b 0a 09 09 09 73 63 61 72   = NULL;....scar
0af0: 64 5f 63 6f 6e 6e 5f 72 65 74 20 3d 20 53 43 61  d_conn_ret = SCa
0b00: 72 64 43 6f 6e 6e 65 63 74 28 68 43 6f 6e 74 65  rdConnect(hConte
0b10: 78 74 2c 20 22 52 65 61 64 65 72 20 58 22 2c 20  xt, "Reader X", 
0b20: 53 43 41 52 44 5f 53 48 41 52 45 5f 53 48 41 52  SCARD_SHARE_SHAR
0b30: 45 44 2c 20 53 43 41 52 44 5f 50 52 4f 54 4f 43  ED, SCARD_PROTOC
0b40: 4f 4c 5f 54 30 2c 20 68 43 61 72 64 2c 20 26 64  OL_T0, hCard, &d
0b50: 77 41 63 74 69 76 65 50 72 6f 74 6f 63 6f 6c 29  wActiveProtocol)
0b60: 3b 0a 09 09 5d 5d 29 2c 20 5b 0a 09 09 09 63 61  ;...]]), [....ca
0b70: 63 6b 65 79 5f 63 76 5f 70 63 73 63 5f 77 6f 72  ckey_cv_pcsc_wor
0b80: 6b 73 3d 6f 6b 61 79 0a 09 09 5d 2c 20 5b 0a 09  ks=okay...], [..
0b90: 09 09 63 61 63 6b 65 79 5f 63 76 5f 70 63 73 63  ..cackey_cv_pcsc
0ba0: 5f 77 6f 72 6b 73 3d 66 61 69 6c 65 64 0a 09 09  _works=failed...
0bb0: 5d 29 0a 09 5d 0a 29 0a 0a 69 66 20 74 65 73 74  ])..].)..if test
0bc0: 20 22 24 63 61 63 6b 65 79 5f 63 76 5f 70 63 73   "$cackey_cv_pcs
0bd0: 63 5f 77 6f 72 6b 73 22 20 3d 20 27 66 61 69 6c  c_works" = 'fail
0be0: 65 64 27 3b 20 74 68 65 6e 0a 09 41 43 5f 4d 53  ed'; then..AC_MS
0bf0: 47 5f 46 41 49 4c 55 52 45 28 5b 73 69 6d 70 6c  G_FAILURE([simpl
0c00: 65 20 50 43 2f 53 43 20 70 72 6f 67 72 61 6d 20  e PC/SC program 
0c10: 66 61 69 6c 65 64 5d 29 0a 66 69 0a 0a 64 6e 6c  failed]).fi..dnl
0c20: 20 4f 70 74 69 6f 6e 20 74 6f 20 65 6e 61 62 6c   Option to enabl
0c30: 65 20 44 6f 44 20 63 65 72 74 73 20 6f 6e 20 68  e DoD certs on h
0c40: 61 72 64 77 61 72 65 20 73 6c 6f 74 0a 41 43 5f  ardware slot.AC_
0c50: 41 52 47 5f 45 4e 41 42 4c 45 28 64 6f 64 2d 63  ARG_ENABLE(dod-c
0c60: 65 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73  erts-on-hw-slots
0c70: 2c 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47  , AC_HELP_STRING
0c80: 28 5b 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d 63  ([--enable-dod-c
0c90: 65 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73  erts-on-hw-slots
0ca0: 5d 2c 20 5b 53 70 65 63 69 66 79 20 74 68 61 74  ], [Specify that
0cb0: 20 44 6f 44 20 63 65 72 74 69 66 69 63 61 74 65   DoD certificate
0cc0: 73 20 73 68 6f 75 6c 64 20 62 65 20 6d 61 64 65  s should be made
0cd0: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 68 61   available on ha
0ce0: 72 64 77 61 72 65 20 74 6f 6b 65 6e 20 73 6c 6f  rdware token slo
0cf0: 74 73 5d 29 2c 20 5b 0a 09 64 6f 64 63 65 72 74  ts]), [..dodcert
0d00: 73 6f 6e 68 77 73 6c 6f 74 73 3d 24 65 6e 61 62  sonhwslots=$enab
0d10: 6c 65 76 61 6c 0a 5d 2c 20 5b 0a 09 64 6f 64 63  leval.], [..dodc
0d20: 65 72 74 73 6f 6e 68 77 73 6c 6f 74 73 3d 6e 6f  ertsonhwslots=no
0d30: 0a 5d 29 0a 0a 69 66 20 21 20 74 65 73 74 20 22  .])..if ! test "
0d40: 24 7b 64 6f 64 63 65 72 74 73 6f 6e 68 77 73 6c  ${dodcertsonhwsl
0d50: 6f 74 73 7d 22 20 3d 20 27 6e 6f 27 3b 20 74 68  ots}" = 'no'; th
0d60: 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 43 41  en..AC_DEFINE(CA
0d70: 43 4b 45 59 5f 43 41 52 44 5f 53 4c 4f 54 5f 49  CKEY_CARD_SLOT_I
0d80: 4e 43 4c 55 44 45 5f 45 58 54 52 41 5f 43 45 52  NCLUDE_EXTRA_CER
0d90: 54 53 2c 20 5b 31 5d 2c 20 5b 53 70 65 63 69 66  TS, [1], [Specif
0da0: 79 20 74 68 61 74 20 44 6f 44 20 63 65 72 74 69  y that DoD certi
0db0: 66 69 63 61 74 65 73 20 73 68 6f 75 6c 64 20 62  ficates should b
0dc0: 65 20 6d 61 64 65 20 61 76 61 69 6c 61 62 6c 65  e made available
0dd0: 20 6f 6e 20 68 61 72 64 77 61 72 65 20 74 6f 6b   on hardware tok
0de0: 65 6e 20 73 6c 6f 74 73 5d 29 0a 66 69 0a 0a 64  en slots]).fi..d
0df0: 6e 6c 20 4f 70 74 69 6f 6e 20 74 6f 20 64 69 73  nl Option to dis
0e00: 61 62 6c 65 20 44 6f 44 20 63 65 72 74 73 20 65  able DoD certs e
0e10: 6e 74 69 72 65 6c 79 0a 41 43 5f 41 52 47 5f 45  ntirely.AC_ARG_E
0e20: 4e 41 42 4c 45 28 64 6f 64 2d 63 65 72 74 73 2c  NABLE(dod-certs,
0e30: 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28   AC_HELP_STRING(
0e40: 5b 2d 2d 64 69 73 61 62 6c 65 2d 64 6f 64 2d 63  [--disable-dod-c
0e50: 65 72 74 73 5d 2c 20 5b 44 69 73 61 62 6c 65 20  erts], [Disable 
0e60: 69 6e 63 6c 75 64 69 6e 67 20 44 6f 44 20 63 65  including DoD ce
0e70: 72 74 73 20 65 6e 74 69 72 65 6c 79 2e 20 20 54  rts entirely.  T
0e80: 68 65 20 75 73 65 72 20 6d 61 79 20 6f 76 65 72  he user may over
0e90: 72 69 64 65 20 74 68 69 73 20 77 69 74 68 20 74  ride this with t
0ea0: 68 65 20 43 41 43 4b 45 59 5f 45 58 54 52 41 5f  he CACKEY_EXTRA_
0eb0: 43 45 52 54 53 20 65 6e 76 69 72 6f 6e 6d 65 6e  CERTS environmen
0ec0: 74 20 76 61 72 69 61 62 6c 65 2e 5d 29 2c 20 5b  t variable.]), [
0ed0: 0a 09 64 6f 64 63 65 72 74 73 3d 24 65 6e 61 62  ..dodcerts=$enab
0ee0: 6c 65 76 61 6c 0a 5d 2c 20 5b 0a 09 64 6f 64 63  leval.], [..dodc
0ef0: 65 72 74 73 3d 79 65 73 0a 5d 29 0a 0a 69 66 20  erts=yes.])..if 
0f00: 74 65 73 74 20 22 24 7b 64 6f 64 63 65 72 74 73  test "${dodcerts
0f10: 7d 22 20 3d 20 27 6e 6f 27 3b 20 74 68 65 6e 0a  }" = 'no'; then.
0f20: 09 41 43 5f 44 45 46 49 4e 45 28 43 41 43 4b 45  .AC_DEFINE(CACKE
0f30: 59 5f 4e 4f 5f 45 58 54 52 41 5f 43 45 52 54 53  Y_NO_EXTRA_CERTS
0f40: 2c 20 5b 31 5d 2c 20 5b 53 70 65 63 69 66 79 20  , [1], [Specify 
0f50: 74 68 61 74 20 44 6f 44 20 63 65 72 74 69 66 69  that DoD certifi
0f60: 63 61 74 65 73 20 73 68 6f 75 6c 64 20 6e 6f 74  cates should not
0f70: 20 62 65 20 6d 61 64 65 20 61 76 61 69 6c 61 62   be made availab
0f80: 6c 65 5d 29 0a 66 69 0a 0a 64 6e 6c 20 4f 70 74  le]).fi..dnl Opt
0f90: 69 6f 6e 20 74 6f 20 68 61 72 64 2d 63 6f 64 65  ion to hard-code
0fa0: 20 61 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 72 75   a command to ru
0fb0: 6e 20 74 6f 20 72 65 71 75 65 73 74 20 61 20 50  n to request a P
0fc0: 49 4e 20 28 65 6e 61 62 6c 69 6e 67 20 70 72 6f  IN (enabling pro
0fd0: 74 65 63 74 65 64 20 61 75 74 68 65 6e 74 69 63  tected authentic
0fe0: 61 74 69 6f 6e 20 70 61 74 68 29 0a 41 43 5f 41  ation path).AC_A
0ff0: 52 47 5f 57 49 54 48 28 70 69 6e 2d 63 6f 6d 6d  RG_WITH(pin-comm
1000: 61 6e 64 2c 20 41 43 5f 48 45 4c 50 5f 53 54 52  and, AC_HELP_STR
1010: 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 70 69 6e 2d  ING([--with-pin-
1020: 63 6f 6d 6d 61 6e 64 3d 3c 63 6f 6d 6d 61 6e 64  command=<command
1030: 3e 5d 2c 20 5b 53 70 65 63 69 66 79 20 61 20 63  >], [Specify a c
1040: 6f 6d 6d 61 6e 64 20 74 6f 20 72 75 6e 20 74 6f  ommand to run to
1050: 20 72 65 71 75 65 73 74 20 61 20 50 49 4e 20 66   request a PIN f
1060: 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 20 20 54  rom the user.  T
1070: 68 65 20 75 73 65 72 20 6d 61 79 20 6f 76 65 72  he user may over
1080: 72 69 64 65 20 74 68 69 73 20 77 69 74 68 20 74  ride this with t
1090: 68 65 20 43 41 43 4b 45 59 5f 50 49 4e 5f 43 4f  he CACKEY_PIN_CO
10a0: 4d 4d 41 4e 44 20 65 6e 76 69 72 6f 6e 6d 65 6e  MMAND environmen
10b0: 74 20 76 61 72 69 61 62 6c 65 2e 5d 29 2c 20 5b  t variable.]), [
10c0: 0a 09 70 69 6e 63 6f 6d 6d 61 6e 64 3d 22 24 7b  ..pincommand="${
10d0: 77 69 74 68 76 61 6c 7d 22 0a 5d 2c 20 5b 0a 09  withval}".], [..
10e0: 70 69 6e 63 6f 6d 6d 61 6e 64 3d 22 6e 6f 22 0a  pincommand="no".
10f0: 5d 29 0a 0a 41 43 5f 41 52 47 5f 57 49 54 48 28  ])..AC_ARG_WITH(
1100: 70 69 6e 2d 63 6f 6d 6d 61 6e 64 2d 78 2c 20 41  pin-command-x, A
1110: 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  C_HELP_STRING([-
1120: 2d 77 69 74 68 2d 70 69 6e 2d 63 6f 6d 6d 61 6e  -with-pin-comman
1130: 64 2d 78 3d 3c 63 6f 6d 6d 61 6e 64 3e 5d 2c 20  d-x=<command>], 
1140: 5b 53 61 6d 65 20 61 73 20 2d 2d 77 69 74 68 2d  [Same as --with-
1150: 70 69 6e 2d 63 6f 6d 6d 61 6e 64 2c 20 62 75 74  pin-command, but
1160: 20 6f 6e 6c 79 20 73 65 74 73 20 50 72 6f 74 65   only sets Prote
1170: 63 74 65 64 20 41 75 74 68 65 6e 74 69 63 61 74  cted Authenticat
1180: 69 6f 6e 20 50 61 74 68 20 69 66 20 74 68 65 20  ion Path if the 
1190: 44 49 53 50 4c 41 59 20 65 6e 76 69 72 6f 6e 6d  DISPLAY environm
11a0: 65 6e 74 20 76 61 72 69 61 62 6c 65 20 69 73 20  ent variable is 
11b0: 73 65 74 5d 29 2c 20 5b 0a 09 70 69 6e 63 6f 6d  set]), [..pincom
11c0: 6d 61 6e 64 78 6f 6e 6c 79 3d 22 24 7b 77 69 74  mandxonly="${wit
11d0: 68 76 61 6c 7d 22 0a 5d 2c 20 5b 0a 09 70 69 6e  hval}".], [..pin
11e0: 63 6f 6d 6d 61 6e 64 78 6f 6e 6c 79 3d 22 6e 6f  commandxonly="no
11f0: 22 0a 5d 29 0a 0a 69 66 20 21 20 74 65 73 74 20  ".])..if ! test 
1200: 22 24 7b 70 69 6e 63 6f 6d 6d 61 6e 64 7d 22 20  "${pincommand}" 
1210: 3d 20 27 6e 6f 27 3b 20 74 68 65 6e 0a 09 41 43  = 'no'; then..AC
1220: 5f 44 45 46 49 4e 45 5f 55 4e 51 55 4f 54 45 44  _DEFINE_UNQUOTED
1230: 28 43 41 43 4b 45 59 5f 50 49 4e 5f 43 4f 4d 4d  (CACKEY_PIN_COMM
1240: 41 4e 44 5f 44 45 46 41 55 4c 54 2c 20 5b 24 70  AND_DEFAULT, [$p
1250: 69 6e 63 6f 6d 6d 61 6e 64 5d 2c 20 5b 43 6f 6d  incommand], [Com
1260: 6d 61 6e 64 20 74 6f 20 72 75 6e 20 74 6f 20 70  mand to run to p
1270: 72 6f 6d 70 74 20 75 73 65 72 20 66 6f 72 20 50  rompt user for P
1280: 49 4e 5d 29 0a 66 69 0a 0a 69 66 20 21 20 74 65  IN]).fi..if ! te
1290: 73 74 20 22 24 7b 70 69 6e 63 6f 6d 6d 61 6e 64  st "${pincommand
12a0: 78 6f 6e 6c 79 7d 22 20 3d 20 27 6e 6f 27 3b 20  xonly}" = 'no'; 
12b0: 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 5f  then..AC_DEFINE_
12c0: 55 4e 51 55 4f 54 45 44 28 43 41 43 4b 45 59 5f  UNQUOTED(CACKEY_
12d0: 50 49 4e 5f 43 4f 4d 4d 41 4e 44 5f 58 4f 4e 4c  PIN_COMMAND_XONL
12e0: 59 5f 44 45 46 41 55 4c 54 2c 20 5b 24 70 69 6e  Y_DEFAULT, [$pin
12f0: 63 6f 6d 6d 61 6e 64 78 6f 6e 6c 79 5d 2c 20 5b  commandxonly], [
1300: 43 6f 6d 6d 61 6e 64 20 74 6f 20 72 75 6e 20 74  Command to run t
1310: 6f 20 70 72 6f 6d 70 74 20 75 73 65 72 20 66 6f  o prompt user fo
1320: 72 20 50 49 4e 20 6f 6e 6c 79 20 69 66 20 44 49  r PIN only if DI
1330: 53 50 4c 41 59 20 65 6e 76 69 72 6f 6e 6d 65 6e  SPLAY environmen
1340: 74 20 76 61 72 69 61 62 6c 65 20 69 73 20 73 65  t variable is se
1350: 74 5d 29 0a 66 69 0a 0a 41 43 5f 41 52 47 5f 57  t]).fi..AC_ARG_W
1360: 49 54 48 28 72 65 61 64 65 72 73 2d 69 6e 63 6c  ITH(readers-incl
1370: 75 64 65 2d 6f 6e 6c 79 2c 20 41 43 5f 48 45 4c  ude-only, AC_HEL
1380: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68  P_STRING([--with
1390: 2d 72 65 61 64 65 72 73 2d 69 6e 63 6c 75 64 65  -readers-include
13a0: 2d 6f 6e 6c 79 3d 3c 73 74 72 69 6e 67 3e 5d 2c  -only=<string>],
13b0: 20 5b 53 70 65 63 69 66 79 20 61 20 73 74 72 69   [Specify a stri
13c0: 6e 67 20 74 6f 20 6d 61 74 63 68 20 69 6e 20 61  ng to match in a
13d0: 20 72 65 61 64 65 72 20 74 6f 20 69 6e 63 6c 75   reader to inclu
13e0: 64 65 20 69 74 2c 20 61 6c 6c 20 6f 74 68 65 72  de it, all other
13f0: 20 72 65 61 64 65 72 73 20 77 69 6c 6c 20 62 65   readers will be
1400: 20 65 78 63 6c 75 64 65 64 2e 20 20 54 68 65 20   excluded.  The 
1410: 75 73 65 72 20 6d 61 79 20 6f 76 65 72 72 69 64  user may overrid
1420: 65 20 74 68 69 73 20 77 69 74 68 20 74 68 65 20  e this with the 
1430: 43 41 43 4b 45 59 5f 52 45 41 44 45 52 53 5f 49  CACKEY_READERS_I
1440: 4e 43 4c 55 44 45 5f 4f 4e 4c 59 20 65 6e 76 69  NCLUDE_ONLY envi
1450: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
1460: 2e 5d 29 2c 20 5b 0a 09 72 65 61 64 65 72 73 5f  .]), [..readers_
1470: 69 6e 63 6c 75 64 65 5f 6f 6e 6c 79 3d 22 24 7b  include_only="${
1480: 77 69 74 68 76 61 6c 7d 22 0a 5d 2c 20 5b 0a 09  withval}".], [..
1490: 72 65 61 64 65 72 73 5f 69 6e 63 6c 75 64 65 5f  readers_include_
14a0: 6f 6e 6c 79 3d 22 6e 6f 22 0a 5d 29 0a 0a 41 43  only="no".])..AC
14b0: 5f 41 52 47 5f 57 49 54 48 28 72 65 61 64 65 72  _ARG_WITH(reader
14c0: 73 2d 65 78 63 6c 75 64 65 2c 20 41 43 5f 48 45  s-exclude, AC_HE
14d0: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74  LP_STRING([--wit
14e0: 68 2d 72 65 61 64 65 72 73 2d 65 78 63 6c 75 64  h-readers-exclud
14f0: 65 3d 3c 73 74 72 69 6e 67 3e 5d 2c 20 5b 53 70  e=<string>], [Sp
1500: 65 63 69 66 79 20 61 20 73 74 72 69 6e 67 20 74  ecify a string t
1510: 6f 20 6d 61 74 63 68 20 69 6e 20 61 20 72 65 61  o match in a rea
1520: 64 65 72 20 74 6f 20 65 78 63 6c 75 64 65 20 69  der to exclude i
1530: 74 2c 20 61 6c 6c 20 6f 74 68 65 72 20 72 65 61  t, all other rea
1540: 64 65 72 73 20 77 69 6c 6c 20 62 65 20 69 6e 63  ders will be inc
1550: 6c 75 64 65 64 2e 20 20 54 68 65 20 75 73 65 72  luded.  The user
1560: 20 6d 61 79 20 6f 76 65 72 72 69 64 65 20 74 68   may override th
1570: 69 73 20 77 69 74 68 20 74 68 65 20 43 41 43 4b  is with the CACK
1580: 45 59 5f 52 45 41 44 45 52 53 5f 45 58 43 4c 55  EY_READERS_EXCLU
1590: 44 45 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76  DE environment v
15a0: 61 72 69 61 62 6c 65 2e 5d 29 2c 20 5b 0a 09 72  ariable.]), [..r
15b0: 65 61 64 65 72 73 5f 65 78 63 6c 75 64 65 3d 22  eaders_exclude="
15c0: 24 7b 77 69 74 68 76 61 6c 7d 22 0a 5d 2c 20 5b  ${withval}".], [
15d0: 0a 09 72 65 61 64 65 72 73 5f 65 78 63 6c 75 64  ..readers_exclud
15e0: 65 3d 22 6e 6f 22 0a 5d 29 0a 0a 69 66 20 21 20  e="no".])..if ! 
15f0: 74 65 73 74 20 22 24 7b 72 65 61 64 65 72 73 5f  test "${readers_
1600: 69 6e 63 6c 75 64 65 5f 6f 6e 6c 79 7d 22 20 3d  include_only}" =
1610: 20 27 6e 6f 27 3b 20 74 68 65 6e 0a 09 41 43 5f   'no'; then..AC_
1620: 44 45 46 49 4e 45 5f 55 4e 51 55 4f 54 45 44 28  DEFINE_UNQUOTED(
1630: 43 41 43 4b 45 59 5f 52 45 41 44 45 52 53 5f 49  CACKEY_READERS_I
1640: 4e 43 4c 55 44 45 5f 4f 4e 4c 59 5f 44 45 46 41  NCLUDE_ONLY_DEFA
1650: 55 4c 54 2c 20 5b 24 72 65 61 64 65 72 73 5f 69  ULT, [$readers_i
1660: 6e 63 6c 75 64 65 5f 6f 6e 6c 79 5d 2c 20 5b 53  nclude_only], [S
1670: 75 62 73 74 72 69 6e 67 20 74 6f 20 6d 61 74 63  ubstring to matc
1680: 68 20 74 6f 20 69 6e 63 6c 75 64 65 20 72 65 61  h to include rea
1690: 64 65 72 73 5d 29 0a 66 69 0a 0a 69 66 20 21 20  ders]).fi..if ! 
16a0: 74 65 73 74 20 22 24 7b 72 65 61 64 65 72 73 5f  test "${readers_
16b0: 65 78 63 6c 75 64 65 7d 22 20 3d 20 27 6e 6f 27  exclude}" = 'no'
16c0: 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e  ; then..AC_DEFIN
16d0: 45 5f 55 4e 51 55 4f 54 45 44 28 43 41 43 4b 45  E_UNQUOTED(CACKE
16e0: 59 5f 52 45 41 44 45 52 53 5f 45 58 43 4c 55 44  Y_READERS_EXCLUD
16f0: 45 5f 44 45 46 41 55 4c 54 2c 20 5b 24 72 65 61  E_DEFAULT, [$rea
1700: 64 65 72 73 5f 65 78 63 6c 75 64 65 5d 2c 20 5b  ders_exclude], [
1710: 53 75 62 73 74 72 69 6e 67 20 74 6f 20 6d 61 74  Substring to mat
1720: 63 68 20 74 6f 20 65 78 63 6c 75 64 65 20 72 65  ch to exclude re
1730: 61 64 65 72 73 5d 29 0a 66 69 0a 0a 64 6e 6c 20  aders]).fi..dnl 
1740: 53 65 74 20 76 65 72 73 69 6f 6e 20 73 63 72 69  Set version scri
1750: 70 74 2c 20 74 6f 20 6c 69 6d 69 74 20 74 68 65  pt, to limit the
1760: 20 73 63 6f 70 65 20 6f 66 20 73 79 6d 62 6f 6c   scope of symbol
1770: 73 0a 44 43 5f 53 45 54 56 45 52 53 49 4f 4e 53  s.DC_SETVERSIONS
1780: 43 52 49 50 54 28 6c 69 62 63 61 63 6b 65 79 2e  CRIPT(libcackey.
1790: 76 65 72 73 2c 20 6c 69 62 63 61 63 6b 65 79 2e  vers, libcackey.
17a0: 73 79 6d 73 29 0a 0a 64 6e 6c 20 55 70 61 74 65  syms)..dnl Upate
17b0: 20 4c 44 46 4c 41 47 53 20 74 6f 20 69 6e 63 6c   LDFLAGS to incl
17c0: 75 64 65 20 73 65 74 74 69 6e 67 20 74 68 65 20  ude setting the 
17d0: 72 75 6e 2d 74 69 6d 65 20 6c 69 6e 6b 65 72 20  run-time linker 
17e0: 70 61 74 68 20 74 6f 20 74 68 65 20 73 61 6d 65  path to the same
17f0: 20 61 73 20 6f 75 72 20 63 6f 6d 70 69 6c 65 2d   as our compile-
1800: 74 69 6d 65 20 6c 69 6e 6b 65 72 0a 44 43 5f 53  time linker.DC_S
1810: 59 4e 43 5f 52 50 41 54 48 0a 0a 64 6e 6c 20 49  YNC_RPATH..dnl I
1820: 66 20 77 65 20 75 70 64 61 74 65 64 20 4c 49 42  f we updated LIB
1830: 4f 42 4a 53 2c 20 75 70 64 61 74 65 20 53 48 4c  OBJS, update SHL
1840: 49 42 4f 42 4a 53 20 2d 2d 20 6d 75 73 74 20 62  IBOBJS -- must b
1850: 65 20 6c 61 73 74 2e 0a 44 43 5f 53 59 4e 43 5f  e last..DC_SYNC_
1860: 53 48 4c 49 42 4f 42 4a 53 0a 0a 64 6e 6c 20 50  SHLIBOBJS..dnl P
1870: 72 6f 64 75 63 65 20 4d 61 6b 65 66 69 6c 65 0a  roduce Makefile.
1880: 41 43 5f 4f 55 54 50 55 54 28 4d 61 6b 65 66 69  AC_OUTPUT(Makefi
1890: 6c 65 20 6c 69 62 63 61 63 6b 65 79 2e 73 79 6d  le libcackey.sym
18a0: 73 29 0a                                         s).