[svn] ksba - r315 - in trunk: . src tests

svn author wk cvs at cvs.gnupg.org
Fri Jan 22 13:09:42 CET 2010


Author: wk
Date: 2010-01-22 13:09:42 +0100 (Fri, 22 Jan 2010)
New Revision: 315

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/autogen.sh
   trunk/configure.ac
   trunk/ltmain.sh
   trunk/src/ChangeLog
   trunk/src/ber-decoder.c
   trunk/src/util.c
   trunk/tests/ChangeLog
   trunk/tests/cert-basic.c
Log:
Support WindowsCE.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/ChangeLog	2010-01-22 12:09:42 UTC (rev 315)
@@ -1,3 +1,13 @@
+2010-01-22  Werner Koch  <wk at g10code.com>
+
+	* autogen.sh: Support --build-w32ce.
+
+	* configure.ac: Require libgpg-error 1.8.
+	(HAVE_W32CE_SYSTEM): New am_defines and am_conditionals.
+	(AC_CHECK_FUNCS): Check for getenv.
+
+	* ltmain.sh (wrappers_required): Don't set for mingw32ce.
+
 2009-12-08  Marcus Brinkmann  <marcus at g10code.de>
 
 	Update to libtool 2.2.6a.

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/src/ChangeLog	2010-01-22 12:09:42 UTC (rev 315)
@@ -1,3 +1,10 @@
+2010-01-22  Werner Koch  <wk at g10code.com>
+
+	* util.c (ksba_calloc): Use gpg_er_set_errno.
+
+	* ber-decoder.c (_ksba_ber_decoder_dump)
+	(_ksba_ber_decoder_decode) [!HAVE_GETENV]: Set debug to 0.
+
 2009-12-08  Marcus Brinkmann  <marcus at g10code.de>
 
 	* src/Makefile.am (LTRCCOMPILE): Refactor with ...

Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/tests/ChangeLog	2010-01-22 12:09:42 UTC (rev 315)
@@ -1,3 +1,8 @@
+2010-01-22  Werner Koch  <wk at g10code.com>
+
+	* cert-basic.c (getenv) [__MINGW32CE__]: Add dummy.
+	(one_file): Use binary flag for fopen.
+
 2008-10-30  Werner Koch  <wk at g10code.com>
 
 	* t-cms-parser.c (dummy_hash_fnc): Mark unused args.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/NEWS	2010-01-22 12:09:42 UTC (rev 315)
@@ -1,7 +1,9 @@
 Noteworthy changes in version 1.0.8 (unreleased)
 ------------------------------------------------
 
+ * Support for WindowsCE.
 
+
 Noteworthy changes in version 1.0.7 (2009-07-03)
 ------------------------------------------------
 

Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/autogen.sh	2010-01-22 12:09:42 UTC (rev 315)
@@ -35,10 +35,25 @@
   shift
 fi
 
+# Convenience option to use certain configure options for some hosts.
+myhost="" 
+myhostsub=""
+case "$1" in
+    --build-w32)
+        myhost="w32"
+        ;;
+    --build-w32ce)
+        myhost="w32"
+        myhostsub="ce"
+        ;;
+    *)
+     ;;
+esac
 
+
 # ***** W32 build script *******
 # Used to cross-compile for Windows.
-if test "$1" = "--build-w32"; then
+if [ "$myhost" = "w32" ]; then
     tmp=`dirname $0`
     tsdir=`cd "$tmp"; pwd`
     shift
@@ -48,11 +63,20 @@
     fi
     build=`$tsdir/config.guess`
 
-    [ -z "$w32root" ] && w32root="$HOME/w32root"
+    case $myhostsub in
+        ce)
+          [ -z "$w32root" ] && w32root="$HOME/w32ce_root"
+          toolprefixes="arm-mingw32ce"
+          ;;
+        *)
+          [ -z "$w32root" ] && w32root="$HOME/w32root"
+          toolprefixes="i586-mingw32msvc i386-mingw32msvc"
+          ;;
+    esac
     echo "Using $w32root as standard install directory" >&2
     
     crossbindir=
-    for host in i586-mingw32msvc i386-mingw32msvc mingw32; do
+    for host in $toolprefixes; do
         if ${host}-gcc --version >/dev/null 2>&1 ; then
             crossbindir=/usr/${host}/bin
             conf_CC="CC=${host}-gcc"
@@ -61,8 +85,10 @@
     done
     if [ -z "$crossbindir" ]; then
         echo "Cross compiler kit not installed" >&2
-        echo "Under Debian GNU/Linux, you may install it using" >&2
-        echo "  apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2 
+        if [ -z "$sub" ]; then 
+          echo "Under Debian GNU/Linux, you may install it using" >&2
+          echo "  apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2 
+        fi
         echo "Stop." >&2
         exit 1
     fi

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/configure.ac	2010-01-22 12:09:42 UTC (rev 315)
@@ -46,7 +46,7 @@
 KSBA_CONFIG_API_VERSION=1
 
 
-NEED_GPG_ERROR_VERSION=1.4
+NEED_GPG_ERROR_VERSION=1.8
 
 BUILD_REVISION=svn_revision
 PACKAGE=$PACKAGE_NAME
@@ -163,7 +163,12 @@
 
 # Setup some stuff depending on host.
 have_w32_system=no
+have_w32ce_system=no
 case "${host}" in
+    *-*-mingw32ce*)
+      have_w32_system=yes
+      have_w32ce_system=yes
+      ;;
     *-*-mingw32*)
       have_w32_system=yes
       ;;
@@ -172,8 +177,12 @@
 esac
 if test "$have_w32_system" = yes; then
    AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
+   if test "$have_w32ce_system" = yes; then
+     AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
+   fi
 fi
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
+AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
 
 
 # For some systems we know that we have ld_version scripts.  
@@ -308,7 +317,7 @@
 
 
 # Checks for library functions.
-AC_CHECK_FUNCS([memmove strchr strtol strtoul stpcpy gmtime_r])
+AC_CHECK_FUNCS([memmove strchr strtol strtoul stpcpy gmtime_r getenv])
 
 
 # GNUlib checks

Modified: trunk/ltmain.sh
===================================================================
--- trunk/ltmain.sh	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/ltmain.sh	2010-01-22 12:09:42 UTC (rev 315)
@@ -7681,15 +7681,15 @@
 
       wrappers_required=yes
       case $host in
+      *cegcc | *mingw32ce*)
+        # Disable wrappers for Windows CE, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
       *cygwin* | *mingw* )
         if test "$build_libtool_libs" != yes; then
           wrappers_required=no
         fi
         ;;
-      *cegcc)
-        # Disable wrappers for cegcc, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
       *)
         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
           wrappers_required=no

Modified: trunk/src/ber-decoder.c
===================================================================
--- trunk/src/ber-decoder.c	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/src/ber-decoder.c	2010-01-22 12:09:42 UTC (rev 315)
@@ -1021,7 +1021,11 @@
   if (!d)
     return gpg_error (GPG_ERR_INV_VALUE);
 
+#ifdef HAVE_GETENV
   d->debug = !!getenv("KSBA_DEBUG_BER_DECODER");
+#else
+  d->debug = 0;
+#endif
   d->use_image = 0;
   d->image.buf = NULL;
   err = decoder_init (d, NULL);
@@ -1123,7 +1127,11 @@
   if (r_root)
     *r_root = NULL;
 
+#ifdef HAVE_GETENV
   d->debug = !!getenv("KSBA_DEBUG_BER_DECODER");
+#else
+  d->debug = 0;
+#endif
   d->honor_module_end = 1;
   d->use_image = 1;
   d->image.buf = NULL;

Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/src/util.c	2010-01-22 12:09:42 UTC (rev 315)
@@ -128,7 +128,7 @@
   nbytes = n * m;
   if ( m && nbytes / m != n)
     {
-      errno = ENOMEM;
+      gpg_err_set_errno (ENOMEM);
       p = NULL;
     }
   else

Modified: trunk/tests/cert-basic.c
===================================================================
--- trunk/tests/cert-basic.c	2009-12-08 20:21:21 UTC (rev 314)
+++ trunk/tests/cert-basic.c	2010-01-22 12:09:42 UTC (rev 315)
@@ -29,6 +29,10 @@
 
 #include "oidtranstbl.h"
 
+#ifdef __MINGW32CE__
+#define getenv(a) (NULL)
+#endif
+
 #define digitp(p)   (*(p) >= '0' && *(p) <= '9')
 
 #define fail_if_err(a) do { if(a) {                                       \
@@ -508,7 +512,7 @@
   ksba_sexp_t sexp;
   const char *oid, *s;
 
-  fp = fopen (fname, "r");
+  fp = fopen (fname, "rb");
   if (!fp)
     {
       fprintf (stderr, "%s:%d: can't open `%s': %s\n", 
@@ -566,6 +570,8 @@
   s = get_oid_desc (oid);
   printf ("  hash algo.: %s%s%s%s\n", oid, s?" (":"",s?s:"",s?")":"");
 
+  /* Under Windows the _ksba_keyinfo_from_sexp are not exported.  */
+#ifndef __WIN32
   /* check that the sexp to keyinfo conversion works */
   {
     ksba_sexp_t public;
@@ -641,6 +647,7 @@
           }
       }
   }
+#endif
 
   if (verbose)
     {




More information about the Gnupg-commits mailing list