Check-in [a708a36250]
Overview
Comment:Updated to support building static archives and to check a cache variable regarding PC/SC working
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a708a3625001160f768984e6bac2eccc43a75dbd
User & Date: rkeene on 2016-02-03 18:57:58
Other Links: manifest | tags
Context
2016-02-04
17:36
Better work towards a Chrome plugin check-in: 7c7e9cf4fc user: rkeene tags: trunk
2016-02-03
18:57
Updated to support building static archives and to check a cache variable regarding PC/SC working check-in: a708a36250 user: rkeene tags: trunk
18:50
Updated to cast length variable to the correct type for formatting check-in: df8d7782c8 user: rkeene tags: trunk
Changes

Modified Makefile.in from [a9f033d493] to [9978cadd3e].

    10     10   AR = @AR@
    11     11   RANLIB = @RANLIB@
    12     12   prefix = @prefix@
    13     13   exec_prefix = @exec_prefix@
    14     14   libdir = @libdir@
    15     15   @SET_MAKE@
    16     16   
    17         -all:
           17  +all: @DEFAULT_TARGET@
           18  +
           19  +shared:
    18     20   	$(MAKE) libcackey.@SHOBJEXT@
    19     21   	-$(MAKE) libcackey_g.@SHOBJEXT@
    20     22   
           23  +static:
           24  +	$(MAKE) libcackey.a
           25  +	-$(MAKE) libcackey_g.a
           26  +
    21     27   cackey.o: cackey.c cackey_builtin_certs.h sha1.c sha1.h md5.c md5.h asn1-x509.c asn1-x509.h config.h
    22     28   	$(CC) $(SHOBJFLAGS) $(CPPFLAGS) $(CFLAGS) -o cackey.o -c cackey.c
    23     29   
    24     30   cackey_g.o: cackey.c cackey_builtin_certs.h sha1.c sha1.h md5.c md5.h asn1-x509.c asn1-x509.h config.h
    25     31   	$(CC) $(SHOBJFLAGS) $(DEBUGCPPFLAGS) $(DEBUGCFLAGS) -o cackey_g.o -c cackey.c
    26     32   
    27     33   libcackey.@SHOBJEXT@: cackey.o
................................................................................
    29     35   	-@WEAKENSYMS@ "libcackey.@SHOBJEXT@"
    30     36   	-@REMOVESYMS@ "libcackey.@SHOBJEXT@"
    31     37   
    32     38   libcackey_g.@SHOBJEXT@: cackey_g.o
    33     39   	$(CC) $(SHOBJFLAGS) $(DEBUGCPPFLAGS) $(DEBUGCFLAGS) $(SHOBJLDFLAGS) $(LDFLAGS) -o libcackey_g.@SHOBJEXT@ cackey_g.o $(LIBS)
    34     40   	-@WEAKENSYMS@ "libcackey_g.@SHOBJEXT@"
    35     41   
           42  +libcackey.a: cackey.o
           43  +	rm -f libcackey.a
           44  +	$(AR) rcu libcackey.a cackey.o
           45  +	-$(RANLIB) libcackey.a
           46  +
           47  +libcackey_g.a: cackey_g.o
           48  +	rm -f libcackey_g.a
           49  +	$(AR) rcu libcackey_g.a cackey_g.o
           50  +	-$(RANLIB) libcackey_g.a
           51  +
    36     52   test: test.c libcackey_g.@SHOBJEXT@
    37     53   	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test test.c -Wl,-R,. libcackey_g.@SHOBJEXT@
    38     54   
    39     55   test-afl.data: test
    40     56   	tmpLogFile='log.$(shell openssl rand -hex 16)'; \
    41     57   		./test 2> $${tmpLogFile}; \
    42     58   		echo -ne "$$( \
................................................................................
    68     84   
    69     85   distclean: clean
    70     86   	rm -f config.log config.status config.h Makefile libcackey.syms
    71     87   
    72     88   mrproper: distclean
    73     89   	rm -f configure config.h.in aclocal.m4 *~
    74     90   
    75         -.PHONY: all clean distclean mrproper install
           91  +.PHONY: all shared static clean distclean mrproper install

Modified aclocal/dc_shobjs.m4 from [9ca31dd769] to [278f27f121].

    18     18   
    19     19     LDFLAGS="$OLD_LDFLAGS"
    20     20   ])
    21     21   
    22     22   AC_DEFUN(DC_GET_SHOBJFLAGS, [
    23     23     AC_SUBST(SHOBJFLAGS)
    24     24     AC_SUBST(SHOBJLDFLAGS)
           25  +  AC_SUBST(DEFAULT_TARGET)
    25     26   
    26     27     AC_MSG_CHECKING(how to create shared objects)
    27     28   
           29  +  DEFAULT_TARGET=shared
    28     30     if test -z "$SHOBJFLAGS" -a -z "$SHOBJLDFLAGS"; then
    29     31       DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic], [
    30     32         DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared], [
    31     33   	DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic -mimpure-text], [
    32     34   	  DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -mimpure-text], [
    33     35   	    DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic -Wl,-G,-z,textoff], [
    34     36   	      DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -Wl,-G,-z,textoff], [
    35     37   		DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -dynamiclib -flat_namespace -undefined suppress -bind_at_load], [
    36     38   		  DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib -flat_namespace -undefined suppress -bind_at_load], [
    37     39   		    DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-Wl,-dynamiclib -Wl,-flat_namespace -Wl,-undefined,suppress -Wl,-bind_at_load], [
    38     40   		      DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib -flat_namespace -undefined suppress], [
    39     41   		        DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib], [
    40         -		          AC_MSG_RESULT(cant)
    41         -		          AC_MSG_ERROR([We are unable to make shared objects.])
           42  +                          DEFAULT_TARGET=static
    42     43                           ])
    43     44   		      ])
    44     45   		    ])
    45     46   		  ])
    46     47   		])
    47     48   	      ])
    48     49   	    ])
    49     50   	  ])
    50     51   	])
    51     52         ])
    52     53       ])
    53     54     fi
    54     55   
           56  +  if test "$DEFAULT_TARGET" = 'shared' ; then
    55     57     AC_MSG_RESULT($SHOBJLDFLAGS $SHOBJFLAGS)
           58  +  else
           59  +    AC_MSG_RESULT(cant -- result will be a static archive)
           60  +  fi
    56     61   
    57     62     DC_SYNC_SHLIBOBJS
    58     63   ])
    59     64   
    60     65   AC_DEFUN(DC_SYNC_SHLIBOBJS, [
    61     66     AC_SUBST(SHLIBOBJS)
    62     67     SHLIBOBJS=""

Modified build/chrome/build-deps from [bf636f72b1] to [f83599ae85].

   285    285   
   286    286   	return 0
   287    287   }
   288    288   
   289    289   function buildCACKey() {
   290    290   	local platform
   291    291   	local file copied
          292  +	local targets
   292    293   
   293    294   	platform="$1"
   294    295   	shift
   295    296   
   296    297   	if [ -z "${platform}" ]; then
   297    298   		echo 'error: Platform not specified' >&2
   298    299   
................................................................................
   305    306   		make distclean
   306    307   
   307    308   		./configure --with-pcsc-headers="${cackeyChromeExtPCSCLiteDir}/include/PCSC" --with-pcsc-libs="${PCSC_LIBS}" "$@" || exit 1
   308    309   		make || exit 1
   309    310   	) || return 1
   310    311   
   311    312   	copied='0'
   312         -	for file in ../../libcackey{,_g}.{so,dll,dylib}; do
          313  +	for file in ../../libcackey{,_g}.{so,dll,dylib,a}; do
   313    314   		if [ -f "${file}" ]; then
   314    315   			mkdir -p "${outdir}/${platform}"
   315    316   
   316    317   			cp "${file}" "${outdir}/${platform}"
   317    318   			copied='1'
   318    319   		fi
   319    320   	done
................................................................................
   343    344   rm -rf "${outdir}"
   344    345   mkdir "${outdir}" || exit 1
   345    346   
   346    347   buildPCSCLite || exit 1
   347    348   
   348    349   buildCACKey build || exit 1
   349    350   
   350         -buildOutputType="$(echo 'int main(int argc, char **argv) { return(0); }' | "${CC:-cc}" -x c - -o /dev/stdout | file -)" || exit 1
   351         -case "${buildOutputType}" in
   352         -	*x86-64*)
   353         -		naclTopDir='linux_x86_glibc'
   354         -		naclPlatform='x86_64-nacl'
   355         -		;;
   356         -	*)
   357         -		echo "error: Unrecognized platform output: \"${buildOutputType}\"" >&2
   358         -
   359         -		exit 1
   360         -		;;
   361         -esac
   362         -PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${naclTopDir}/bin" buildCACKey "${naclPlatform}" --host="${naclPlatform}" CC=${naclPlatform}-gcc LD=${naclPlatform}-ld OBJCOPY=${naclPlatform}-objcopy STRIP=${naclPlatform}-strip || exit 1
          351  +PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/linux_pnacl/bin" buildCACKey pnacl --host="nacl" CC=pnacl-clang LD=pnacl-ld OBJCOPY=pnacl-objcopy STRIP=pnacl-strip AR=pnacl-ar RANLIB=pnacl-ranlib cackey_cv_pcsc_works=okay || exit 1
   363    352   
   364    353   cleanup
   365    354   
   366    355   exit 0

Modified configure.ac from [e7d2982c77] to [5e1ee40fe1].

    79     79   dnl Check for PC/SC headers and libraries
    80     80   DC_PCSC
    81     81   
    82     82   dnl Check for ZLIB libraries
    83     83   AC_CHECK_LIB(z, uncompress)
    84     84   
    85     85   dnl Verify that a basic program will compile
    86         -AC_MSG_CHECKING([if basic PC/SC program works])
           86  +AC_CACHE_CHECK([if basic PC/SC program works], cackey_cv_pcsc_works, [
    87     87   AC_LINK_IFELSE(
    88     88   	AC_LANG_PROGRAM([[
    89     89   #ifdef HAVE_WINTYPES_H
    90     90   #  include <wintypes.h>
    91     91   #endif
    92     92   #ifdef HAVE_PCSCLITE_H
    93     93   #  include <pcsclite.h>
................................................................................
   131    131   		LONG scard_conn_ret, scard_est_context_ret;
   132    132   
   133    133   		scard_est_context_ret = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
   134    134   
   135    135   		hCard = NULL;
   136    136   		scard_conn_ret = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, hCard, &dwActiveProtocol);
   137    137   	]]), [
   138         -		AC_MSG_RESULT(okay)
          138  +			cackey_cv_pcsc_works=okay
   139    139   	], [
   140         -		AC_MSG_RESULT(failed)
   141         -
   142         -		AC_MSG_FAILURE([simple PC/SC program failed])
          140  +			cackey_cv_pcsc_works=failed
          141  +		])
   143    142   	]
   144    143   )
          144  +
          145  +if test "$cackey_cv_pcsc_works" = 'failed'; then
          146  +	AC_MSG_FAILURE([simple PC/SC program failed])
          147  +fi
   145    148   
   146    149   dnl Option to enable DoD certs on hardware slot
   147    150   AC_ARG_ENABLE(dod-certs-on-hw-slots, AC_HELP_STRING([--enable-dod-certs-on-hw-slots], [Specify that DoD certificates should be made available on hardware token slots]), [
   148    151   	dodcertsonhwslots=$enableval
   149    152   ], [
   150    153   	dodcertsonhwslots=no
   151    154   ])