[gmime] Added --disable-cryptography flag



commit 566f68c189a6ea6f96e8ed3b7299bda809cb802c
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Tue Apr 13 09:50:00 2010 -0400

    Added --disable-cryptography flag
    
    2010-04-13  Jeffrey Stedfast  <fejj novell com>
    
    	* configure.ac: Added a --disable-cryptography flag to alloow
    	building without GnuPG or S/MIME support. Thanks to
    	pier11 operamail com for this patch. Fixes bug #615343.

 ChangeLog                |    4 ++++
 configure.ac             |   16 +++++++++++++++-
 examples/basic-example.c |    2 ++
 gmime/Makefile.am        |   16 ++++++++++++----
 tests/Makefile.am        |   14 ++++++++++++--
 5 files changed, 45 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fe30bbc..718e7a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-13  Jeffrey Stedfast  <fejj novell com>
 
+	* configure.ac: Added a --disable-cryptography flag to alloow
+	building without GnuPG or S/MIME support. Thanks to
+	pier11 operamail com for this patch. Fixes bug #615343.
+
 	* tests/test-streams.c: Use glib's G_GINT64_FORMAT and
 	G_GSIZE_FORMAT macros for our various *printf needs to be more
 	portable. Thanks to pier11 operamail com for this patch.
diff --git a/configure.ac b/configure.ac
index 3e96ce0..d334b38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,6 +225,17 @@ if test "x$enable_warnings" = "xyes"; then
   AC_DEFINE(ENABLE_WARNINGS, 1, [Define if GMime should enable warning output.])
 fi
 
+dnl Disable cryptography support
+AC_ARG_ENABLE(cryptography,
+              AC_HELP_STRING([--disable-cryptography],
+	      [disables cryptography support in GMIME [[default=no]]]),,
+	      enable_cryptography=yes)
+AM_CONDITIONAL(ENABLE_CRYPTOGRAPHY, test "x$enable_cryptography" = "xyes")
+if test "x$enable_cryptography" = "xyes"; then
+  AC_DEFINE(ENABLE_CRYPTOGRAPHY, 1, [Define if cryptography in GMime is enabled.])
+fi
+
+
 dnl We need at *least* glib 2.16.0 for GIO
 AM_PATH_GLIB_2_0(2.16.0, ,
 		 AC_MSG_ERROR(Cannot find GLIB: Is pkg-config in your path?),
@@ -465,6 +476,8 @@ dnl *************************
 LIBNSL=""
 AC_CHECK_LIB(nsl, getaddrinfo, LIBNSL="-lnsl")
 
+enable_smime="no"
+if test "x$enable_cryptography" = "xyes"; then
 dnl ******************************************
 dnl *** Checks for GpgME needed for S/MIME ***
 dnl ******************************************
@@ -472,6 +485,7 @@ AM_PATH_GPGME_PTHREAD(1.1.6, enable_smime="yes (via GpgME)", enable_smime="no")
 if test "x$enable_smime" != "xno"; then
   AC_DEFINE(ENABLE_SMIME, 1, [Define if GMime should enable experimental S/MIME support.])
 fi
+fi
 
 dnl ****************************
 dnl *** Enable Mono bindings ***
@@ -618,7 +632,7 @@ Configuration:
 
   Large file support:   ${enable_largefile}
   Console warnings:     ${enable_warnings}
-  PGP/MIME support:     yes
+  PGP/MIME support:     ${enable_cryptography}
   S/MIME support:       ${enable_smime}
 
   Mono bindings:        ${enable_mono}
diff --git a/examples/basic-example.c b/examples/basic-example.c
index 3d14cdc..c0bc0dc 100644
--- a/examples/basic-example.c
+++ b/examples/basic-example.c
@@ -308,6 +308,7 @@ int main (int argc, char **argv)
 	count_parts_in_message (message);
 	
 #ifndef G_OS_WIN32
+#ifdef ENABLE_CRYPTOGRAPHY
 	/* create our cipher context */
 	ctx = g_mime_gpg_context_new (request_passwd, path);
 	
@@ -321,6 +322,7 @@ int main (int argc, char **argv)
 	verify_signed_parts (message, ctx);
 	g_object_unref (ctx);
 #endif
+#endif
 	
 	/* add and remove parts */
 	add_a_mime_part (message);
diff --git a/gmime/Makefile.am b/gmime/Makefile.am
index a7ed379..b8083d3 100644
--- a/gmime/Makefile.am
+++ b/gmime/Makefile.am
@@ -41,7 +41,6 @@ libgmime_2_6_la_SOURCES = 		\
 	gmime-filter-strip.c		\
 	gmime-filter-windows.c		\
 	gmime-filter-yenc.c		\
-	gmime-gpg-context.c		\
 	gmime-header.c			\
 	gmime-iconv.c			\
 	gmime-iconv-utils.c		\
@@ -56,7 +55,6 @@ libgmime_2_6_la_SOURCES = 		\
 	gmime-parse-utils.c		\
 	gmime-parser.c			\
 	gmime-part.c			\
-	gmime-pkcs7-context.c		\
 	gmime-stream.c			\
 	gmime-stream-buffer.c		\
 	gmime-stream-cat.c		\
@@ -71,6 +69,12 @@ libgmime_2_6_la_SOURCES = 		\
 	gmime-utils.c			\
 	internet-address.c
 
+if ENABLE_CRYPTOGRAPHY
+libgmime_2_6_la_SOURCES += 		\
+	gmime-gpg-context.c		\
+	gmime-pkcs7-context.c
+endif
+
 gmimeinclude_HEADERS = 			\
 	gmime.h				\
 	gmime-charset.h			\
@@ -93,7 +97,6 @@ gmimeinclude_HEADERS = 			\
 	gmime-filter-strip.h		\
 	gmime-filter-windows.h		\
 	gmime-filter-yenc.h		\
-	gmime-gpg-context.h		\
 	gmime-header.h			\
 	gmime-iconv.h			\
 	gmime-iconv-utils.h		\
@@ -107,7 +110,6 @@ gmimeinclude_HEADERS = 			\
 	gmime-param.h			\
 	gmime-parser.h			\
 	gmime-part.h			\
-	gmime-pkcs7-context.h		\
 	gmime-stream.h			\
 	gmime-stream-buffer.h		\
 	gmime-stream-cat.h		\
@@ -123,6 +125,12 @@ gmimeinclude_HEADERS = 			\
 	gmime-version.h			\
 	internet-address.h
 
+if ENABLE_CRYPTOGRAPHY
+gmimeinclude_HEADERS +=			\
+	gmime-gpg-context.h		\
+	gmime-pkcs7-context.h
+endif
+
 noinst_HEADERS = 			\
 	gmime-charset-map-private.h	\
 	gmime-table-private.h		\
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 034e5d2..40341cf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,17 +16,25 @@ AUTOMATED_TESTS =	\
 	test-cat	\
 	test-headers	\
 	test-mbox	\
-	test-mime	\
+	test-mime
+
+if ENABLE_CRYPTOGRAPHY
+AUTOMATED_TESTS +=	\
 	test-pgp	\
 	test-pgpmime
+endif
 
 MANUAL_TESTS =		\
 	test-best	\
 	test-parser 	\
 	test-html 	\
-	test-partial	\
+	test-partial
+
+if ENABLE_CRYPTOGRAPHY
+MANUAL_TESTS +=		\
 	test-pkcs7	\
 	test-smime
+endif
 
 noinst_PROGRAMS = $(AUTOMATED_TESTS) $(MANUAL_TESTS)
 
@@ -83,6 +91,7 @@ test_partial_LDFLAGS =
 test_partial_DEPENDENCIES = $(DEPS)
 test_partial_LDADD = $(LDADDS)
 
+if ENABLE_CRYPTOGRAPHY
 test_pgp_SOURCES = test-pgp.c testsuite.c testsuite.h
 test_pgp_LDFLAGS = 
 test_pgp_DEPENDENCIES = $(DEPS)
@@ -102,6 +111,7 @@ test_smime_SOURCES = test-smime.c testsuite.c testsuite.h
 test_smime_LDFLAGS = 
 test_smime_DEPENDENCIES = $(DEPS)
 test_smime_LDADD = $(LDADDS)
+endif
 
 EXTRA_DIST = test1.eml test2.eml test3.eml
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]