[gmime/gmime-2-4] Added --disable-cryptography configure flag



commit fc6a9b54a900c89aeda27a28ab13d7d77a6ecf9e
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Wed Apr 14 09:10:56 2010 -0400

    Added --disable-cryptography configure 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 #615685.

 ChangeLog                |    4 ++++
 configure.in             |   11 +++++++++++
 examples/basic-example.c |    2 ++
 gmime/Makefile.am        |   12 ++++++++++--
 tests/Makefile.am        |    8 +++++++-
 5 files changed, 34 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e1cc6e3..4384ce3 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 #615685.
+
 	* 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.in b/configure.in
index 8d8dc4a..3e8450d 100644
--- a/configure.in
+++ b/configure.in
@@ -157,6 +157,16 @@ 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.12.0 for g_hash_table_remove_all()
 AM_PATH_GLIB_2_0(2.12.0, ,
 		 AC_MSG_ERROR(Cannot find GLIB: Is pkg-config in your path?),
@@ -541,6 +551,7 @@ Configuration:
 
   Large file support:   ${enable_largefile}
   Console warnings:     ${enable_warnings}
+  PGP/MIME support:     ${enable_cryptography}
 
   Mono bindings:        ${enable_mono}
 "
diff --git a/examples/basic-example.c b/examples/basic-example.c
index 5d2d13e..92493de 100644
--- a/examples/basic-example.c
+++ b/examples/basic-example.c
@@ -363,6 +363,7 @@ int main (int argc, char **argv)
 	count_parts_in_message (message);
 	
 #ifndef G_OS_WIN32
+#ifdef ENABLE_CRYPTOGRAPHY
 	/* create our cipher context (and session - which is used by the context to query the user) */
 	session = g_object_new (example_session_get_type (), NULL);
 	ctx = g_mime_gpg_context_new (session, path);
@@ -375,6 +376,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 f3bed5b..1ae5350 100644
--- a/gmime/Makefile.am
+++ b/gmime/Makefile.am
@@ -44,7 +44,6 @@ libgmime_2_4_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		\
@@ -73,6 +72,11 @@ libgmime_2_4_la_SOURCES = 		\
 	gmime-utils.c			\
 	internet-address.c
 
+if ENABLE_CRYPTOGRAPHY
+libgmime_2_4_la_SOURCES += 		\
+	gmime-gpg-context.c
+endif
+
 gmimeinclude_HEADERS = 			\
 	gmime.h				\
 	gmime-charset.h			\
@@ -95,7 +99,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		\
@@ -124,6 +127,11 @@ gmimeinclude_HEADERS = 			\
 	gmime-utils.h			\
 	internet-address.h
 
+if ENABLE_CRYPTOGRAPHY
+gmimeinclude_HEADERS +=			\
+	gmime-gpg-context.h
+endif
+
 noinst_HEADERS = 			\
 	gmime-common.h			\
 	gmime-table-private.h		\
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9a3566c..5b78d32 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,9 +22,13 @@ 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	\
@@ -87,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)
@@ -96,6 +101,7 @@ test_pgpmime_SOURCES = test-pgpmime.c testsuite.c testsuite.h
 test_pgpmime_LDFLAGS = 
 test_pgpmime_DEPENDENCIES = $(DEPS)
 test_pgpmime_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]