Index: configure.in
===================================================================
--- configure.in	(revision 1597)
+++ configure.in	(working copy)
@@ -104,7 +104,28 @@ if test	"$DO_CHECK" = "yes"; then
         break
       fi
     done
-    
+  else
+      AC_PATH_PROG(GNUPG, gpg2, no)
+      
+      if test "$GNUPG" != "no"; then
+        AC_MSG_CHECKING(for appropriate GnuPG version)
+        gnupg_version=`$GNUPG --version | grep gpg2`
+        major=`echo $gnupg_version | \
+    		sed 's/^gpg2 (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+        minor=`echo $gnupg_version | \
+    		sed 's/^gpg2 (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+        micro=`echo $gnupg_version | \
+    		sed 's/^gpg2 (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+        
+        for ver in $accepted_versions; do
+          if test "$ver" = "$major.$minor"; then
+            AC_DEFINE_UNQUOTED(GPG_MAJOR, [$major], [GPG Major Version])
+            AC_DEFINE_UNQUOTED(GPG_MINOR, [$minor], [GPG Minor Version])
+            ok="yes"
+            break
+          fi
+        done
+    fi
   fi
   
   if test "$ok" = "yes"; then
