aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore26
-rw-r--r--CMakeLists.txt630
-rw-r--r--Doxyfile.in (renamed from vmime.doxygen)4
-rw-r--r--README.autotools11
-rw-r--r--SConstruct1478
-rw-r--r--cmake/FindCppUnit.cmake34
-rw-r--r--cmake/FindGSasl.cmake51
-rw-r--r--cmake/FindIconv.cmake61
-rw-r--r--cmake/TargetArch.cmake136
-rw-r--r--cmake/Utils.cmake13
-rw-r--r--cmake/config.hpp.cmake66
-rw-r--r--src/exception.cpp24
-rw-r--r--src/fileAttachment.cpp10
-rw-r--r--src/net/builtinServices.inl10
-rw-r--r--src/net/defaultConnectionInfos.cpp8
-rw-r--r--src/net/events.cpp10
-rw-r--r--src/net/folder.cpp10
-rw-r--r--src/net/imap/IMAPConnection.cpp10
-rw-r--r--src/net/imap/IMAPFolder.cpp10
-rw-r--r--src/net/imap/IMAPMessage.cpp11
-rw-r--r--src/net/imap/IMAPMessagePartContentHandler.cpp9
-rw-r--r--src/net/imap/IMAPPart.cpp9
-rw-r--r--src/net/imap/IMAPSStore.cpp10
-rw-r--r--src/net/imap/IMAPServiceInfos.cpp9
-rw-r--r--src/net/imap/IMAPStore.cpp10
-rw-r--r--src/net/imap/IMAPStructure.cpp9
-rw-r--r--src/net/imap/IMAPTag.cpp10
-rw-r--r--src/net/imap/IMAPUtils.cpp10
-rw-r--r--src/net/maildir/format/courierMaildirFormat.cpp9
-rw-r--r--src/net/maildir/format/kmailMaildirFormat.cpp9
-rw-r--r--src/net/maildir/maildirFolder.cpp10
-rw-r--r--src/net/maildir/maildirFormat.cpp9
-rw-r--r--src/net/maildir/maildirMessage.cpp10
-rw-r--r--src/net/maildir/maildirServiceInfos.cpp9
-rw-r--r--src/net/maildir/maildirStore.cpp10
-rw-r--r--src/net/maildir/maildirUtils.cpp12
-rw-r--r--src/net/message.cpp10
-rw-r--r--src/net/pop3/POP3Folder.cpp10
-rw-r--r--src/net/pop3/POP3Message.cpp10
-rw-r--r--src/net/pop3/POP3SStore.cpp9
-rw-r--r--src/net/pop3/POP3ServiceInfos.cpp9
-rw-r--r--src/net/pop3/POP3Store.cpp9
-rw-r--r--src/net/pop3/POP3Utils.cpp9
-rw-r--r--src/net/sendmail/sendmailServiceInfos.cpp9
-rw-r--r--src/net/sendmail/sendmailTransport.cpp12
-rw-r--r--src/net/service.cpp9
-rw-r--r--src/net/serviceFactory.cpp11
-rw-r--r--src/net/serviceInfos.cpp9
-rw-r--r--src/net/session.cpp10
-rw-r--r--src/net/smtp/SMTPResponse.cpp9
-rw-r--r--src/net/smtp/SMTPSTransport.cpp9
-rw-r--r--src/net/smtp/SMTPServiceInfos.cpp9
-rw-r--r--src/net/smtp/SMTPTransport.cpp10
-rw-r--r--src/net/tls/TLSSecuredConnectionInfos.cpp9
-rw-r--r--src/net/tls/TLSSession.cpp16
-rw-r--r--src/net/tls/TLSSocket.cpp9
-rw-r--r--src/net/transport.cpp9
-rw-r--r--src/platform.cpp40
-rw-r--r--src/platforms/posix/posixChildProcess.cpp9
-rw-r--r--src/platforms/posix/posixFile.cpp11
-rw-r--r--src/platforms/posix/posixHandler.cpp9
-rw-r--r--src/platforms/posix/posixSocket.cpp11
-rw-r--r--src/platforms/windows/windowsFile.cpp12
-rw-r--r--src/platforms/windows/windowsHandler.cpp11
-rw-r--r--src/platforms/windows/windowsSocket.cpp10
-rw-r--r--src/security/defaultAuthenticator.cpp9
-rw-r--r--src/security/sasl/SASLContext.cpp9
-rw-r--r--src/security/sasl/SASLMechanismFactory.cpp9
-rw-r--r--src/security/sasl/SASLSession.cpp9
-rw-r--r--src/security/sasl/SASLSocket.cpp9
-rw-r--r--src/security/sasl/builtinSASLMechanism.cpp9
-rw-r--r--src/security/sasl/defaultSASLAuthenticator.cpp9
-rw-r--r--src/utility/encoder/uuEncoder.cpp12
-rw-r--r--vmime/base.hpp2
-rw-r--r--vmime/exception.hpp30
-rw-r--r--vmime/fileAttachment.hpp9
-rw-r--r--vmime/net/connectionInfos.hpp8
-rw-r--r--vmime/net/defaultConnectionInfos.hpp8
-rw-r--r--vmime/net/events.hpp8
-rw-r--r--vmime/net/folder.hpp8
-rw-r--r--vmime/net/imap/IMAPConnection.hpp6
-rw-r--r--vmime/net/imap/IMAPFolder.hpp8
-rw-r--r--vmime/net/imap/IMAPMessage.hpp8
-rw-r--r--vmime/net/imap/IMAPMessagePartContentHandler.hpp8
-rw-r--r--vmime/net/imap/IMAPParser.hpp8
-rw-r--r--vmime/net/imap/IMAPPart.hpp8
-rw-r--r--vmime/net/imap/IMAPSStore.hpp8
-rw-r--r--vmime/net/imap/IMAPServiceInfos.hpp7
-rw-r--r--vmime/net/imap/IMAPStore.hpp6
-rw-r--r--vmime/net/imap/IMAPStructure.hpp8
-rw-r--r--vmime/net/imap/IMAPTag.hpp8
-rw-r--r--vmime/net/imap/IMAPUtils.hpp8
-rw-r--r--vmime/net/maildir/format/courierMaildirFormat.hpp8
-rw-r--r--vmime/net/maildir/format/kmailMaildirFormat.hpp9
-rw-r--r--vmime/net/maildir/maildirFolder.hpp8
-rw-r--r--vmime/net/maildir/maildirFormat.hpp8
-rw-r--r--vmime/net/maildir/maildirMessage.hpp8
-rw-r--r--vmime/net/maildir/maildirServiceInfos.hpp7
-rw-r--r--vmime/net/maildir/maildirStore.hpp6
-rw-r--r--vmime/net/maildir/maildirUtils.hpp8
-rw-r--r--vmime/net/message.hpp8
-rw-r--r--vmime/net/pop3/POP3Folder.hpp9
-rw-r--r--vmime/net/pop3/POP3Message.hpp6
-rw-r--r--vmime/net/pop3/POP3SStore.hpp8
-rw-r--r--vmime/net/pop3/POP3ServiceInfos.hpp7
-rw-r--r--vmime/net/pop3/POP3Store.hpp7
-rw-r--r--vmime/net/pop3/POP3Utils.hpp9
-rw-r--r--vmime/net/securedConnectionInfos.hpp8
-rw-r--r--vmime/net/sendmail/sendmailServiceInfos.hpp9
-rw-r--r--vmime/net/sendmail/sendmailTransport.hpp10
-rw-r--r--vmime/net/service.hpp7
-rw-r--r--vmime/net/serviceFactory.hpp8
-rw-r--r--vmime/net/serviceInfos.hpp8
-rw-r--r--vmime/net/session.hpp8
-rw-r--r--vmime/net/smtp/SMTPResponse.hpp8
-rw-r--r--vmime/net/smtp/SMTPSTransport.hpp8
-rw-r--r--vmime/net/smtp/SMTPServiceInfos.hpp7
-rw-r--r--vmime/net/smtp/SMTPTransport.hpp6
-rw-r--r--vmime/net/socket.hpp8
-rw-r--r--vmime/net/store.hpp8
-rw-r--r--vmime/net/timeoutHandler.hpp8
-rw-r--r--vmime/net/tls/TLSSecuredConnectionInfos.hpp8
-rw-r--r--vmime/net/tls/TLSSession.hpp8
-rw-r--r--vmime/net/tls/TLSSocket.hpp8
-rw-r--r--vmime/net/transport.hpp8
-rw-r--r--vmime/platform.hpp15
-rw-r--r--vmime/platforms/posix/posixChildProcess.hpp8
-rw-r--r--vmime/platforms/posix/posixFile.hpp11
-rw-r--r--vmime/platforms/posix/posixHandler.hpp7
-rw-r--r--vmime/platforms/posix/posixSocket.hpp9
-rw-r--r--vmime/platforms/windows/windowsFile.hpp10
-rw-r--r--vmime/platforms/windows/windowsHandler.hpp7
-rw-r--r--vmime/platforms/windows/windowsSocket.hpp11
-rw-r--r--vmime/security/authenticator.hpp8
-rw-r--r--vmime/security/cert/X509Certificate.hpp2
-rw-r--r--vmime/security/defaultAuthenticator.hpp8
-rw-r--r--vmime/security/sasl/SASLAuthenticator.hpp8
-rw-r--r--vmime/security/sasl/SASLContext.hpp8
-rw-r--r--vmime/security/sasl/SASLMechanism.hpp8
-rw-r--r--vmime/security/sasl/SASLMechanismFactory.hpp8
-rw-r--r--vmime/security/sasl/SASLSession.hpp8
-rw-r--r--vmime/security/sasl/SASLSocket.hpp8
-rw-r--r--vmime/security/sasl/builtinSASLMechanism.hpp8
-rw-r--r--vmime/security/sasl/defaultSASLAuthenticator.hpp8
144 files changed, 2168 insertions, 1576 deletions
diff --git a/.gitignore b/.gitignore
index b855c515..e24e48dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,33 @@
*.o
-*.swp
-build/
+*.sw?
*.a
*.dSYM
+*.vim
-/libvmime.a
-/vmime.pc
-/vmime/config.hpp
+# Doxygen-generated
+doc/html/*
# SConstruct
.sconsign.dblite
/options.cache
+# CMake-generated / Build files
+/CMakeFiles/
+/CMakeCache.txt
+/_CPack_Packages/
+/cmake_install.cmake
+/CPackConfig.cmake
+/CPackSourceConfig.cmake
+/Doxyfile
+/Makefile
+/install_manifest*
+/libvmime.a
+/libvmime.pc
+/libvmime*
+/vmime/config.hpp
+/COPYING.txt
+/build/
+
# Mac
._DS_Store
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..af636051
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,630 @@
+#
+# CMake configuration file for VMime
+#
+# Usage:
+#
+# . 'cmake -LH' to list build settings variable
+#
+# . 'cmake -G <generator>' to generate makefiles for a build system
+# eg. cmake -G "Unix Makefiles"
+#
+# For more information, please visit:
+# http://www.cmake.org
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
+
+INCLUDE(cmake/Utils.cmake)
+
+# CMake configuration
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY build/bin)
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY build/lib)
+
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+
+# Project
+PROJECT(vmime)
+
+# Package version number
+SET(VMIME_VERSION_MAJOR 0)
+SET(VMIME_VERSION_MINOR 9)
+SET(VMIME_VERSION_MICRO 2)
+
+# API version number (libtool)
+#
+# Increment this number only immediately before a public release.
+# This is independent from package version number.
+#
+# See: http://www.gnu.org/software/libtool/manual.html#Libtool-versioning
+#
+# . Implementation changed (eg. bug/security fix): REVISION++
+# . Interfaces added/removed/changed: CURRENT++, REVISION=0
+# . Interfaces added (upward-compatible changes): AGE++
+# . Interfaces removed: AGE=0
+SET(VMIME_API_VERSION_CURRENT 0)
+SET(VMIME_API_VERSION_REVISION 0)
+SET(VMIME_API_VERSION_AGE 0)
+
+
+SET(VMIME_VERSION ${VMIME_VERSION_MAJOR}.${VMIME_VERSION_MINOR}.${VMIME_VERSION_MICRO})
+SET(VMIME_API_VERSION ${VMIME_API_VERSION_CURRENT}.${VMIME_API_VERSION_REVISION}.${VMIME_API_VERSION_AGE})
+
+
+##############################################################################
+# VMime Library
+
+# Set base name
+SET(VMIME_LIBRARY_NAME vmime)
+
+# Source files
+FILE(
+ GLOB_RECURSE
+ VMIME_LIBRARY_SRC_FILES
+ src/*
+)
+
+FILE(
+ GLOB_RECURSE
+ VMIME_LIBRARY_INCLUDE_FILES
+ vmime/*
+)
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+# Automatically set lib suffix
+IF(UNIX AND NOT APPLE AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version")
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT LIB_SUFFIX)
+ SET(LIB_SUFFIX 64)
+ ENDIF()
+ENDIF()
+
+# Shared library
+ADD_LIBRARY(
+ ${VMIME_LIBRARY_NAME}
+ SHARED
+ ${VMIME_LIBRARY_SRC_FILES}
+ ${VMIME_LIBRARY_INCLUDE_FILES}
+)
+
+SET_TARGET_PROPERTIES(
+ ${VMIME_LIBRARY_NAME}
+ PROPERTIES
+ VERSION "${VMIME_VERSION}"
+ SOVERSION "${VMIME_API_VERSION}"
+)
+
+# Static library
+#
+# Note: cannot have two targets with the same name so the static version has
+# '-static' appended and then the name of the output file is set separately.
+ADD_LIBRARY(
+ ${VMIME_LIBRARY_NAME}-static
+ STATIC
+ ${VMIME_LIBRARY_SRC_FILES}
+ ${VMIME_LIBRARY_INCLUDE_FILES}
+)
+
+SET_TARGET_PROPERTIES(
+ ${VMIME_LIBRARY_NAME}-static
+ PROPERTIES
+ OUTPUT_NAME ${VMIME_LIBRARY_NAME}
+)
+
+# These next two lines are required but it is unclear exactly what they do.
+# The CMake FAQ mentions they are necessary and it does not work otherwise.
+SET_TARGET_PROPERTIES(${VMIME_LIBRARY_NAME} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+SET_TARGET_PROPERTIES(${VMIME_LIBRARY_NAME}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
+
+# Installation of libraries
+INSTALL(
+ TARGETS ${VMIME_LIBRARY_NAME}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT sharedlibs
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT sharedlibs
+)
+
+INSTALL(
+ TARGETS ${VMIME_LIBRARY_NAME}-static
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT staticlibs
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT staticlibs
+)
+
+# Installation of header files
+INSTALL_HEADERS_WITH_DIRECTORY(VMIME_LIBRARY_INCLUDE_FILES headers)
+
+#INSTALL(
+# FILES ${VMIME_LIBRARY_INCLUDE_FILES}
+# DESTINATION include
+# COMPONENT headers
+#)
+
+
+##############################################################################
+# Tests
+
+OPTION(
+ VMIME_BUILD_TESTS
+ "Build unit tests (this will create a 'run-tests' binary)"
+ OFF
+)
+
+IF(VMIME_BUILD_TESTS)
+
+ FILE(
+ GLOB_RECURSE
+ VMIME_TESTS_SRC_FILES
+ tests/*Test.cpp tests/testRunner.cpp tests/testUtils.cpp
+ )
+
+ ADD_EXECUTABLE(
+ "run-tests"
+ ${VMIME_TESTS_SRC_FILES}
+ )
+
+ INCLUDE(cmake/FindCppUnit.cmake)
+
+ INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIR})
+
+ TARGET_LINK_LIBRARIES(
+ "run-tests"
+ ${VMIME_LIBRARY_NAME}
+ ${CPPUNIT_LIBRARY}
+ )
+
+ ADD_DEPENDENCIES(
+ "run-tests"
+ ${VMIME_LIBRARY_NAME}
+ )
+
+ENDIF()
+
+
+##############################################################################
+# Packaging / Distribution
+
+# Package information
+SET(VMIME_PACKAGE_NAME ${VMIME_LIBRARY_NAME})
+SET(VMIME_PACKAGE_VERSION ${VMIME_VERSION})
+SET(VMIME_PACKAGE_CONTACT "Vincent Richard <[email protected]>")
+SET(VMIME_PACKAGE_DESCRIPTION "VMime C++ Mail Library (http://www.vmime.org)")
+
+SET(CPACK_PACKAGE_NAME "${VMIME_PACKAGE_NAME}")
+SET(CPACK_PACKAGE_CONTACT "${VMIME_PACKAGE_CONTACT}")
+SET(CPACK_PACKAGE_DESCRIPTION "${VMIME_PACKAGE_DESCRIPTION}")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION}")
+SET(CPACK_PACKAGE_VERSION "${VMIME_PACKAGE_VERSION}")
+
+# Package settings
+SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
+
+IF(APPLE)
+ # CPack/PackageManager won't allow file without recognized extension
+ # to be used as license file.
+ CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY)
+ SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.txt")
+ELSE()
+ SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
+ENDIF(APPLE)
+
+SET(CPACK_SOURCE_GENERATOR TGZ)
+SET(CPACK_SOURCE_IGNORE_FILES "\\\\.git;~$;build/")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
+
+# Set components
+SET(CPACK_COMPONENTS_ALL sharedlibs staticlibs headers)
+
+SET(CPACK_COMPONENT_SHAREDLIBS_DISPLAY_NAME "Shared libraries")
+SET(CPACK_COMPONENT_SHAREDLIBS_DESCRIPTION
+ "Shared library for general use.")
+
+SET(CPACK_COMPONENT_STATICLIBS_DISPLAY_NAME "Static libraries")
+SET(CPACK_COMPONENT_STATICLIBS_DESCRIPTION
+ "Static library, good if you want to embed VMime in your application.")
+
+SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
+SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
+ "C/C++ header files.")
+
+SET(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
+SET(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
+SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
+SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "")
+
+# Make a target "dist" to generate tarball
+SET(ARCHIVE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
+
+ADD_CUSTOM_TARGET(
+ dist
+ COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
+ | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+)
+
+# PkgConfig
+SET(prefix ${CMAKE_INSTALL_PREFIX})
+SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
+SET(includedir ${CMAKE_INSTALL_PREFIX}/include/vmime)
+
+SET(VMIME_PKGCONFIG_LIBS "")
+SET(VMIME_PKGCONFIG_CFLAGS "")
+SET(VMIME_PKGCONFIG_REQUIRES "")
+
+IF(${UNIX})
+ SET(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+ENDIF(${UNIX})
+IF(${WIN32})
+ SET(libdir ${CMAKE_INSTALL_PREFIX}/bin)
+ENDIF(${WIN32})
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libvmime.pc.in ${CMAKE_BINARY_DIR}/libvmime.pc @ONLY)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/libvmime.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT headers)
+
+
+##############################################################################
+# Build type
+
+IF(NOT CMAKE_BUILD_TYPE)
+ SET(
+ CMAKE_BUILD_TYPE
+ "Debug"
+ CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ FORCE
+ )
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+# Set a default build type for single-configuration
+# CMake generators if no build type is set.
+IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE Debug)
+ENDIF()
+
+# Debug build
+MESSAGE("-- Build type: ${CMAKE_BUILD_TYPE}")
+IF(${CMAKE_BUILD_TYPE} STREQUAL Debug)
+ ADD_DEFINITIONS(-DDEBUG)
+ENDIF(${CMAKE_BUILD_TYPE} STREQUAL Debug)
+
+
+IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ SET(VMIME_DEBUG 1)
+ELSE()
+ SET(VMIME_DEBUG 0)
+ENDIF()
+
+
+##############################################################################
+# Test endianness and basic type sizes
+
+INCLUDE(TestBigEndian)
+TEST_BIG_ENDIAN(BIGENDIAN)
+
+IF(BIGENDIAN EQUAL 0)
+ set(VMIME_BYTE_ORDER_BIG_ENDIAN 0)
+ set(VMIME_BYTE_ORDER_LITTLE_ENDIAN 1)
+ELSE(BIGENDIAN EQUAL 0)
+ SET(VMIME_BYTE_ORDER_BIG_ENDIAN 1)
+ SET(VMIME_BYTE_ORDER_LITTLE_ENDIAN 0)
+ENDIF(BIGENDIAN EQUAL 0)
+
+SET(VMIME_DEFAULT_8BIT_TYPE "char")
+SET(VMIME_DEFAULT_16BIT_TYPE "short")
+SET(VMIME_DEFAULT_32BIT_TYPE "int")
+
+
+SET(
+ VMIME_8BIT_TYPE
+ ${VMIME_DEFAULT_8BIT_TYPE}
+ CACHE STRING
+ "The C-language 8-bit type for your platform"
+)
+
+SET(
+ VMIME_16BIT_TYPE
+ ${VMIME_DEFAULT_16BIT_TYPE}
+ CACHE STRING
+ "The C-language 16-bit type for your platform"
+)
+
+SET(
+ VMIME_32BIT_TYPE
+ ${VMIME_DEFAULT_32BIT_TYPE}
+ CACHE STRING
+ "The C-language 32-bit type for your platform"
+)
+
+
+INCLUDE(cmake/TargetArch.cmake)
+TARGET_ARCHITECTURE(CMAKE_TARGET_ARCHITECTURES)
+
+
+##############################################################################
+# Sendmail path
+
+FOREACH (SENDMAIL_PATH /usr/sbin/sendmail /usr/lib/sendmail /usr/bin/sendmail /bin/sendmail /var/qmail/bin/qmail-inject /bin/cgimail)
+ IF(EXISTS ${SENDMAIL_PATH})
+ MESSAGE(STATUS "Sendmail binary found at ${SENDMAIL_PATH}")
+ SET(VMIME_DEFAULT_SENDMAIL_PATH ${SENDMAIL_PATH})
+ ENDIF()
+ENDFOREACH(SENDMAIL_PATH)
+
+SET(
+ VMIME_SENDMAIL_PATH
+ ${VMIME_DEFAULT_SENDMAIL_PATH}
+ CACHE
+ STRING
+ "Specifies the path to sendmail binary"
+)
+
+
+##############################################################################
+# Messaging features
+
+# Module
+OPTION(
+ VMIME_HAVE_MESSAGING_FEATURES
+ "Enable messaging features (connection to IMAP, POP3, SMTP...)"
+ ON
+)
+
+# Protocols
+OPTION(
+ VMIME_HAVE_MESSAGING_PROTO_POP3
+ "Enable POP3 protocol"
+ ON
+)
+
+OPTION(
+ VMIME_HAVE_MESSAGING_PROTO_SMTP
+ "Enable SMTP protocol"
+ ON
+)
+
+OPTION(
+ VMIME_HAVE_MESSAGING_PROTO_IMAP
+ "Enable IMAP protocol"
+ ON
+)
+
+OPTION(
+ VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+ "Enable Maildir protocol"
+ ON
+)
+
+OPTION(
+ VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+ "Enable Sendmail protocol"
+ ON
+)
+
+
+##############################################################################
+# File-system features
+
+OPTION(
+ VMIME_HAVE_FILESYSTEM_FEATURES
+ "Enable file-system features (required for file attachments and Maildir)"
+ ON
+)
+
+
+##############################################################################
+# SASL support
+
+INCLUDE(cmake/FindGSasl.cmake)
+
+OPTION(
+ VMIME_HAVE_SASL_SUPPORT
+ "Enable SASL support (requires GNU SASL library)"
+ ON
+)
+
+IF(VMIME_HAVE_SASL_SUPPORT)
+
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${GSASL_INCLUDE_DIR}
+ )
+
+ TARGET_LINK_LIBRARIES(
+ ${VMIME_LIBRARY_NAME}
+ ${TARGET_LINK_LIBRARIES}
+ ${GSASL_LIBRARIES}
+ )
+
+ SET(VMIME_PKGCONFIG_LIBS "${VMIME_PKGCONFIG_LIBS} ${GSASL_LIBRARIES}")
+ SET(VMIME_PKGCONFIG_CFLAGS "${VMIME_PKGCONFIG_CFLAGS} ${GSASL_INCLUDE_DIR}")
+ SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} libgsasl")
+
+ENDIF()
+
+
+##############################################################################
+# SSL/TLS support
+
+INCLUDE(FindGnuTLS)
+
+
+INCLUDE(CheckFunctionExists)
+SET(CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARY}")
+CHECK_FUNCTION_EXISTS(gnutls_priority_set_direct VMIME_HAVE_GNUTLS_PRIORITY_FUNCS)
+
+
+OPTION(
+ VMIME_HAVE_TLS_SUPPORT
+ "SSL/TLS support (requires GNU TLS library)"
+ ON
+)
+
+OPTION(
+ VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+ "Use GNU TLS library for SSL/TLS support"
+ ON
+)
+
+
+IF(VMIME_HAVE_TLS_SUPPORT)
+
+ IF(VMIME_TLS_SUPPORT_LIB_IS_GNUTLS)
+
+ INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${GNUTLS_INCLUDE_DIR}
+ )
+
+ LINK_DIRECTORIES(
+ ${LINK_DIRECTORIES}
+ ${GNUTLS_LIBRARY_DIRS}
+ )
+
+ TARGET_LINK_LIBRARIES(
+ ${VMIME_LIBRARY_NAME}
+ ${TARGET_LINK_LIBRARIES}
+ ${GNUTLS_LIBRARY}
+ )
+
+ SET(VMIME_PKGCONFIG_LIBS "${VMIME_PKGCONFIG_LIBS} ${GNUTLS_LIBRARY_DIRS} ${GNUTLS_LIBRARY}")
+ SET(VMIME_PKGCONFIG_CFLAGS "${VMIME_PKGCONFIG_CFLAGS} ${GNUTLS_INCLUDE_DIR}")
+ SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} libgnutls")
+
+ ELSE()
+
+ MESSAGE(FATAL_ERROR "TLS support is enabled, but no TLS/SSL library was selected/found")
+
+ ENDIF()
+
+ENDIF(VMIME_HAVE_TLS_SUPPORT)
+
+
+##############################################################################
+# iconv
+
+INCLUDE(cmake/FindIconv.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${INCLUDE_DIRECTORIES}
+ ${ICONV_INCLUDE_DIR}
+)
+
+TARGET_LINK_LIBRARIES(
+ ${VMIME_LIBRARY_NAME}
+ ${TARGET_LINK_LIBRARIES}
+ ${ICONV_LIBRARIES}
+)
+
+
+##############################################################################
+# Platform
+
+SET(VMIME_PLATFORM_IS_POSIX OFF)
+SET(VMIME_PLATFORM_IS_WINDOWS OFF)
+
+IF(WIN32)
+ SET(VMIME_PLATFORM_IS_WINDOWS ON)
+ELSE()
+ SET(VMIME_PLATFORM_IS_POSIX ON)
+ENDIF()
+
+
+##############################################################################
+# POSIX-specific checks
+
+INCLUDE(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS(getaddrinfo VMIME_HAVE_GETADDRINFO)
+
+FIND_PACKAGE(Threads)
+FIND_LIBRARY(PTHREAD pthread)
+
+IF(PTHREAD)
+ SET(VMIME_HAVE_PTHREAD 1)
+ELSE(PTHREAD)
+ SET(VMIME_HAVE_PTHREAD 0)
+ENDIF(PTHREAD)
+
+
+##############################################################################
+# Additional compiler flags
+
+IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+
+ SET(
+ CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} -D_REENTRANT=1 -W -Wall -pedantic -Warray-bounds-pointer-arithmetic -Wold-style-cast -Wconversion -Wcast-align -Wno-sign-conversion"
+ CACHE STRING
+ "g++ Compiler Flags"
+ FORCE
+ )
+
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+
+ #SET(CMAKE_EXE_LINKER_FLAGS "-s")
+
+ELSE()
+
+ IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+
+ SET(
+ CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} -D_REENTRANT=1 -W -Wall -ansi -pedantic -Wpointer-arith -Wold-style-cast -Wconversion -Wcast-align"
+ CACHE STRING
+ "g++ Compiler Flags"
+ FORCE
+ )
+
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+
+ #SET(CMAKE_EXE_LINKER_FLAGS "-s")
+
+ ENDIF()
+
+ENDIF()
+
+
+##############################################################################
+# Documentation
+
+FIND_PACKAGE(Doxygen)
+
+IF(DOXYGEN_FOUND)
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY)
+
+ # Make a target so that documentation can be generated by running "make doc"
+ ADD_CUSTOM_TARGET(
+ doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen" VERBATIM
+ )
+ENDIF(DOXYGEN_FOUND)
+
+
+##############################################################################
+# Sanity checks
+
+# Maildir protocol is available only if file-system features are enabled
+IF(VMIME_HAVE_MESSAGING_FEATURES AND VMIME_HAVE_MESSAGING_PROTO_MAILDIR AND NOT VMIME_HAVE_FILESYSTEM_FEATURES)
+ MESSAGE(FATAL_ERROR "Maildir protocol requires file-system support (VMIME_HAVE_FILESYSTEM_FEATURES must be set to ON).")
+ENDIF()
+
+# Path to 'sendmail' must be specified if Sendmail protocol is enabled
+IF(VMIME_HAVE_MESSAGING_PROTO_SENDMAIL)
+ IF(NOT VMIME_SENDMAIL_PATH OR VMIME_SENDMAIL_PATH STREQUAL "")
+ MESSAGE(FATAL_ERROR "Enabling Sendmail protocol requires that you specify path to 'sendmail' binary.")
+ ENDIF()
+ENDIF()
+
+
+# Set our configure file
+CONFIGURE_FILE(cmake/config.hpp.cmake vmime/config.hpp)
+
+INCLUDE(CPack)
+
diff --git a/vmime.doxygen b/Doxyfile.in
index 50960e13..4b9d5e49 100644
--- a/vmime.doxygen
+++ b/Doxyfile.in
@@ -29,7 +29,7 @@ PROJECT_NUMBER =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = ./doc/
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc/
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
@@ -344,7 +344,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ./src/ ./vmime/
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/ @CMAKE_CURRENT_SOURCE_DIR@/vmime/
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
diff --git a/README.autotools b/README.autotools
index 4b83a222..a67c1c8d 100644
--- a/README.autotools
+++ b/README.autotools
@@ -1,8 +1,13 @@
Where are the ./configure script and the Makefile's?
Configure and Make scripts are not included in the git source tree. They are
-automatically generated by the SConstruct script.
+automatically generated by the CMake script.
-Just type "scons autotools" to generate everything needed for the traditional
-./configure, make, make install build process.
+Just use the following instruction to generate everything needed for the
+traditional "make" and "make install" build process.
+
+ cmake -G "Unix Makefiles"
+
+Please note that "configure" script is not needed anymore, as platform
+checks are now done by CMake.
diff --git a/SConstruct b/SConstruct
index 1f3c7c98..0415ed79 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,6 +1,8 @@
#
-# SConstruct
-# libvmime build script
+# SConstruct file for VMime
+#
+# Deprecated: use only for development purpose.
+# Use CMake for distribution/packaging.
#
# Process this file with 'scons' to build the project.
# For more information, please visit: http://www.scons.org/ .
@@ -10,8 +12,6 @@
# . scons build the library
# . scons -h see available configuration options
# . scons opt=value set a configuration option
-# . scons install install library and include files (as root)
-# . scons dist build a source package (.tar.bz2)
# . scons doc build documentation for the project (Doxygen)
#
@@ -26,43 +26,16 @@ import string
# Version #
#############
-# Package version number
-packageVersionMajor = 0
-packageVersionMinor = 9
-packageVersionMicro = 2
-
-# API version number (libtool)
-#
-# Increment this number only immediately before a public release.
-# This is independent from package version number.
-#
-# See: http://www.gnu.org/software/libtool/manual.html#Libtool-versioning
-#
-# . Implementation changed (eg. bug/security fix): REVISION++
-# . Interfaces added/removed/changed: CURRENT++, REVISION=0
-# . Interfaces added (upward-compatible changes): AGE++
-# . Interfaces removed: AGE=0
-#
-packageAPICurrent = 0
-packageAPIRevision = 0
-packageAPIAge = 0
-
# Package information
packageName = 'libvmime'
packageGenericName = 'vmime'
packageRealName = 'VMime Library'
packageDescription = 'VMime C++ Mail Library (http://www.vmime.org)'
-packageMaintainer = '[email protected]'
+packageMaintainer = '[email protected]'
-packageVersion = '%d.%d.%d' % (packageVersionMajor, packageVersionMinor, packageVersionMicro)
-packageAPI = '%d:%d:%d' % (packageAPICurrent, packageAPIRevision, packageAPIAge)
+packageVersion = '0.0.0'
+packageAPI = '0:0:0'
-#if packageVersionMajor >= 2:
-# packageVersionedGenericName = packageGenericName + ('%d' % packageVersionMajor)
-# packageVersionedName = packageName + ('%d' % packageVersionMajor)
-#else:
-# packageVersionedGenericName = packageGenericName
-# packageVersionedName = packageName
packageVersionedGenericName = packageGenericName
packageVersionedName = packageName
@@ -489,7 +462,7 @@ opts.AddVariables(
EnumVariable(
'debug',
'Debug version (useful for developers only)',
- 'no',
+ 'yes',
allowed_values = ('yes', 'no'),
map = { },
ignorecase = 1
@@ -832,7 +805,8 @@ else:
config_hpp.write('// -- TLS/SSL support\n')
if env['with_tls'] == 'yes':
config_hpp.write('#define VMIME_HAVE_TLS_SUPPORT 1\n')
- config_hpp.write('#define HAVE_GNUTLS_PRIORITY_FUNCS 1\n')
+ config_hpp.write('#define VMIME_TLS_SUPPORT_LIB_IS_GNUTLS 1\n')
+ config_hpp.write('#define VMIME_HAVE_GNUTLS_PRIORITY_FUNCS 1\n')
else:
config_hpp.write('#define VMIME_HAVE_TLS_SUPPORT 0\n')
@@ -840,30 +814,28 @@ config_hpp.write('// -- Messaging support\n')
if env['with_messaging'] == 'yes':
config_hpp.write('#define VMIME_HAVE_MESSAGING_FEATURES 1\n')
- config_hpp.write('// -- Built-in messaging protocols\n')
- config_hpp.write('#define VMIME_BUILTIN_MESSAGING_PROTOS "' +
- string.replace(env['with_messaging_protocols'], '"', '') + '"\n')
+ config_hpp.write('// -- Messaging protocols\n')
for proto in messaging_protocols:
- config_hpp.write('#define VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(proto) + ' 1\n')
+ config_hpp.write('#define VMIME_HAVE_MESSAGING_PROTO_' + string.upper(proto) + ' 1\n')
for p in libvmime_messaging_proto_sources:
proto = p[0]
if not proto in messaging_protocols:
- config_hpp.write('#define VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(proto) + ' 0\n')
+ config_hpp.write('#define VMIME_HAVE_MESSAGING_PROTO_' + string.upper(proto) + ' 0\n')
else:
config_hpp.write('#define VMIME_HAVE_MESSAGING_FEATURES 0\n')
-config_hpp.write('// -- Built-in platform handlers\n')
-config_hpp.write('#define VMIME_BUILTIN_PLATFORMS "' +
- string.replace(env['with_platforms'], '"', '') + '"\n')
-
+config_hpp.write('// -- Platform-specific code\n')
for platform in platforms:
- config_hpp.write('#define VMIME_BUILTIN_PLATFORM_' + string.upper(platform) + ' 1\n')
+ config_hpp.write('#define VMIME_PLATFORM_IS_' + string.upper(platform) + ' 1\n')
for platform in libvmime_platforms_sources:
if not platform in platforms:
- config_hpp.write('#define VMIME_BUILTIN_PLATFORM_' + string.upper(platform) + ' 0\n')
+ config_hpp.write('#define VMIME_PLATFORM_IS_' + string.upper(platform) + ' 0\n')
+
+config_hpp.write('#define VMIME_HAVE_GETADDRINFO 1\n')
+config_hpp.write('#define VMIME_HAVE_PTHREAD 1\n')
config_hpp.write('\n')
config_hpp.write('// Miscellaneous flags\n')
@@ -873,11 +845,6 @@ if IsProtocolSupported(messaging_protocols, 'sendmail'):
config_hpp.write("""
-// Additional defines
-#define VMIME_HAVE_GETADDRINFO 1
-#define VMIME_HAVE_PTHREAD 1
-
-
#endif // VMIME_CONFIG_HPP_INCLUDED
""")
@@ -994,1413 +961,6 @@ if env['build_tests'] == 'yes':
Exit(1)
-########################
-# Installation rules #
-########################
-
-libDir = "%s/lib" % env['prefix']
-#includeDir = "%s/include/%s/vmime" % (env['prefix'], packageVersionedGenericName)
-includeDir = "%s/include/vmime" % env['prefix']
-
-installPaths = [libDir, includeDir]
-
-# Library
-env.Install(libDir, libVmime)
-
-# Header files
-for i in range(len(libvmime_install_includes)):
- env.Install(includeDir + '/' + libvmime_install_includes[i][0], libvmime_install_includes[i][1])
-
-# Configuration header file
-env.Install(includeDir, 'vmime/config.hpp')
-
-# Pkg-config support
-vmime_pc = open(packageVersionedGenericName + ".pc", 'w')
-
-vmime_pc_requires = ''
-vmime_pc_libs = ''
-
-if env['with_sasl'] == 'yes':
- vmime_pc_requires = vmime_pc_requires + "libgsasl "
- vmime_pc_libs = vmime_pc_libs + "-lgsasl "
-
-vmime_pc.write("prefix=" + env['prefix'] + "\n")
-vmime_pc.write("exec_prefix=" + env['prefix'] + "\n")
-vmime_pc.write("libdir=" + env['prefix'] + "/lib\n")
-vmime_pc.write("includedir=" + env['prefix'] + "/include\n")
-vmime_pc.write("\n")
-vmime_pc.write("Name: " + packageRealName + "\n")
-vmime_pc.write("Description: " + packageDescription + "\n")
-vmime_pc.write("Version: " + packageVersion + "\n")
-vmime_pc.write("Requires: " + vmime_pc_requires + "\n")
-vmime_pc.write("Libs: -L${libdir} -l" + packageVersionedGenericName + " " + vmime_pc_libs + "\n")
-#vmime_pc.write("Cflags: -I${includedir}/" + packageVersionedGenericName + "\n")
-vmime_pc.write("Cflags: -I${includedir}/" + "\n")
-
-vmime_pc.close()
-
-env.Install(libDir + "/pkgconfig", packageVersionedGenericName + ".pc")
-
-# Provide "install" target (ie. 'scons install')
-env.Alias('install', installPaths)
-
-
-################################
-# Generate autotools scripts #
-################################
-
-# Return the path of the specified filename.
-# Example: getPath("a/b/c/myfile") will return "a/b/c"
-def getPath(s):
- x = s.rfind('/')
- if x != -1:
- return s[0:x]
- else:
- return ""
-
-def getParentPath(s):
- return getPath(s)
-
-def getLastDir(s):
- x = s.rfind('/')
- if x != -1:
- return s[x + 1:len(s)]
- else:
- return s
-
-def buildMakefileFileList(l, replaceSlash):
- s = ''
-
- for i in range(len(l)):
- if i != 0:
- s += ' \\\n\t'
- f = l[i]
- if replaceSlash:
- f = string.replace(f, "/", "_")
- s += f
-
- return s
-
-def selectFilesFromSuffixNot(l, ext):
- r = []
- n = len(ext)
-
- for f in l:
- if f[-n:] != ext:
- r.append(f)
-
- return r
-
-def generateAutotools(target, source, env):
- # Generate pkg-config file for shared and static library
- vmime_pc_in = open(packageVersionedGenericName + ".pc.in", 'w')
- vmime_pc_in.write("# File automatically generated by SConstruct ('scons autotools')\n")
- vmime_pc_in.write("# DO NOT EDIT!\n")
- vmime_pc_in.write("\n")
- vmime_pc_in.write("prefix=@prefix@\n")
- vmime_pc_in.write("exec_prefix=@exec_prefix@\n")
- vmime_pc_in.write("libdir=@libdir@\n")
- vmime_pc_in.write("includedir=@includedir@\n")
- vmime_pc_in.write("\n")
- vmime_pc_in.write("Name: @GENERIC_LIBRARY_NAME@\n")
- vmime_pc_in.write("Description: " + packageDescription + "\n")
- vmime_pc_in.write("Version: @VERSION@\n")
- vmime_pc_in.write("Requires: @GSASL_REQUIRED@\n")
- vmime_pc_in.write("Libs: -L${libdir} -l@GENERIC_VERSIONED_LIBRARY_NAME@ @GSASL_LIBS@ @LIBGNUTLS_LIBS@ @LIBICONV@ @PTHREAD_LIBS@ @LIBICONV@ @PTHREAD_LIBS@ @VMIME_ADDITIONAL_PC_LIBS@\n")
- #vmime_pc_in.write("Cflags: -I${includedir}/@GENERIC_VERSIONED_LIBRARY_NAME@\n")
- vmime_pc_in.write("Cflags: -I${includedir}/ @LIBGNUTLS_CFLAGS@\n")
- vmime_pc_in.close()
-
- # Generate 'Makefile.am'
- Makefile_am = open("Makefile.am", 'w')
- Makefile_am.write("""
-# File automatically generated by SConstruct ('scons autotools')
-# DO NOT EDIT!
-
-BINDING =
-INCLUDE = vmime
-#examples tests
-
-SUBDIRS = src $(INCLUDE) $(BINDING)
-
-DIST_SUBDIRS = $(SUBDIRS) autotools
-
-#AUTOMAKE_OPTIONS = dist-bzip2
-AUTOMAKE_OPTIONS = no-dist
-
-pkgconfigdir = $(VMIME_PKGCONFIGDIR)
-pkgconfig_DATA = $(GENERIC_VERSIONED_LIBRARY_NAME).pc
-
-EXTRA_DIST=SConstruct bootstrap
-
-dist:
- @ echo ""
- @ echo "Please use 'scons dist' to generate distribution tarball."
- @ echo ""
-
-doc_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README
-docdir = $(datadir)/doc/$(GENERIC_LIBRARY_NAME)
-""")
- Makefile_am.close()
-
- # Generate Makefile for header files
- Makefile_am = open("vmime/Makefile.am", 'w')
- Makefile_am.write("""
-# File automatically generated by SConstruct ('scons autotools')
-# DO NOT EDIT!
-""")
-
- #Makefile_am.write(packageVersionedName + "includedir = $(prefix)/include/@GENERIC_VERSIONED_LIBRARY_NAME@/@GENERIC_LIBRARY_NAME@\n")
- Makefile_am.write(packageVersionedName + "includedir = $(prefix)/include/@GENERIC_LIBRARY_NAME@\n")
- Makefile_am.write("nobase_" + packageVersionedName + "include_HEADERS = ")
-
- x = []
-
- for file in libvmime_all_sources:
- if file[-4:] == '.hpp':
- x.append(file[len("vmime/"):]) # remove 'vmime/' prefix
-
- x.append("config.hpp")
-
- Makefile_am.write(buildMakefileFileList(x, 0))
- Makefile_am.close()
-
- # Generate 'src/Makefile.am' (Makefile for source files)
- Makefile_am = open("src/Makefile.am", 'w')
- Makefile_am.write("""
-# File automatically generated by SConstruct ('scons autotools')
-# DO NOT EDIT!
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-INTERNALS =
-INCLUDES = -I$(prefix)/include -I$(top_srcdir) @PKGCONFIG_CFLAGS@ @EXTRA_CFLAGS@
-""")
-
- Makefile_am.write('lib_LTLIBRARIES = ' + packageVersionedName + '.la\n')
- Makefile_am.write(packageVersionedName + '_la_LDFLAGS = -export-dynamic -version-info '
-# + '@LIBRARY_VERSION@ -release @LIBRARY_RELEASE@ @PKGCONFIG_LIBS@ @EXTRA_LIBS@\n')
- + '@LIBRARY_VERSION@ @PKGCONFIG_LIBS@ @EXTRA_LIBS@\n')
-
- sourceFiles = [] # for conversion: subpath/file.cpp --> subpath_file.cpp
- # used to avoid collision when two files have the same name if different dirs
-
- # -- base library
- x = selectFilesFromSuffixNot(libvmime_sources, '.hpp')
- sourceFiles += x
-
- Makefile_am.write(packageVersionedName + "_la_SOURCES = " + buildMakefileFileList(x, 1) + "\n")
-
- # -- messaging module
- x = selectFilesFromSuffixNot(libvmime_messaging_sources, '.hpp')
- sourceFiles += x
-
- Makefile_am.write("\n")
- Makefile_am.write("if VMIME_HAVE_MESSAGING_FEATURES\n")
- Makefile_am.write(packageVersionedName + "_la_SOURCES += " + buildMakefileFileList(x, 1) + "\n")
- Makefile_am.write("endif\n")
-
- # -- messaging protocols
- for proto in libvmime_messaging_proto_sources:
- Makefile_am.write("\n")
- Makefile_am.write("if VMIME_BUILTIN_MESSAGING_PROTO_" + string.upper(proto[0]) + "\n")
-
- x = selectFilesFromSuffixNot(proto[1], '.hpp')
- sourceFiles += x
-
- Makefile_am.write(packageVersionedName + "_la_SOURCES += " + buildMakefileFileList(x, 1) + "\n")
- Makefile_am.write("endif\n")
-
- # -- SASL support
- x = selectFilesFromSuffixNot(libvmime_security_sasl_sources, '.hpp')
- sourceFiles += x
-
- Makefile_am.write("\n")
- Makefile_am.write("if VMIME_HAVE_SASL_SUPPORT\n")
- Makefile_am.write(packageVersionedName + "_la_SOURCES += " + buildMakefileFileList(x, 1) + "\n")
- Makefile_am.write("endif\n")
-
- # -- TLS support
- x = selectFilesFromSuffixNot(libvmime_net_tls_sources, '.hpp')
- sourceFiles += x
-
- Makefile_am.write("\n")
- Makefile_am.write("if VMIME_HAVE_TLS_SUPPORT\n")
- Makefile_am.write(packageVersionedName + "_la_SOURCES += " + buildMakefileFileList(x, 1) + "\n")
- Makefile_am.write("endif\n")
-
- # -- platform handlers
- for platform in libvmime_platforms_sources:
- Makefile_am.write("\n")
- Makefile_am.write("if VMIME_BUILTIN_PLATFORM_" + string.upper(platform) + "\n")
-
- x = selectFilesFromSuffixNot(libvmime_platforms_sources[platform], '.hpp')
- sourceFiles += x
-
- Makefile_am.write(packageVersionedName + "_la_SOURCES += " + buildMakefileFileList(x, 1) + "\n")
- Makefile_am.write("endif\n")
-
- Makefile_am.write("""
-
-noinst_HEADERS = $(INTERNALS)
-
-""")
-
- for f in sourceFiles: # symbolic links to avoid filename collision
- a = f
- b = string.replace(f, "/", "_")
- if a != b:
- Makefile_am.write(b + ": " + a + "\n\tln -sf $< $@\n\n")
-
- Makefile_am.close()
-
- # Generate 'configure.in'
- configure_in = open("configure.in", 'w')
- configure_in.write("""
-# configure.in
-
-# File automatically generated by SConstruct ('scons autotools')
-# DO NOT EDIT!
-
-# Init
-""")
-
- configure_in.write("AC_INIT([" + packageRealName
- + "], [" + packageVersion + "], [" + packageMaintainer
- + "], [" + packageGenericName + "])")
- configure_in.write("""
-
-AC_PREREQ([2.53])
-
-AC_CONFIG_AUX_DIR(autotools)
-
-# Library name
-GENERIC_LIBRARY_NAME=""" + '"' + packageGenericName + '"' + """
-AC_SUBST(GENERIC_LIBRARY_NAME)
-
-GENERIC_VERSIONED_LIBRARY_NAME=""" + '"' + packageVersionedGenericName + '"' + """
-AC_SUBST(GENERIC_VERSIONED_LIBRARY_NAME)
-
-LIBRARY_NAME=""" + '"' + packageName + '"' + """
-AC_SUBST(LIBRARY_NAME)
-
-""")
-
- configure_in.write('# Library version\n')
- configure_in.write('LIBRARY_VERSION="' + str(packageAPICurrent)
- + ':' + str(packageAPIRevision) + ':' + str(packageAPIAge) + '"\n')
- configure_in.write('AC_SUBST(LIBRARY_VERSION)\n')
- configure_in.write('\n')
- configure_in.write('LIBRARY_RELEASE="' + str(packageVersionMajor) + '"\n')
- configure_in.write('AC_SUBST(LIBRARY_RELEASE)\n')
-
- configure_in.write("""
-
-#
-# Miscellaneous init stuff
-#
-
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-
-AM_INIT_AUTOMAKE(""" + packageGenericName + """, """ + packageVersion + """)
-AC_CONFIG_SRCDIR([src/base.cpp])
-AM_CONFIG_HEADER([config.h])
-
-AM_MAINTAINER_MODE
-
-VMIME_ADDITIONAL_DEFINES=""
-VMIME_ADDITIONAL_PC_LIBS=""
-
-
-#
-# Check compilers, processors, etc
-#
-
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_CPP
-AC_C_CONST
-AC_C_INLINE
-AC_HEADER_STDC
-AC_HEADER_STDBOOL
-AC_HEADER_DIRENT
-AC_HEADER_TIME
-AC_C_CONST
-
-AC_LANG(C++)
-
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_PROG_LN_S
-AC_PROG_LIBTOOL
-
-OST_LIB_PTHREAD # from GNU Commons C++
-
-AM_SANITY_CHECK
-AM_PROG_LIBTOOL
-AM_PROG_CC_C_O
-
-AM_ICONV
-
-
-#
-# Some checks
-#
-
-# -- iconv
-AC_MSG_CHECKING([if an usable version of iconv exists (required)])
-
-if test "x$am_cv_func_iconv" = "xyes"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_ERROR(no usable version of iconv has been found)
-fi
-
-# -- global constructors (stolen from 'configure.in' in libsigc++)
-AC_MSG_CHECKING([if linker supports global constructors])
-cat > mylib.$ac_ext <<EOF
-#include <stdio.h>
-
-struct A
-{
- A() { printf(\"PASS\\n\"); }
-};
-
-A a;
-
-int foo()
- { return 1; }
-
-EOF
-cat > mytest.$ac_ext <<EOF
-#include <stdio.h>
-
-extern int foo();
-
-int main(int, char**)
-{
- int i = foo();
- if(i != 1) printf(\"FAIL\\n\");
- return 0;
-}
-
-EOF
-sh libtool --mode=compile $CXX -c mylib.$ac_ext >&5
-sh libtool --mode=link $CXX -o libtest.la -rpath / -version-info 0 mylib.lo >&5
-$CXX -c $CFLAGS $CPPFLAGS mytest.$ac_ext >&5
-sh libtool --mode=link $CXX -o mytest mytest.o libtest.la >&5 2>/dev/null
-
-if test -x mytest -a "$cross_compiling" != yes; then
- myresult=`./mytest`
- if test "X$myresult" = "XPASS"; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- AC_ERROR([
-===================================================================
-ERROR: This platform lacks support of construction of global
-objects in shared libraries.
-
-See ftp://rtfm.mit.edu/pub/usenet/news.answers/g++-FAQ/plain
-for details about this problem. Also for possible solutions
-http://www.informatik.uni-frankfurt.de/~fp/Tcl/tcl-c++/tcl-c++.html
-===================================================================])
- fi
-else
- AC_MSG_RESULT(unknown)
-fi
-rm -f mylib.* mytest.* libtest.la .libs/libtest* mytest .libs/mytest .libs/lt-mytest .libs/mylib.* >&5
-rmdir .libs >&5
-
-# -- const_cast
-AC_MSG_CHECKING([if C++ compiler supports const_cast<> (required)])
-AC_TRY_COMPILE(
-[
- class foo;
-],[
- const foo *c=0;
- foo *c1=const_cast<foo*>(c);
-],[
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
- AC_ERROR(C++ compiler const_cast<> does not work)
-])
-
-# -- dynamic_cast
-AC_MSG_CHECKING([if C++ compiler supports dynamic_cast<> (required)])
-AC_TRY_COMPILE(
-[
- class foo { public: virtual ~foo() { } };
- class bar : public foo { public: virtual ~bar() { } };
-],[
- foo *c=0;
- bar *c1=dynamic_cast<bar*>(c);
-],[
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
- AC_ERROR(C++ compiler dynamic_cast<> does not work)
-])
-
-# -- mutable
-AC_MSG_CHECKING(if C++ compiler supports mutable (required))
-AC_TRY_COMPILE(
-[
-class k {
- mutable char *c;
-public:
- void foo() const { c=0; }
-};
-],[
-],[
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
- AC_ERROR(C++ compiler does not support 'mutable')
-])
-
-# -- namespace
-AC_MSG_CHECKING(if C++ compiler supports name spaces (required))
-AC_TRY_COMPILE(
-[
-namespace Check
- {
- int i;
- }
-],[
- Check::i=1;
-],[
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
- AC_ERROR(C++ compiler does not support 'namespace')
-])
-
-
-#
-# Target OS and architecture
-#
-
-VMIME_TARGET_ARCH=${target_cpu}
-VMIME_TARGET_OS=${target_os}
-
-#
-# Byte Order
-#
-
-AC_C_BIGENDIAN
-
-if test "x$ac_cv_c_bigendian" = "xyes"; then
- VMIME_BYTE_ORDER_BIG_ENDIAN=1
- VMIME_BYTE_ORDER_LITTLE_ENDIAN=0
-else
- VMIME_BYTE_ORDER_BIG_ENDIAN=0
- VMIME_BYTE_ORDER_LITTLE_ENDIAN=1
-fi
-
-
-#
-# Generic Type Size
-#
-
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-
-case 1 in
-$ac_cv_sizeof_char)
- VMIME_TYPE_INT8=char
- ;;
-*)
- AC_MSG_ERROR([no 8-bit type available])
-esac
-
-case 2 in
-$ac_cv_sizeof_short)
- VMIME_TYPE_INT16=short
- ;;
-$ac_cv_sizeof_int)
- VMIME_TYPE_INT16=int
- ;;
-*)
- AC_MSG_ERROR([no 16-bit type available])
-esac
-
-case 4 in
-$ac_cv_sizeof_int)
- VMIME_TYPE_INT32=int
- ;;
-$ac_cv_sizeof_long)
- VMIME_TYPE_INT32=long
- ;;
-*)
- AC_MSG_ERROR([no 32-bit type available])
-esac
-
-
-#
-# Options
-#
-
-# ** debug
-
-AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug], [Turn on debugging, default: disabled]),
- [case "${enableval}" in
- yes) conf_debug=yes ;;
- no) conf_debug=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
- esac],
- [conf_debug=no])
-
-if test "x$conf_debug" = "xyes"; then
- AM_CONDITIONAL(VMIME_DEBUG, true)
- VMIME_DEBUG=1
-else
- AM_CONDITIONAL(VMIME_DEBUG, false)
- VMIME_DEBUG=0
-fi
-
-# ** messaging
-
-AC_ARG_ENABLE(messaging,
- AC_HELP_STRING([--enable-messaging], [Enable messaging support and connection to mail servers, default: enabled]),
- [case "${enableval}" in
- yes) conf_messaging=yes ;;
- no) conf_messaging=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-messaging) ;;
- esac],
- [conf_messaging=yes])
-
-if test "x$conf_messaging" = "xyes"; then
- AM_CONDITIONAL(VMIME_HAVE_MESSAGING_FEATURES, true)
- VMIME_HAVE_MESSAGING_FEATURES=1
-else
- AM_CONDITIONAL(VMIME_HAVE_MESSAGING_FEATURES, false)
- VMIME_HAVE_MESSAGING_FEATURES=0
-fi
-
-# ** SASL
-
-AC_ARG_ENABLE(sasl,
- AC_HELP_STRING([--enable-sasl], [Enable SASL support with GNU SASL, default: enabled]),
- [case "${enableval}" in
- yes) conf_sasl=yes ;;
- no) conf_sasl=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-sasl) ;;
- esac],
- [conf_sasl=yes])
-
-if test "x$conf_sasl" = "xyes"; then
- # -- GNU SASL Library (http://www.gnu.org/software/gsasl/)
- AC_CHECK_HEADER(gsasl.h,
- AC_CHECK_LIB(gsasl, gsasl_check_version,
- [have_gsasl=yes AC_SUBST(GSASL_AVAIL_LIBS, -lgsasl) AC_SUBST(GSASL_AVAIL_REQUIRED, libgsasl)],
- have_gsasl=no),
- have_gsasl=no)
-
- if test "x$have_gsasl" = "xyes"; then
- AM_CONDITIONAL(VMIME_HAVE_SASL_SUPPORT, true)
- VMIME_HAVE_SASL_SUPPORT=1
-
- GSASL_REQUIRED=${GSASL_AVAIL_REQUIRED}
- GSASL_LIBS=${GSASL_AVAIL_LIBS}
- else
- AC_MSG_ERROR(can't find an usable version of GNU SASL library)
- fi
-else
- AM_CONDITIONAL(VMIME_HAVE_SASL_SUPPORT, false)
- VMIME_HAVE_SASL_SUPPORT=0
-
- GSASL_REQUIRED=
- GSASL_LIBS=
-fi
-
-AC_SUBST(GSASL_REQUIRED)
-AC_SUBST(GSASL_LIBS)
-
-# ** TLS
-
-AC_ARG_ENABLE(tls,
- AC_HELP_STRING([--enable-tls], [Enable TLS/SSL support with GNU TLS, default: enabled]),
- [case "${enableval}" in
- yes) conf_tls=yes ;;
- no) conf_tls=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-tls) ;;
- esac],
- [conf_tls=yes])
-
-if test "x$conf_tls" = "xyes"; then
- # -- GNU TLS Library (http://www.gnu.org/software/gnutls/)
- PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0], have_gnutls=yes, have_gnutls=no)
-
- if test "x$have_gnutls" = "xyes"; then
- AM_CONDITIONAL(VMIME_HAVE_TLS_SUPPORT, true)
- VMIME_HAVE_TLS_SUPPORT=1
- else
- AC_MSG_ERROR(can't find an usable version of GNU TLS library)
- fi
-
- # -- check for gnutls_priority_set_direct() function
- if test "x$have_gnutls" = "xyes"; then
- AC_MSG_CHECKING(for gnutls_priority_set_direct)
-
- LIBS_save="$LIBS"
- LIBS="$LIBS $LIBGNUTLS_LIBS"
- CPPFLAGS_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
-
- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnutls/gnutls.h>],
- [gnutls_session s; gnutls_priority_set_direct(s, NULL, NULL);])],
- [have_gnutls_priority_funcs=yes],
- [have_gnutls_priority_funcs=no])
-
- CPPFLAGS="$CPPFLAGS_save"
- LIBS="$LIBS_save"
-
- AC_MSG_RESULT([$have_gnutls_priority_funcs])
-
- if test "x$have_gnutls_priority_funcs" = "xyes"; then
- AM_CONDITIONAL(HAVE_GNUTLS_PRIORITY_FUNCS, true)
- HAVE_GNUTLS_PRIORITY_FUNCS=1
- else
- AM_CONDITIONAL(HAVE_GNUTLS_PRIORITY_FUNCS, false)
- HAVE_GNUTLS_PRIORITY_FUNCS=0
- fi
- else
- AM_CONDITIONAL(HAVE_GNUTLS_PRIORITY_FUNCS, false)
- HAVE_GNUTLS_PRIORITY_FUNCS=0
- fi
-else
- AM_CONDITIONAL(VMIME_HAVE_TLS_SUPPORT, false)
- VMIME_HAVE_TLS_SUPPORT=0
-
- AM_CONDITIONAL(HAVE_GNUTLS_PRIORITY_FUNCS, false)
- HAVE_GNUTLS_PRIORITY_FUNCS=0
-fi
-
-AC_SUBST(LIBGNUTLS_CFLAGS)
-AC_SUBST(LIBGNUTLS_LIBS)
-
-# ** platform handlers
-
-VMIME_BUILTIN_PLATFORMS=''
-VMIME_DETECT_PLATFORM=''
-
-case "x${target_os}" in
-xwin* | xmingw* | xcygwin*)
- VMIME_DETECT_PLATFORM='windows'
- ;;
-x*)
- # Default is POSIX
- VMIME_DETECT_PLATFORM='posix'
- ;;
-esac
-
-# ** messaging protocols
-
-VMIME_BUILTIN_MESSAGING_PROTOS=''
-
-""")
-
- for proto in libvmime_messaging_proto_sources:
- p = proto[0]
-
- configure_in.write("AC_ARG_ENABLE(messaging-proto-" + p + ",\n")
- configure_in.write(" AC_HELP_STRING([--enable-messaging-proto-" + p
- + "], [Enable built-in support for protocol '" + p + "'"
- + ", default: enabled]),\n")
- configure_in.write(' [case "${enableval}" in\n')
- configure_in.write(' yes) conf_messaging_proto_' + p + '=yes ;;\n')
- configure_in.write(' no) conf_messaging_proto_' + p + '=no ;;\n')
- configure_in.write(' *) AC_MSG_ERROR(bad value ${enableval} for '
- + '--enable-messaging-proto-' + p + ') ;;\n')
- configure_in.write(' esac],\n')
- configure_in.write(' [conf_messaging_proto_' + p + '=yes])\n')
-
- configure_in.write('if test "x$conf_messaging_proto_' + p + '" = "xyes"; then\n')
-
- if p == 'sendmail': # sendmail only on POSIX platforms
- configure_in.write('if test "x$VMIME_DETECT_PLATFORM" = "xposix"; then\n')
-
- configure_in.write(' AM_CONDITIONAL(VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + ', true)\n')
- configure_in.write(' VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + '=1\n')
- configure_in.write(' VMIME_BUILTIN_MESSAGING_PROTOS="$VMIME_BUILTIN_MESSAGING_PROTOS ' + p + '"\n')
-
- if p == 'sendmail': # sendmail only on POSIX platforms
- configure_in.write('else\n');
- configure_in.write(' AC_MSG_WARN(' + p +' is only available on POSIX platforms)\n');
- configure_in.write(' AM_CONDITIONAL(VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + ', false)\n')
- configure_in.write(' VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + '=0\n')
- configure_in.write('fi\n');
-
- configure_in.write('else\n')
- configure_in.write(' AM_CONDITIONAL(VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + ', false)\n')
- configure_in.write(' VMIME_BUILTIN_MESSAGING_PROTO_' + string.upper(p) + '=0\n')
- configure_in.write('fi\n\n')
-
- configure_in.write("""
-
-
-#
-# System mail
-#
-
-AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
-
-
-#
-# Detect some platform-specific stuff
-#
-
-# -- MLang (Windows)
-if test "x$VMIME_DETECT_PLATFORM" = "xwindows"; then
- AC_CHECK_HEADER(mlang.h, [VMIME_ADDITIONAL_DEFINES="$VMIME_ADDITIONAL_DEFINES HAVE_MLANG_H"])
-fi
-
-# -- Link with Winsock (Windows)
-if test "x$VMIME_DETECT_PLATFORM" = "xwindows"; then
- VMIME_ADDITIONAL_PC_LIBS="$VMIME_ADDITIONAL_PC_LIBS -lws2_32"
-fi
-
-# -- getaddrinfo (POSIX)
-if test "x$VMIME_DETECT_PLATFORM" = "xposix"; then
- AC_CHECK_HEADERS(netdb.h sys/types.h sys/socket.h,)
- AC_CHECK_FUNC(getaddrinfo, [VMIME_ADDITIONAL_DEFINES="$VMIME_ADDITIONAL_DEFINES HAVE_GETADDRINFO"])
-fi
-
-# -- pthreads (POSIX)
-
-ACX_PTHREAD([VMIME_ADDITIONAL_DEFINES="$VMIME_ADDITIONAL_DEFINES HAVE_PTHREAD"])
-
-
-""")
-
-
- for p in libvmime_platforms_sources:
- configure_in.write('if test "x$VMIME_DETECT_PLATFORM" = "x' + p + '"; then\n')
- configure_in.write(' conf_platform_' + p + '=yes\n')
- configure_in.write('else\n')
- configure_in.write(' conf_platform_' + p + '=no\n')
- configure_in.write('fi\n\n')
-
- configure_in.write("AC_ARG_ENABLE(platform-" + p + ",\n")
- configure_in.write(" AC_HELP_STRING([--enable-platform-" + p
- + "], [Compile built-in platform handler for '" + p + "' "
- + ", default: disabled, except if default for your platform]),\n")
- configure_in.write(' [case "${enableval}" in\n')
- configure_in.write(' yes) conf_platform_' + p + '=yes ;;\n')
- configure_in.write(' no) conf_platform_' + p + '=no ;;\n')
- configure_in.write(' *) AC_MSG_ERROR(bad value ${enableval} for '
- + '--enable-platform-' + p + ') ;;\n')
- configure_in.write(' esac],\n')
- #configure_in.write(' [conf_platform_' + p + '=yes])\n')
- configure_in.write(' [])\n')
-
- configure_in.write('if test "x$conf_platform_' + p + '" = "xyes"; then\n')
- configure_in.write(' AM_CONDITIONAL(VMIME_BUILTIN_PLATFORM_' + string.upper(p) + ', true)\n')
- configure_in.write(' VMIME_BUILTIN_PLATFORM_' + string.upper(p) + '=1\n')
- configure_in.write(' VMIME_BUILTIN_PLATFORMS="$VMIME_BUILTIN_PLATFORMS ' + p + '"\n')
- configure_in.write('else\n')
- configure_in.write(' AM_CONDITIONAL(VMIME_BUILTIN_PLATFORM_' + string.upper(p) + ', false)\n')
- configure_in.write(' VMIME_BUILTIN_PLATFORM_' + string.upper(p) + '=0\n')
- configure_in.write('fi\n\n')
-
- configure_in.write("""
-
-#
-# Workarounds for some platforms
-#
-
-# -- pkgconfigdir
-case "x${target_os}" in
-xfreebsd*)
-
- VMIME_PKGCONFIGDIR='$(prefix)/libdata/pkgconfig'
- ;;
-
-x*)
-
- VMIME_PKGCONFIGDIR='$(libdir)/pkgconfig'
- ;;
-esac
-
-AC_SUBST(VMIME_PKGCONFIGDIR)
-
-# -- libtool 'CXX' tag
-case "x${target_os}" in
-xfreebsd*)
- # FIXME: temporary hack until I find a better solution
- # to make libtool use the C++ tag...
- LIBTOOL="$LIBTOOL --tag=CXX"
- ;;
-esac
-
-
-#
-# Flags
-#
-
-LIBRARY_LD_FLAGS="\$(top_builddir)/src/\$(LIBRARY_NAME).la"
-AC_SUBST(LIBRARY_LD_FLAGS)
-
-PKGCONFIG_CFLAGS=""
-PKGCONFIG_LIBS=""
-
-AC_SUBST(PKGCONFIG_CFLAGS)
-AC_SUBST(PKGCONFIG_LIBS)
-
-EXTRA_CFLAGS="$EXTRA_CFLAGS -D_REENTRANT=1 -D_THREAD_SAFE=1 $LIBGNUTLS_CFLAGS"
-EXTRA_LIBS="$GSASL_LIBS $LIBGNUTLS_LIBS"
-
-CFLAGS=""
-CXXFLAGS=""
-
-# -- Debug
-if test x$VMIME_DEBUG = x1 ; then
- # -g
- OLD_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -g"
- AC_MSG_CHECKING(whether cc accepts -g)
- AC_TRY_COMPILE(,,echo yes,echo no; CXXFLAGS="$OLD_CXXFLAGS")
-else
- # -O2
- OLD_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -O2"
- AC_MSG_CHECKING(whether cc accepts -O2)
- AC_TRY_COMPILE(,,echo yes,echo no; CXXFLAGS="$OLD_CXXFLAGS")
-fi
-
-# -- HACK: add -fPIC or -fpic on static library object files
-EXTRA_CFLAGS="$EXTRA_CFLAGS $lt_prog_compiler_pic"
-
-
-
-#
-# Check to see if the compiler can handle some flags
-#
-
-""")
-
- compilerFlags = [ '-ansi', '-pedantic', '-W', '-Wall', '-Wpointer-arith', '-Wold-style-cast', '-Wconversion' ]
-
- for f in compilerFlags:
- configure_in.write('# ' + f + '\n')
- configure_in.write('OLD_EXTRA_CFLAGS="$EXTRA_CFLAGS"\n')
- configure_in.write('EXTRA_CFLAGS="$EXTRA_CFLAGS ' + f + '"\n')
- configure_in.write('AC_MSG_CHECKING(whether cc accepts ' + f + ')\n')
- configure_in.write('AC_TRY_COMPILE(,,echo yes,echo no; EXTRA_CFLAGS="$OLD_EXTRA_CFLAGS")\n\n')
-
- configure_in.write("""
-#EXTRA_CFLAGS=`echo $EXTRA_CFLAGS | sed -e 's| |\\n|g' | sort | uniq | tr '\\n' ' '`
-EXTRA_CFLAGS=`echo $EXTRA_CFLAGS | tr '\\n' ' ' | sort | uniq | tr '\\n' ' '`
-EXTRA_LIBS=`echo $EXTRA_LIBS | sed -e 's|^ ||g' | sed -e 's| | |g'`
-
-AC_SUBST(CFLAGS)
-AC_SUBST(CXXFLAGS)
-
-AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(EXTRA_LIBS)
-
-AC_SUBST(VMIME_ADDITIONAL_PC_LIBS)
-
-LIBS=`echo $LIBS | sed -e 's|^ ||g' | sed -e 's| | |g'`
-
-AC_CONFIG_FILES([ """)
-
- libvmime_dist_files.append(packageVersionedGenericName + ".pc.in")
-
- configure_in.write(packageVersionedGenericName + ".pc\n")
-
- for f in libvmime_dist_files:
- if f[-11:] == 'Makefile.in':
- configure_in.write("\t" + f[0:len(f) - 3] + "\n")
-
- configure_in.write("\t])")
- configure_in.write("""
-AC_OUTPUT
-
-
-#
-# Generate vmime/config.hpp
-#
-
-echo "
-//
-// This file was automatically generated by configuration script.
-//
-
-#ifndef VMIME_CONFIG_HPP_INCLUDED
-#define VMIME_CONFIG_HPP_INCLUDED
-
-
-// Name of package
-#define VMIME_PACKAGE """ + '\\"' + packageName + '\\"' + """
-
-// Version number of package
-#define VMIME_VERSION """ + '\\"' + packageVersion + '\\"' + """
-#define VMIME_API """ + '\\"' + packageAPI + '\\"' + """
-
-// Target OS and architecture
-#define VMIME_TARGET_ARCH \\"${VMIME_TARGET_ARCH}\\"
-#define VMIME_TARGET_OS \\"${VMIME_TARGET_OS}\\"
-
-// Set to 1 if debugging should be activated
-#define VMIME_DEBUG ${VMIME_DEBUG}
-
-// Byte order (set one or the other, but not both!)
-#define VMIME_BYTE_ORDER_BIG_ENDIAN ${VMIME_BYTE_ORDER_BIG_ENDIAN}
-#define VMIME_BYTE_ORDER_LITTLE_ENDIAN ${VMIME_BYTE_ORDER_LITTLE_ENDIAN}
-
-// Generic types
-// -- 8-bit
-typedef signed ${VMIME_TYPE_INT8} vmime_int8;
-typedef unsigned ${VMIME_TYPE_INT8} vmime_uint8;
-// -- 16-bit
-typedef signed ${VMIME_TYPE_INT16} vmime_int16;
-typedef unsigned ${VMIME_TYPE_INT16} vmime_uint16;
-// -- 32-bit
-typedef signed ${VMIME_TYPE_INT32} vmime_int32;
-typedef unsigned ${VMIME_TYPE_INT32} vmime_uint32;
-
-// Options
-// -- File-system support
-#define VMIME_HAVE_FILESYSTEM_FEATURES 1
-// -- SASL support
-#define VMIME_HAVE_SASL_SUPPORT ${VMIME_HAVE_SASL_SUPPORT}
-// -- TLS support
-#define VMIME_HAVE_TLS_SUPPORT ${VMIME_HAVE_TLS_SUPPORT}
-#define HAVE_GNUTLS_PRIORITY_FUNCS ${HAVE_GNUTLS_PRIORITY_FUNCS}
-// -- Messaging support
-#define VMIME_HAVE_MESSAGING_FEATURES ${VMIME_HAVE_MESSAGING_FEATURES}
-""")
-
- # Messaging protocols
- configure_in.write('// -- Built-in messaging protocols\n')
- configure_in.write('#define VMIME_BUILTIN_MESSAGING_PROTOS \\"$VMIME_BUILTIN_MESSAGING_PROTOS\\"\n')
-
- for p in libvmime_messaging_proto_sources:
- p = string.upper(p[0])
- configure_in.write("#define VMIME_BUILTIN_MESSAGING_PROTO_" + p
- + " $VMIME_BUILTIN_MESSAGING_PROTO_" + p + "\n")
-
- # Platform handlers
- configure_in.write('// -- Built-in platform handlers\n')
- configure_in.write('#define VMIME_BUILTIN_PLATFORMS \\"$VMIME_BUILTIN_PLATFORMS\\"\n')
-
- for p in libvmime_platforms_sources:
- p = string.upper(p)
- configure_in.write('#define VMIME_BUILTIN_PLATFORM_' + p
- + " $VMIME_BUILTIN_PLATFORM_" + p + " \n")
-
- configure_in.write("""
-" > vmime/config.hpp
-
-# Miscellaneous flags
-echo "// Miscellaneous flags" >> vmime/config.hpp
-echo "#define VMIME_SENDMAIL_PATH \\"$SENDMAIL\\"" >> vmime/config.hpp
-echo "" >> vmime/config.hpp
-
-# Additional defines
-echo "// Additional defines" >> vmime/config.hpp
-
-for d in $VMIME_ADDITIONAL_DEFINES ; do
- echo "#define VMIME_$d 1" >> vmime/config.hpp
-done
-
-
-echo "" >> vmime/config.hpp
-echo "#endif // VMIME_CONFIG_HPP_INCLUDED" >> vmime/config.hpp
-
-
-AC_MSG_RESULT([
-+=================+
-| CONFIGURATION |
-+=================+
-
-Installation prefix : $prefix
-Debugging mode : $conf_debug
-Messaging support : $conf_messaging
- * protocols :$VMIME_BUILTIN_MESSAGING_PROTOS
-File-system support : yes
-Platform handlers :$VMIME_BUILTIN_PLATFORMS
-SASL support : $conf_sasl
-TLS/SSL support : $conf_tls
-
-Please check 'vmime/config.hpp' to ensure the configuration is correct.
-])
-""")
-
- configure_in.close()
-
- os.system('bash bootstrap')
-
- return None
-
-
-# Custom builder for generating autotools scripts
-autotoolsBuilder = Builder(action = generateAutotools)
-env.Append(BUILDERS = { 'GenerateAutoTools' : autotoolsBuilder })
-
-env.Alias('autotools', env.GenerateAutoTools('foo_autotools', 'SConstruct'))
-
-
-
-################################
-# Generate MSVC project files #
-################################
-
-MSVC_filesDone = []
-MSVC_dupCounter = 1 # counter for duplicate file names
-
-def generateMSVC(target, source, env):
- # vmime.sln
- vmime_sln = open("vmime.sln", 'w')
- vmime_sln.write("""Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmime", "vmime.vcproj", "{B2B47E11-DB57-49E1-8895-F03BDF78A221}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {B2B47E11-DB57-49E1-8895-F03BDF78A221}.Debug.ActiveCfg = Debug|Win32
- {B2B47E11-DB57-49E1-8895-F03BDF78A221}.Debug.Build.0 = Debug|Win32
- {B2B47E11-DB57-49E1-8895-F03BDF78A221}.Release.ActiveCfg = Release|Win32
- {B2B47E11-DB57-49E1-8895-F03BDF78A221}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
-""")
- vmime_sln.close();
-
- # vmime.vcproj
- vmime_vcproj = open("vmime.vcproj", 'w')
- vmime_vcproj.write("""<?xml version="1.0" encoding="Windows-1252"?>
-<!-- This file has been automatically generated from SConstruct -->
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="vmime"
- ProjectGUID="{B2B47E11-DB57-49E1-8895-F03BDF78A221}"
- RootNamespace="vmime"
- Keyword="Win32Proj">
- <Platforms>
- <Platform Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="."
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4101;4244;4250;4267;4355"/>
- <Tool Name="VCCustomBuildTool"/>
- <Tool Name="VCLibrarianTool"
- AdditionalDependencies="iconv.lib ws2_32.lib"
- OutputFile="$(OutDir)/vmime.lib"/>
- <Tool Name="VCMIDLTool"/>
- <Tool Name="VCPostBuildEventTool"/>
- <Tool Name="VCPreBuildEventTool"
- CommandLine="copy $(InputDir)config.hpp.msvc $(InputDir)vmime\config.hpp"/>
- <Tool Name="VCPreLinkEventTool"/>
- <Tool Name="VCResourceCompilerTool"/>
- <Tool Name="VCWebServiceProxyGeneratorTool"/>
- <Tool Name="VCXMLDataGeneratorTool"/>
- <Tool Name="VCManagedWrapperGeneratorTool"/>
- <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="."
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4101;4244;4250;4267;4355"/>
- <Tool Name="VCCustomBuildTool"/>
- <Tool Name="VCLibrarianTool"
- AdditionalDependencies="iconv.lib ws2_32.lib"
- OutputFile="$(OutDir)/vmime.lib"/>
- <Tool Name="VCMIDLTool"/>
- <Tool Name="VCPostBuildEventTool"/>
- <Tool Name="VCPreBuildEventTool"
- CommandLine="copy $(InputDir)config.hpp.msvc $(InputDir)vmime\config.hpp"/>
- <Tool Name="VCPreLinkEventTool"/>
- <Tool Name="VCResourceCompilerTool"/>
- <Tool Name="VCWebServiceProxyGeneratorTool"/>
- <Tool Name="VCXMLDataGeneratorTool"/>
- <Tool Name="VCManagedWrapperGeneratorTool"/>
- <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
-""")
-
- # Source files
- all_sources = libvmime_sel_sources
-
- # -- Remove all platform files and re-add files for "windows" only
- for i in range(len(all_sources)):
- if string.find(all_sources[i], 'platforms/') != -1:
- all_sources[i] = ''
-
- for f in libvmime_platforms_sources['windows']:
- all_sources.append(f)
-
- # -- Prepend with 'src' (for source files) or 'vmime' (for includes)
- for i in range(len(all_sources)):
- f = all_sources[i]
- if f[-4:] == '.cpp':
- all_sources[i] = 'src/' + f
- else:
- all_sources[i] = 'vmime/' + f
-
- # -- Replace '/' with '\'
- for i in range(len(all_sources)):
- all_sources[i] = string.replace(all_sources[i], '/', '\\')
-
- all_sources.sort()
-
- # -- Sort by directory
- filesInDir = {}
-
- for f in all_sources:
- if len(f) != 0:
- comps = re.split('\\\\', f)
- l = len(comps) - 1
-
- tmp = filesInDir
-
- for i in range(len(comps) - 1):
- d = '*' + comps[i]
-
- if not tmp.has_key(d):
- tmp[d] = {}
-
- tmp = tmp[d]
-
- tmp['file%i' % len(tmp)] = f
-
- # -- Output files in filters
- vmime_vcproj.write("""
- <Files>
- <Filter Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-""")
-
- def MSVC_OutputFiles(filesInDir):
- global MSVC_filesDone, MSVC_dupCounter
-
- for k in filesInDir.keys():
- f = filesInDir[k]
-
- # Directory
- if k[0] == '*':
- vmime_vcproj.write('<Filter Name="' + k[1:] + '">\n')
- MSVC_OutputFiles(f)
- vmime_vcproj.write('</Filter>\n')
- # File
- else:
- fn = f[string.rfind(f, '\\') + 1:]
-
- if len(fn) != 0:
- if fn in MSVC_filesDone:
- # File (duplicate filename)
- vmime_vcproj.write('<File RelativePath=".\\' + f + '">\n')
- vmime_vcproj.write(""" <FileConfiguration Name="Debug|Win32">
- <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)/$(InputName)""" + str(MSVC_dupCounter) + """.obj"/>
- </FileConfiguration>
- <FileConfiguration Name="Release|Win32">
- <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)/$(InputName)""" + str(MSVC_dupCounter) + """.obj"/>
- </FileConfiguration>
-""")
- vmime_vcproj.write('</File>')
- MSVC_dupCounter = MSVC_dupCounter + 1
- else:
- # File
- vmime_vcproj.write('<File RelativePath=".\\' + f + '"/>\n')
- MSVC_filesDone.append(fn)
-
-
- MSVC_OutputFiles(filesInDir)
-
- vmime_vcproj.write(""" </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
-""")
- vmime_vcproj.close();
-
- # config.hpp.msvc
- config_hpp_msvc = open("config.hpp.msvc", 'w')
- config_hpp_msvc.write("""
-//
-// This file was automatically generated by configuration script.
-//
-
-#ifndef VMIME_CONFIG_HPP_INCLUDED
-#define VMIME_CONFIG_HPP_INCLUDED
-
-
-// Name of package
-#define VMIME_PACKAGE """ + '"' + packageName + '"' + """
-
-// Version number of package
-#define VMIME_VERSION """ + '"' + packageVersion + '"' + """
-#define VMIME_API """ + '"' + packageAPI + '"' + """
-
-// Target OS and architecture
-#define VMIME_TARGET_ARCH "i686"
-#define VMIME_TARGET_OS "windows"
-
-// Set to 1 if debugging should be activated
-#ifdef _DEBUG
-# define VMIME_DEBUG 1
-#else
-# define VMIME_DEBUG 0
-#endif
-
-// Byte order (set one or the other, but not both!)
-#define VMIME_BYTE_ORDER_BIG_ENDIAN 0
-#define VMIME_BYTE_ORDER_LITTLE_ENDIAN 1
-
-// Generic types
-// -- 8-bit
-typedef signed char vmime_int8;
-typedef unsigned char vmime_uint8;
-// -- 16-bit
-typedef signed short vmime_int16;
-typedef unsigned short vmime_uint16;
-// -- 32-bit
-typedef signed int vmime_int32;
-typedef unsigned int vmime_uint32;
-
-
-// Options
-// -- File-system support
-#define VMIME_HAVE_FILESYSTEM_FEATURES 1
-// -- SASL support
-#define VMIME_HAVE_SASL_SUPPORT 1
-// -- TLS/SSL support
-#define VMIME_HAVE_TLS_SUPPORT 1
-// -- Messaging support
-#define VMIME_HAVE_MESSAGING_FEATURES 1
-// -- Built-in messaging protocols
-#define VMIME_BUILTIN_MESSAGING_PROTOS "pop3 smtp imap maildir"
-#define VMIME_BUILTIN_MESSAGING_PROTO_POP3 1
-#define VMIME_BUILTIN_MESSAGING_PROTO_SMTP 1
-#define VMIME_BUILTIN_MESSAGING_PROTO_IMAP 1
-#define VMIME_BUILTIN_MESSAGING_PROTO_MAILDIR 1
-// -- Built-in platform handlers
-#define VMIME_BUILTIN_PLATFORMS "windows"
-#define VMIME_BUILTIN_PLATFORM_WINDOWS 1
-
-// Miscellaneous
-#define VMIME_INLINE_TEMPLATE_SPECIALIZATION 1
-#define VMIME_NO_MULTIPLE_INHERITANCE 1
-""")
-
- for p in libvmime_platforms_sources:
- if not (p == 'windows'):
- p = string.upper(p)
- config_hpp_msvc.write('#define VMIME_BUILTIN_PLATFORM_' + p + ' 0\n')
-
- config_hpp_msvc.write("""
-
-#endif // VMIME_CONFIG_HPP_INCLUDED
-""")
- config_hpp_msvc.close()
-
- libvmime_dist_files.append("vmime.sln")
- libvmime_dist_files.append("vmime.vcproj")
- libvmime_dist_files.append("config.hpp.msvc")
-
- return None
-
-
-
-# Custom builder for generating MSVC project files
-msvcBuilder = Builder(action = generateMSVC)
-env.Append(BUILDERS = { 'GenerateMSVC' : msvcBuilder })
-
-env.Alias('msvc', env.GenerateMSVC('foo_msvc', 'SConstruct'))
-
-
-
-#####################
-# Packaging rules #
-#####################
-
-def appendAdditionalDistFiles():
- # Generate autotools-related files
- generateAutotools([], [], env)
- # Generate MSVC-related files
- generateMSVC([], [], env)
-
-
-# 'tar' is not available under Windows...
-if not (os.name == 'win32' or os.name == 'nt'):
- def createPackage(target, source, env):
- packageFullName = packageName + '-' + packageVersion
- packageFile = packageFullName + '.tar.bz2'
-
- appendAdditionalDistFiles()
-
- distFiles = []
- distFilesStr = ''
-
- for f in libvmime_dist_files:
- distFiles.append(packageFullName + '/' + f)
- distFilesStr = distFilesStr + packageFullName + '/' + f + ' '
- print f
-
- os.system('ln -s . ' + packageFullName)
- os.system('tar jcf ' + packageFile + ' ' + distFilesStr)
- os.system('rm -f ' + packageFullName)
-
- return None
-
- # Custom builder for creating package
- createPackageBuilder = Builder(action = createPackage)
- env.Append(BUILDERS = { 'CreatePackage' : createPackageBuilder })
-
- env.Alias('dist', env.CreatePackage('foo_tar', 'SConstruct'))
-
-
###################
# Documentation #
###################
diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake
new file mode 100644
index 00000000..d74a4f3a
--- /dev/null
+++ b/cmake/FindCppUnit.cmake
@@ -0,0 +1,34 @@
+#
+# http://root.cern.ch/viewvc/trunk/cint/reflex/cmake/modules/FindCppUnit.cmake
+#
+# - Find CppUnit
+# This module finds an installed CppUnit package.
+#
+# It sets the following variables:
+# CPPUNIT_FOUND - Set to false, or undefined, if CppUnit isn't found.
+# CPPUNIT_INCLUDE_DIR - The CppUnit include directory.
+# CPPUNIT_LIBRARY - The CppUnit library to link against.
+
+FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/Test.h)
+FIND_LIBRARY(CPPUNIT_LIBRARY NAMES cppunit)
+
+IF (CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARY)
+ SET(CPPUNIT_FOUND TRUE)
+ENDIF (CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARY)
+
+IF (CPPUNIT_FOUND)
+
+ # show which CppUnit was found only if not quiet
+ IF (NOT CppUnit_FIND_QUIETLY)
+ MESSAGE(STATUS "Found CppUnit: ${CPPUNIT_LIBRARY}")
+ ENDIF (NOT CppUnit_FIND_QUIETLY)
+
+ELSE (CPPUNIT_FOUND)
+
+ # fatal error if CppUnit is required but not found
+ IF (CppUnit_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find CppUnit")
+ ENDIF (CppUnit_FIND_REQUIRED)
+
+ENDIF (CPPUNIT_FOUND)
+
diff --git a/cmake/FindGSasl.cmake b/cmake/FindGSasl.cmake
new file mode 100644
index 00000000..31890a23
--- /dev/null
+++ b/cmake/FindGSasl.cmake
@@ -0,0 +1,51 @@
+# - Try to find the GNU sasl library (gsasl)
+#
+# Once done this will define
+#
+# GNUTLS_FOUND - System has gnutls
+# GNUTLS_INCLUDE_DIR - The gnutls include directory
+# GNUTLS_LIBRARIES - The libraries needed to use gnutls
+# GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
+
+# Adapted from FindGnuTLS.cmake, which is:
+# Copyright 2009, Brad Hards, <[email protected]>
+#
+# Changes are Copyright 2009, Michele Caini, <[email protected]>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (GSASL_INCLUDE_DIR AND GSASL_LIBRARIES)
+ # in cache already
+ SET(GSasl_FIND_QUIETLY TRUE)
+ENDIF (GSASL_INCLUDE_DIR AND GSASL_LIBRARIES)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_GSASL libgsasl)
+ SET(GSASL_DEFINITIONS ${PC_GSASL_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(GSASL_INCLUDE_DIR gsasl.h
+ HINTS
+ ${PC_GSASL_INCLUDEDIR}
+ ${PC_GSASL_INCLUDE_DIRS}
+ PATH_SUFFIXES gsasl
+ )
+
+FIND_LIBRARY(GSASL_LIBRARIES NAMES gsasl libgsasl
+ HINTS
+ ${PC_GSASL_LIBDIR}
+ ${PC_GSASL_LIBRARY_DIRS}
+ )
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+# handle the QUIETLY and REQUIRED arguments and set GSASL_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSASL DEFAULT_MSG GSASL_LIBRARIES GSASL_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(GSASL_INCLUDE_DIR GSASL_LIBRARIES)
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake
new file mode 100644
index 00000000..62336576
--- /dev/null
+++ b/cmake/FindIconv.cmake
@@ -0,0 +1,61 @@
+# - Try to find Iconv
+# Once done this will define
+#
+# ICONV_FOUND - system has Iconv
+# ICONV_INCLUDE_DIR - the Iconv include directory
+# ICONV_LIBRARIES - Link these to use Iconv
+# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
+#
+include(CheckCXXSourceCompiles)
+
+IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+ # Already in cache, be silent
+ SET(ICONV_FIND_QUIETLY TRUE)
+ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+
+FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c HINTS "/opt/local/lib")
+ELSE()
+ FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
+ENDIF()
+
+IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+ SET(ICONV_FOUND TRUE)
+ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+
+set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
+IF(ICONV_FOUND)
+ check_cxx_source_compiles("
+ #include <iconv.h>
+ int main(){
+ iconv_t conv = 0;
+ const char* in = 0;
+ size_t ilen = 0;
+ char* out = 0;
+ size_t olen = 0;
+ iconv(conv, &in, &ilen, &out, &olen);
+ return 0;
+ }
+" ICONV_SECOND_ARGUMENT_IS_CONST )
+ENDIF(ICONV_FOUND)
+set(CMAKE_REQUIRED_INCLUDES)
+set(CMAKE_REQUIRED_LIBRARIES)
+
+IF(ICONV_FOUND)
+ IF(NOT ICONV_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
+ ENDIF(NOT ICONV_FIND_QUIETLY)
+ELSE(ICONV_FOUND)
+ IF(Iconv_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Iconv")
+ ENDIF(Iconv_FIND_REQUIRED)
+ENDIF(ICONV_FOUND)
+
+MARK_AS_ADVANCED(
+ ICONV_INCLUDE_DIR
+ ICONV_LIBRARIES
+ ICONV_SECOND_ARGUMENT_IS_CONST
+)
diff --git a/cmake/TargetArch.cmake b/cmake/TargetArch.cmake
new file mode 100644
index 00000000..df038f73
--- /dev/null
+++ b/cmake/TargetArch.cmake
@@ -0,0 +1,136 @@
+# https://github.com/petroules/solar-cmake
+#
+# Based on the Qt 5 processor detection code, so should be very accurate
+# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h
+# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
+
+# Regarding POWER/PowerPC, just as is noted in the Qt source,
+# "There are many more known variants/revisions that we do not handle/detect."
+
+set(archdetect_c_code "
+#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
+ #if defined(__ARM_ARCH_7__) \\
+ || defined(__ARM_ARCH_7A__) \\
+ || defined(__ARM_ARCH_7R__) \\
+ || defined(__ARM_ARCH_7M__) \\
+ || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
+ #error cmake_ARCH armv7
+ #elif defined(__ARM_ARCH_6__) \\
+ || defined(__ARM_ARCH_6J__) \\
+ || defined(__ARM_ARCH_6T2__) \\
+ || defined(__ARM_ARCH_6Z__) \\
+ || defined(__ARM_ARCH_6K__) \\
+ || defined(__ARM_ARCH_6ZK__) \\
+ || defined(__ARM_ARCH_6M__) \\
+ || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
+ #error cmake_ARCH armv6
+ #elif defined(__ARM_ARCH_5TEJ__) \\
+ || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
+ #error cmake_ARCH armv5
+ #else
+ #error cmake_ARCH arm
+ #endif
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+ #error cmake_ARCH i386
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
+ #error cmake_ARCH x86_64
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+ #error cmake_ARCH ia64
+#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
+ || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
+ || defined(_M_MPPC) || defined(_M_PPC)
+ #if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
+ #error cmake_ARCH ppc64
+ #else
+ #error cmake_ARCH ppc
+ #endif
+#endif
+
+#error cmake_ARCH unknown
+")
+
+# Set ppc_support to TRUE before including this file or ppc and ppc64
+# will be treated as invalid architectures since they are no longer supported by Apple
+
+function(target_architecture output_var)
+ if(APPLE AND CMAKE_OSX_ARCHITECTURES)
+ # On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
+ # First let's normalize the order of the values
+
+ # Note that it's not possible to compile PowerPC applications if you are using
+ # the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
+ # disable it by default
+ # See this page for more information:
+ # http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
+
+ # Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
+ # On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
+
+ foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
+ if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
+ set(osx_arch_ppc TRUE)
+ elseif("${osx_arch}" STREQUAL "i386")
+ set(osx_arch_i386 TRUE)
+ elseif("${osx_arch}" STREQUAL "x86_64")
+ set(osx_arch_x86_64 TRUE)
+ elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
+ set(osx_arch_ppc64 TRUE)
+ else()
+ message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
+ endif()
+ endforeach()
+
+ # Now add all the architectures in our normalized order
+ if(osx_arch_ppc)
+ list(APPEND ARCH ppc)
+ endif()
+
+ if(osx_arch_i386)
+ list(APPEND ARCH i386)
+ endif()
+
+ if(osx_arch_x86_64)
+ list(APPEND ARCH x86_64)
+ endif()
+
+ if(osx_arch_ppc64)
+ list(APPEND ARCH ppc64)
+ endif()
+ else()
+ file(WRITE "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/arch.c" "${archdetect_c_code}")
+
+ enable_language(C)
+
+ # Detect the architecture in a rather creative way...
+ # This compiles a small C program which is a series of ifdefs that selects a
+ # particular #error preprocessor directive whose message string contains the
+ # target architecture. The program will always fail to compile (both because
+ # file is not a valid C program, and obviously because of the presence of the
+ # #error preprocessor directives... but by exploiting the preprocessor in this
+ # way, we can detect the correct target architecture even when cross-compiling,
+ # since the program itself never needs to be run (only the compiler/preprocessor)
+ try_run(
+ run_result_unused
+ compile_result_unused
+ "${CMAKE_BINARY_DIR}"
+ "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/arch.c"
+ COMPILE_OUTPUT_VARIABLE ARCH
+ CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
+ )
+
+ # Parse the architecture name from the compiler output
+ string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
+
+ # Get rid of the value marker leaving just the architecture name
+ string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
+
+ # If we are compiling with an unknown architecture this variable should
+ # already be set to "unknown" but in the case that it's empty (i.e. due
+ # to a typo in the code), then set it to unknown
+ if (NOT ARCH)
+ set(ARCH unknown)
+ endif()
+ endif()
+
+ set(${output_var} "${ARCH}" PARENT_SCOPE)
+endfunction()
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
new file mode 100644
index 00000000..0abf5155
--- /dev/null
+++ b/cmake/Utils.cmake
@@ -0,0 +1,13 @@
+
+# Installing headers and preserving the directory structure
+# Found here: http://www.semipol.de/archives/251
+MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST COMPONENT_NAME)
+
+ FOREACH(HEADER ${${HEADER_LIST}})
+ STRING(REGEX MATCH "(.*)[/\\]" DIR ${HEADER})
+ STRING(REPLACE "${CMAKE_SOURCE_DIR}/" "" DIR ${DIR})
+ INSTALL(FILES ${HEADER} DESTINATION include/${DIR} COMPONENT ${COMPONENT_NAME})
+ ENDFOREACH(HEADER)
+
+ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
+
diff --git a/cmake/config.hpp.cmake b/cmake/config.hpp.cmake
new file mode 100644
index 00000000..66c26b6c
--- /dev/null
+++ b/cmake/config.hpp.cmake
@@ -0,0 +1,66 @@
+//
+// This file was automatically generated by CMake.
+//
+
+#ifndef VMIME_CONFIG_HPP_INCLUDED
+#define VMIME_CONFIG_HPP_INCLUDED
+
+
+// Name of package
+#define VMIME_PACKAGE "@PROJECT_NAME@"
+
+// Version number of package
+#define VMIME_VERSION "@VMIME_VERSION@"
+#define VMIME_API "@VMIME_API_VERSION@"
+
+// Target OS and architecture
+#define VMIME_TARGET_ARCH "@CMAKE_TARGET_ARCHITECTURES@"
+#define VMIME_TARGET_OS "@CMAKE_SYSTEM_NAME@"
+
+// Set to 1 if debugging should be activated
+#define VMIME_DEBUG @VMIME_DEBUG@
+
+// Byte order (set one or the other, but not both!)
+#define VMIME_BYTE_ORDER_BIG_ENDIAN @VMIME_BYTE_ORDER_BIG_ENDIAN@
+#define VMIME_BYTE_ORDER_LITTLE_ENDIAN @VMIME_BYTE_ORDER_LITTLE_ENDIAN@
+
+// Generic types
+// -- 8-bit
+typedef signed @VMIME_8BIT_TYPE@ vmime_int8;
+typedef unsigned @VMIME_8BIT_TYPE@ vmime_uint8;
+// -- 16-bit
+typedef signed @VMIME_16BIT_TYPE@ vmime_int16;
+typedef unsigned @VMIME_16BIT_TYPE@ vmime_uint16;
+// -- 32-bit
+typedef signed @VMIME_32BIT_TYPE@ vmime_int32;
+typedef unsigned @VMIME_32BIT_TYPE@ vmime_uint32;
+
+// Options
+// -- File-system support
+#cmakedefine01 VMIME_HAVE_FILESYSTEM_FEATURES
+// -- SASL support
+#cmakedefine01 VMIME_HAVE_SASL_SUPPORT
+// -- TLS/SSL support
+#cmakedefine01 VMIME_HAVE_TLS_SUPPORT
+#cmakedefine01 VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+#define VMIME_HAVE_GNUTLS_PRIORITY_FUNCS @VMIME_HAVE_GNUTLS_PRIORITY_FUNCS@
+// -- Messaging support
+#cmakedefine01 VMIME_HAVE_MESSAGING_FEATURES
+// -- Messaging protocols
+#cmakedefine01 VMIME_HAVE_MESSAGING_PROTO_POP3
+#cmakedefine01 VMIME_HAVE_MESSAGING_PROTO_SMTP
+#cmakedefine01 VMIME_HAVE_MESSAGING_PROTO_IMAP
+#cmakedefine01 VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+#cmakedefine01 VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+// -- Platform-specific code
+#cmakedefine01 VMIME_PLATFORM_IS_POSIX
+#cmakedefine01 VMIME_PLATFORM_IS_WINDOWS
+#cmakedefine01 VMIME_HAVE_PTHREAD
+#cmakedefine01 VMIME_HAVE_GETADDRINFO
+
+
+#define VMIME_SENDMAIL_PATH "@VMIME_SENDMAIL_PATH@"
+
+
+#endif // VMIME_CONFIG_HPP_INCLUDED
+
diff --git a/src/exception.cpp b/src/exception.cpp
index 60ec95b4..fd223b2a 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -334,6 +334,18 @@ exception* system_error::clone() const { return new system_error(*this); }
const char* system_error::name() const throw() { return "system_error"; }
+//
+// malformed_url
+//
+
+malformed_url::~malformed_url() throw() {}
+malformed_url::malformed_url(const string& error, const exception& other)
+ : exception("Malformed URL: " + error + ".", other) {}
+
+exception* malformed_url::clone() const { return new malformed_url(*this); }
+const char* malformed_url::name() const throw() { return "malformed_url"; }
+
+
#if VMIME_HAVE_MESSAGING_FEATURES
@@ -610,18 +622,6 @@ const char* partial_fetch_not_supported::name() const throw() { return "partial_
//
-// malformed_url
-//
-
-malformed_url::~malformed_url() throw() {}
-malformed_url::malformed_url(const string& error, const exception& other)
- : net_exception("Malformed URL: " + error + ".", other) {}
-
-exception* malformed_url::clone() const { return new malformed_url(*this); }
-const char* malformed_url::name() const throw() { return "malformed_url"; }
-
-
-//
// invalid_folder_name
//
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index cb23cd04..6f9a72bf 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include <fstream>
#include <sstream>
@@ -211,3 +217,7 @@ void fileAttachment::fileInfo::setSize(const unsigned int& size) { if (m_size) {
} // vmime
+
+
+#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/net/builtinServices.inl b/src/net/builtinServices.inl
index 4a6ac873..aba4cd3a 100644
--- a/src/net/builtinServices.inl
+++ b/src/net/builtinServices.inl
@@ -29,7 +29,7 @@
#ifndef VMIME_BUILDING_DOC
-#if VMIME_BUILTIN_MESSAGING_PROTO_POP3
+#if VMIME_HAVE_MESSAGING_PROTO_POP3
#include "vmime/net/pop3/POP3Store.hpp"
REGISTER_SERVICE(pop3::POP3Store, pop3, TYPE_STORE);
@@ -40,7 +40,7 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_SMTP
+#if VMIME_HAVE_MESSAGING_PROTO_SMTP
#include "vmime/net/smtp/SMTPTransport.hpp"
REGISTER_SERVICE(smtp::SMTPTransport, smtp, TYPE_TRANSPORT);
@@ -51,7 +51,7 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_IMAP
+#if VMIME_HAVE_MESSAGING_PROTO_IMAP
#include "vmime/net/imap/IMAPStore.hpp"
REGISTER_SERVICE(imap::IMAPStore, imap, TYPE_STORE);
@@ -62,12 +62,12 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_MAILDIR
+#if VMIME_HAVE_MESSAGING_PROTO_MAILDIR
#include "vmime/net/maildir/maildirStore.hpp"
REGISTER_SERVICE(maildir::maildirStore, maildir, TYPE_STORE);
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_SENDMAIL
+#if VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
#include "vmime/net/sendmail/sendmailTransport.hpp"
REGISTER_SERVICE(sendmail::sendmailTransport, sendmail, TYPE_TRANSPORT);
#endif
diff --git a/src/net/defaultConnectionInfos.cpp b/src/net/defaultConnectionInfos.cpp
index 41f1e0fd..6c699f23 100644
--- a/src/net/defaultConnectionInfos.cpp
+++ b/src/net/defaultConnectionInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/defaultConnectionInfos.hpp"
@@ -50,3 +56,5 @@ port_t defaultConnectionInfos::getPort() const
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/events.cpp b/src/net/events.cpp
index 52c13eef..32ab2cfb 100644
--- a/src/net/events.cpp
+++ b/src/net/events.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/events.hpp"
#include "vmime/net/folder.hpp"
@@ -113,3 +119,7 @@ void folderEvent::dispatch(folderListener* listener) const
} // events
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/folder.cpp b/src/net/folder.cpp
index 47ec3170..e4b7cdd0 100644
--- a/src/net/folder.cpp
+++ b/src/net/folder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/folder.hpp"
#include <algorithm>
@@ -98,3 +104,7 @@ void folder::notifyFolder(const events::folderEvent& event)
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index e2b60ed9..9cb81d8c 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPTag.hpp"
#include "vmime/net/imap/IMAPConnection.hpp"
#include "vmime/net/imap/IMAPUtils.hpp"
@@ -727,3 +733,7 @@ ref <const socket> IMAPConnection::getSocket() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index 3d8c17ea..8eac9eae 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPFolder.hpp"
#include "vmime/net/imap/IMAPStore.hpp"
@@ -1936,3 +1942,7 @@ std::vector <int> IMAPFolder::getMessageNumbersStartingOnUID(const message::uid&
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 808f7d1d..45d4699b 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPParser.hpp"
#include "vmime/net/imap/IMAPMessage.hpp"
#include "vmime/net/imap/IMAPFolder.hpp"
@@ -316,7 +322,7 @@ void IMAPMessage::extractImpl(ref <const part> p, utility::outputStream& os,
// header + body
if ((extractFlags & EXTRACT_HEADER) && (extractFlags & EXTRACT_BODY))
- *((int *) 0)=42;//throw exceptions::operation_not_supported();
+ throw exceptions::operation_not_supported();
// body only
else if (extractFlags & EXTRACT_BODY)
command << ".TEXT";
@@ -745,3 +751,6 @@ ref <vmime::message> IMAPMessage::getParsedMessage()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp
index c2cd6479..1f16c698 100644
--- a/src/net/imap/IMAPMessagePartContentHandler.cpp
+++ b/src/net/imap/IMAPMessagePartContentHandler.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPMessagePartContentHandler.hpp"
#include "vmime/utility/outputStreamAdapter.hpp"
@@ -186,3 +192,6 @@ bool IMAPMessagePartContentHandler::isBuffered() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPPart.cpp b/src/net/imap/IMAPPart.cpp
index 32021e83..13de4d77 100644
--- a/src/net/imap/IMAPPart.cpp
+++ b/src/net/imap/IMAPPart.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPPart.hpp"
#include "vmime/net/imap/IMAPStructure.hpp"
@@ -150,3 +156,6 @@ header& IMAPPart::getOrCreateHeader()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPSStore.cpp b/src/net/imap/IMAPSStore.cpp
index 9e92f92c..74f3fe18 100644
--- a/src/net/imap/IMAPSStore.cpp
+++ b/src/net/imap/IMAPSStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPSStore.hpp"
@@ -67,3 +73,7 @@ const serviceInfos& IMAPSStore::getInfos() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPServiceInfos.cpp b/src/net/imap/IMAPServiceInfos.cpp
index 33898f43..9cbb930e 100644
--- a/src/net/imap/IMAPServiceInfos.cpp
+++ b/src/net/imap/IMAPServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPServiceInfos.hpp"
@@ -126,3 +132,6 @@ const std::vector <serviceInfos::property> IMAPServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPStore.cpp b/src/net/imap/IMAPStore.cpp
index f260e55a..0d2adc16 100644
--- a/src/net/imap/IMAPStore.cpp
+++ b/src/net/imap/IMAPStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPStore.hpp"
#include "vmime/net/imap/IMAPFolder.hpp"
#include "vmime/net/imap/IMAPConnection.hpp"
@@ -237,3 +243,7 @@ const serviceInfos& IMAPStore::getInfos() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPStructure.cpp b/src/net/imap/IMAPStructure.cpp
index 357febe3..a0bd98bb 100644
--- a/src/net/imap/IMAPStructure.cpp
+++ b/src/net/imap/IMAPStructure.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPStructure.hpp"
#include "vmime/net/imap/IMAPPart.hpp"
@@ -83,3 +89,6 @@ ref <IMAPStructure> IMAPStructure::emptyStructure()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPTag.cpp b/src/net/imap/IMAPTag.cpp
index abb79249..45606f0a 100644
--- a/src/net/imap/IMAPTag.cpp
+++ b/src/net/imap/IMAPTag.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPTag.hpp"
@@ -101,3 +107,7 @@ void IMAPTag::generate()
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index eceac16b..3f1c704b 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPUtils.hpp"
#include "vmime/net/message.hpp"
#include "vmime/net/folder.hpp"
@@ -785,3 +791,7 @@ const message::uid IMAPUtils::makeGlobalUID(const unsigned int UIDValidity, cons
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 721517e8..033951a1 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/format/courierMaildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -531,3 +537,6 @@ bool courierMaildirFormat::supports() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index a21d1061..606f2d08 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/format/kmailMaildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -308,3 +314,6 @@ bool kmailMaildirFormat::supports() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index b606cda0..cbea38ee 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFolder.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -1387,3 +1393,7 @@ std::vector <int> maildirFolder::getMessageNumbersStartingOnUID(const message::u
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirFormat.cpp b/src/net/maildir/maildirFormat.cpp
index 78445428..d7cddb5e 100644
--- a/src/net/maildir/maildirFormat.cpp
+++ b/src/net/maildir/maildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -98,3 +104,6 @@ ref <maildirFormat> maildirFormat::detect(ref <maildirStore> store)
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index 4ab75e75..dd38cbd8 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirMessage.hpp"
#include "vmime/net/maildir/maildirFolder.hpp"
#include "vmime/net/maildir/maildirUtils.hpp"
@@ -543,3 +549,7 @@ ref <vmime::message> maildirMessage::getParsedMessage()
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirServiceInfos.cpp b/src/net/maildir/maildirServiceInfos.cpp
index 55ba64ea..3c79e417 100644
--- a/src/net/maildir/maildirServiceInfos.cpp
+++ b/src/net/maildir/maildirServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirServiceInfos.hpp"
@@ -66,3 +72,6 @@ const std::vector <serviceInfos::property> maildirServiceInfos::getAvailableProp
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirStore.cpp b/src/net/maildir/maildirStore.cpp
index 26f4593a..3e2659f6 100644
--- a/src/net/maildir/maildirStore.cpp
+++ b/src/net/maildir/maildirStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirStore.hpp"
#include "vmime/net/maildir/maildirFolder.hpp"
@@ -260,3 +266,7 @@ const serviceInfos& maildirStore::getInfos() const
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index 3430d1f8..4a9a67e2 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirUtils.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -142,7 +148,7 @@ const utility::file::path::component maildirUtils::buildFilename
(const utility::file::path::component& id,
const utility::file::path::component& flags)
{
-#if VMIME_BUILTIN_PLATFORM_WINDOWS
+#if VMIME_PLATFORM_IS_WINDOWS
static const char DELIMITER[] = "-";
#else
static const char DELIMITER[] = ":";
@@ -229,3 +235,7 @@ bool maildirUtils::messageIdComparator::operator()
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/message.cpp b/src/net/message.cpp
index 9a548097..b8624330 100644
--- a/src/net/message.cpp
+++ b/src/net/message.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/message.hpp"
@@ -48,3 +54,7 @@ int part::getPartCount() const
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index 21e7a8b3..f9a4225f 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Folder.hpp"
#include "vmime/net/pop3/POP3Store.hpp"
@@ -864,3 +870,7 @@ std::vector <int> POP3Folder::getMessageNumbersStartingOnUID(const message::uid&
} // pop3
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index 69ef004c..1c3b3408 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Message.hpp"
#include "vmime/net/pop3/POP3Folder.hpp"
#include "vmime/net/pop3/POP3Store.hpp"
@@ -237,3 +243,7 @@ ref <vmime::message> POP3Message::getParsedMessage()
} // pop3
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3SStore.cpp b/src/net/pop3/POP3SStore.cpp
index 59aacb8e..8a21469b 100644
--- a/src/net/pop3/POP3SStore.cpp
+++ b/src/net/pop3/POP3SStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3SStore.hpp"
@@ -68,3 +74,6 @@ const serviceInfos& POP3SStore::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3ServiceInfos.cpp b/src/net/pop3/POP3ServiceInfos.cpp
index 77faa5fd..07922eff 100644
--- a/src/net/pop3/POP3ServiceInfos.cpp
+++ b/src/net/pop3/POP3ServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3ServiceInfos.hpp"
@@ -132,3 +138,6 @@ const std::vector <serviceInfos::property> POP3ServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index 793112a7..51181ece 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Store.hpp"
#include "vmime/net/pop3/POP3Folder.hpp"
@@ -1006,3 +1012,6 @@ const serviceInfos& POP3Store::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Utils.cpp b/src/net/pop3/POP3Utils.cpp
index de70dfed..f75d338e 100644
--- a/src/net/pop3/POP3Utils.cpp
+++ b/src/net/pop3/POP3Utils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Utils.hpp"
#include <sstream>
@@ -72,3 +78,6 @@ void POP3Utils::parseMultiListOrUidlResponse(const string& response, std::map <i
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/sendmail/sendmailServiceInfos.cpp b/src/net/sendmail/sendmailServiceInfos.cpp
index fb5fb543..102dfe98 100644
--- a/src/net/sendmail/sendmailServiceInfos.cpp
+++ b/src/net/sendmail/sendmailServiceInfos.cpp
@@ -21,10 +21,13 @@
// the GNU General Public License cover the whole combination.
//
-#include "vmime/net/sendmail/sendmailServiceInfos.hpp"
+#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
-#if VMIME_BUILTIN_PLATFORM_POSIX
+
+#include "vmime/net/sendmail/sendmailServiceInfos.hpp"
namespace vmime {
@@ -71,5 +74,5 @@ const std::vector <serviceInfos::property> sendmailServiceInfos::getAvailablePro
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
diff --git a/src/net/sendmail/sendmailTransport.cpp b/src/net/sendmail/sendmailTransport.cpp
index e7762ccc..e52e16d5 100644
--- a/src/net/sendmail/sendmailTransport.cpp
+++ b/src/net/sendmail/sendmailTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
+
#include "vmime/net/sendmail/sendmailTransport.hpp"
#include "vmime/exception.hpp"
@@ -48,9 +54,6 @@
dynamic_cast <const sendmailServiceInfos&>(getInfos()).getProperties().prop))
-#if VMIME_BUILTIN_PLATFORM_POSIX
-
-
namespace vmime {
namespace net {
namespace sendmail {
@@ -219,4 +222,5 @@ const serviceInfos& sendmailTransport::getInfos() const
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
diff --git a/src/net/service.cpp b/src/net/service.cpp
index f12c78f0..64c243c5 100644
--- a/src/net/service.cpp
+++ b/src/net/service.cpp
@@ -22,6 +22,11 @@
//
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/service.hpp"
#include "vmime/platform.hpp"
@@ -141,3 +146,7 @@ ref <timeoutHandlerFactory> service::getTimeoutHandlerFactory()
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/serviceFactory.cpp b/src/net/serviceFactory.cpp
index 65f9aa1d..71b7efea 100644
--- a/src/net/serviceFactory.cpp
+++ b/src/net/serviceFactory.cpp
@@ -21,11 +21,16 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/serviceFactory.hpp"
#include "vmime/net/service.hpp"
#include "vmime/exception.hpp"
-#include "vmime/config.hpp"
#include "src/net/builtinServices.inl"
@@ -134,3 +139,7 @@ void serviceFactory::registerService(ref <registeredService> reg)
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/serviceInfos.cpp b/src/net/serviceInfos.cpp
index 069d9e10..ab3a39bd 100644
--- a/src/net/serviceInfos.cpp
+++ b/src/net/serviceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -156,3 +162,6 @@ int serviceInfos::property::getFlags() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/session.cpp b/src/net/session.cpp
index 3898a8da..308b2989 100644
--- a/src/net/session.cpp
+++ b/src/net/session.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/session.hpp"
#include "vmime/net/serviceFactory.hpp"
@@ -132,3 +138,7 @@ propertySet& session::getProperties()
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/smtp/SMTPResponse.cpp b/src/net/smtp/SMTPResponse.cpp
index 03c199ba..e1ac2af6 100644
--- a/src/net/smtp/SMTPResponse.cpp
+++ b/src/net/smtp/SMTPResponse.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPResponse.hpp"
#include "vmime/platform.hpp"
@@ -249,3 +255,6 @@ const string SMTPResponse::responseLine::getText() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPSTransport.cpp b/src/net/smtp/SMTPSTransport.cpp
index db7fc6ff..73d511f9 100644
--- a/src/net/smtp/SMTPSTransport.cpp
+++ b/src/net/smtp/SMTPSTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPSTransport.hpp"
@@ -68,3 +74,6 @@ const serviceInfos& SMTPSTransport::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPServiceInfos.cpp b/src/net/smtp/SMTPServiceInfos.cpp
index d2d0dcc2..5fe8dae2 100644
--- a/src/net/smtp/SMTPServiceInfos.cpp
+++ b/src/net/smtp/SMTPServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPServiceInfos.hpp"
@@ -129,3 +135,6 @@ const std::vector <serviceInfos::property> SMTPServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index bbbea755..64028d1c 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPTransport.hpp"
#include "vmime/net/smtp/SMTPResponse.hpp"
@@ -654,3 +660,7 @@ const serviceInfos& SMTPTransport::getInfos() const
} // smtp
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/tls/TLSSecuredConnectionInfos.cpp b/src/net/tls/TLSSecuredConnectionInfos.cpp
index 2a37069a..2d98f913 100644
--- a/src/net/tls/TLSSecuredConnectionInfos.cpp
+++ b/src/net/tls/TLSSecuredConnectionInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
+
#include "vmime/net/tls/TLSSecuredConnectionInfos.hpp"
#include "vmime/net/tls/TLSSession.hpp"
@@ -61,3 +67,6 @@ ref <const security::cert::certificateChain> TLSSecuredConnectionInfos::getPeerC
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index 06068085..31149396 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -21,12 +21,17 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include <gnutls/gnutls.h>
#if GNUTLS_VERSION_NUMBER < 0x030000
#include <gnutls/extra.h>
#endif
-#include "vmime/config.hpp"
// Dependency on gcrypt is not needed since GNU TLS version 2.12.
// See here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638651
@@ -138,7 +143,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
// Sets some default priority on the ciphers, key exchange methods,
// macs and compression methods.
-#if HAVE_GNUTLS_PRIORITY_FUNCS
+#if VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
gnutls_dh_set_prime_bits(*m_gnutlsSession, 128);
if ((res = gnutls_priority_set_direct
@@ -152,7 +157,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
}
}
-#else // !HAVE_GNUTLS_PRIORITY_FUNCS
+#else // !VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
gnutls_set_default_priority(*m_gnutlsSession);
@@ -228,7 +233,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
gnutls_compression_set_priority(*m_gnutlsSession, compressionPriority);
-#endif // !HAVE_GNUTLS_PRIORITY_FUNCS
+#endif // !VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
// Initialize credentials
gnutls_credentials_set(*m_gnutlsSession,
@@ -288,3 +293,6 @@ void TLSSession::throwTLSException(const string& fname, const int code)
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index 3cccc1e9..6fa8d02d 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
@@ -406,3 +412,6 @@ void TLSSocket::internalThrow()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
diff --git a/src/net/transport.cpp b/src/net/transport.cpp
index f8ca7b7a..9349e750 100644
--- a/src/net/transport.cpp
+++ b/src/net/transport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/transport.hpp"
#include "vmime/utility/stream.hpp"
@@ -135,3 +141,6 @@ transport::Type transport::getType() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/platform.cpp b/src/platform.cpp
index d1d23de0..ff6a9965 100644
--- a/src/platform.cpp
+++ b/src/platform.cpp
@@ -22,6 +22,10 @@
//
#include "vmime/platform.hpp"
+#include "vmime/config.hpp"
+
+#include "vmime/platforms/posix/posixHandler.hpp"
+#include "vmime/platforms/windows/windowsHandler.hpp"
namespace vmime
@@ -36,4 +40,40 @@ platform::handler::~handler()
}
+// static
+ref <platform::handler> platform::getDefaultHandler()
+{
+
+#if VMIME_PLATFORM_IS_WINDOWS
+ return vmime::create <platforms::windows::windowsHandler>();
+#elif VMIME_PLATFORM_IS_POSIX
+ return vmime::create <platforms::posix::posixHandler>();
+#else
+ return NULL;
+#endif
+
+}
+
+
+// static
+ref <platform::handler> platform::getHandler()
+{
+ // If a custom platform handler is installed, return it
+ if (sm_handler)
+ return sm_handler;
+
+ // Else, use the default handler for this platform
+ ref <handler> defaultHandler = getDefaultHandler();
+
+ if (defaultHandler)
+ {
+ sm_handler = defaultHandler;
+ return sm_handler;
+ }
+
+ // Oops... no platform handler!
+ throw exceptions::no_platform_handler();
+}
+
+
} // vmime
diff --git a/src/platforms/posix/posixChildProcess.cpp b/src/platforms/posix/posixChildProcess.cpp
index 68ef021e..a05942da 100644
--- a/src/platforms/posix/posixChildProcess.cpp
+++ b/src/platforms/posix/posixChildProcess.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/posix/posixChildProcess.hpp"
#include "vmime/platforms/posix/posixFile.hpp"
@@ -394,3 +400,6 @@ void posixChildProcess::waitForFinish()
} // platforms
} // vmime
+
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 4087a21f..2f67a2be 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/posix/posixFile.hpp"
#include <unistd.h>
@@ -38,9 +44,6 @@
#include "vmime/exception.hpp"
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace posix {
@@ -621,4 +624,4 @@ void posixFileSystemFactory::reportError(const vmime::utility::path& path, const
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index 2c113072..8629b1e2 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX
+
+
#include "vmime/platforms/posix/posixHandler.hpp"
#include <time.h>
@@ -258,3 +264,6 @@ void posixHandler::wait() const
} // posix
} // platforms
} // vmime
+
+
+#endif // VMIME_PLATFORM_IS_POSIX
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index f280dadc..6fcbd118 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/platforms/posix/posixSocket.hpp"
#include "vmime/platforms/posix/posixHandler.hpp"
@@ -37,9 +43,6 @@
#include "vmime/exception.hpp"
-#if VMIME_HAVE_MESSAGING_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace posix {
@@ -493,4 +496,4 @@ ref <vmime::net::socket> posixSocketFactory::create(ref <vmime::net::timeoutHand
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 5da786e5..7a70d364 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/windows/windowsFile.hpp"
#include <windows.h>
@@ -30,9 +36,6 @@
#include "vmime/utility/stringUtils.hpp"
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace windows {
@@ -546,4 +549,5 @@ void windowsFileWriterOutputStream::flush()
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 1a37c839..1ed4025b 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -21,9 +21,14 @@
// the GNU General Public License cover the whole combination.
//
-#include "vmime/platforms/windows/windowsHandler.hpp"
#include "vmime/config.hpp"
+
+#if VMIME_PLATFORM_IS_WINDOWS
+
+
+#include "vmime/platforms/windows/windowsHandler.hpp"
+
#include <time.h>
#include <locale.h>
#include <process.h>
@@ -270,3 +275,7 @@ void windowsHandler::wait() const
} // posix
} // platforms
} // vmime
+
+
+#endif // VMIME_PLATFORM_IS_WINDOWS
+
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 430c8ea0..27cbcaa7 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -21,13 +21,18 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
+
+
#pragma warning(disable: 4267)
#include "vmime/platforms/windows/windowsSocket.hpp"
#include "vmime/exception.hpp"
-#if VMIME_HAVE_MESSAGING_FEATURES
namespace vmime {
namespace platforms {
@@ -193,4 +198,5 @@ ref <vmime::net::socket> windowsSocketFactory::create(ref <vmime::net::timeoutHa
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/security/defaultAuthenticator.cpp b/src/security/defaultAuthenticator.cpp
index 088ef0da..fdd19303 100644
--- a/src/security/defaultAuthenticator.cpp
+++ b/src/security/defaultAuthenticator.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/security/defaultAuthenticator.hpp"
#include "vmime/net/service.hpp"
@@ -104,3 +110,6 @@ weak_ref <net::service> defaultAuthenticator::getService() const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/security/sasl/SASLContext.cpp b/src/security/sasl/SASLContext.cpp
index 4bb33c14..8c623124 100644
--- a/src/security/sasl/SASLContext.cpp
+++ b/src/security/sasl/SASLContext.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <sstream>
#include <gsasl.h>
@@ -197,3 +203,6 @@ const string SASLContext::getErrorMessage(const string& fname, const int code)
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLMechanismFactory.cpp b/src/security/sasl/SASLMechanismFactory.cpp
index 285d6d36..00632fb8 100644
--- a/src/security/sasl/SASLMechanismFactory.cpp
+++ b/src/security/sasl/SASLMechanismFactory.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <stdexcept>
#include <new>
@@ -133,3 +139,6 @@ bool SASLMechanismFactory::isMechanismSupported(const string& name) const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLSession.cpp b/src/security/sasl/SASLSession.cpp
index c1688b78..dcf53452 100644
--- a/src/security/sasl/SASLSession.cpp
+++ b/src/security/sasl/SASLSession.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <sstream>
#include <gsasl.h>
@@ -181,3 +187,6 @@ int SASLSession::gsaslCallback
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp
index d88153e4..28f5f6f6 100644
--- a/src/security/sasl/SASLSocket.cpp
+++ b/src/security/sasl/SASLSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/SASLSocket.hpp"
#include "vmime/security/sasl/SASLSession.hpp"
@@ -175,3 +181,6 @@ void SASLSocket::sendRaw(const char* buffer, const size_type count)
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/builtinSASLMechanism.cpp b/src/security/sasl/builtinSASLMechanism.cpp
index 767caf96..9501fb4b 100644
--- a/src/security/sasl/builtinSASLMechanism.cpp
+++ b/src/security/sasl/builtinSASLMechanism.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <gsasl.h>
#include "vmime/security/sasl/builtinSASLMechanism.hpp"
@@ -184,3 +190,6 @@ void builtinSASLMechanism::decode
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp
index 4eae4e39..eba703b2 100644
--- a/src/security/sasl/defaultSASLAuthenticator.cpp
+++ b/src/security/sasl/defaultSASLAuthenticator.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/defaultSASLAuthenticator.hpp"
#include "vmime/security/sasl/SASLMechanism.hpp"
@@ -141,3 +147,6 @@ ref <SASLMechanism> defaultSASLAuthenticator::getSASLMechanism() const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/utility/encoder/uuEncoder.cpp b/src/utility/encoder/uuEncoder.cpp
index d2974e63..0ddfbac6 100644
--- a/src/utility/encoder/uuEncoder.cpp
+++ b/src/utility/encoder/uuEncoder.cpp
@@ -116,8 +116,8 @@ utility::stream::size_type uuEncoder::encode(utility::inputStream& in,
const unsigned char c3 = static_cast <unsigned char>(inBuffer[i + 2]);
outBuffer[j] = UUENCODE(c1 >> 2);
- outBuffer[j + 1] = UUENCODE((c1 << 4) & 060 | (c2 >> 4) & 017);
- outBuffer[j + 2] = UUENCODE((c2 << 2) & 074 | (c3 >> 6) & 03);
+ outBuffer[j + 1] = UUENCODE(((c1 << 4) & 060) | ((c2 >> 4) & 017));
+ outBuffer[j + 2] = UUENCODE(((c2 << 2) & 074) | ((c3 >> 6) & 03));
outBuffer[j + 3] = UUENCODE(c3 & 077);
}
@@ -173,7 +173,7 @@ utility::stream::size_type uuEncoder::decode(utility::inputStream& in,
const utility::stream::size_type outLength = UUDECODE(lengthChar);
const utility::stream::size_type inLength =
std::min((outLength * 4) / 3, static_cast <utility::stream::size_type>(64));
- utility::stream::value_type inPos = 0;
+ utility::stream::size_type inPos = 0;
switch (lengthChar)
{
@@ -302,9 +302,9 @@ utility::stream::size_type uuEncoder::decode(utility::inputStream& in,
switch (n)
{
default:
- case 3: outBuffer[j + 2] = UUDECODE(c3) << 6 | UUDECODE(c4);
- case 2: outBuffer[j + 1] = UUDECODE(c2) << 4 | UUDECODE(c3) >> 2;
- case 1: outBuffer[j] = UUDECODE(c1) << 2 | UUDECODE(c2) >> 4;
+ case 3: outBuffer[j + 2] = static_cast <unsigned char>(UUDECODE(c3) << 6 | UUDECODE(c4));
+ case 2: outBuffer[j + 1] = static_cast <unsigned char>(UUDECODE(c2) << 4 | UUDECODE(c3) >> 2);
+ case 1: outBuffer[j] = static_cast <unsigned char>(UUDECODE(c1) << 2 | UUDECODE(c2) >> 4);
case 0: break;
}
diff --git a/vmime/base.hpp b/vmime/base.hpp
index 957793d3..b1bf7aca 100644
--- a/vmime/base.hpp
+++ b/vmime/base.hpp
@@ -78,7 +78,7 @@ namespace vmime
}
template <typename T, size_t N>
- inline size_t count(T const (&array)[N])
+ inline size_t count(T const (&/* array */)[N])
{
return (N);
}
diff --git a/vmime/exception.hpp b/vmime/exception.hpp
index 5b68bd7e..fe96fb7e 100644
--- a/vmime/exception.hpp
+++ b/vmime/exception.hpp
@@ -362,6 +362,21 @@ public:
};
+/** The URL is malformed.
+ */
+
+class malformed_url : public vmime::exception
+{
+public:
+
+ malformed_url(const string& error, const exception& other = NO_EXCEPTION);
+ ~malformed_url() throw();
+
+ exception* clone() const;
+ const char* name() const throw();
+};
+
+
#if VMIME_HAVE_MESSAGING_FEATURES
@@ -727,21 +742,6 @@ public:
};
-/** The URL is malformed.
- */
-
-class malformed_url : public net_exception
-{
-public:
-
- malformed_url(const string& error, const exception& other = NO_EXCEPTION);
- ~malformed_url() throw();
-
- exception* clone() const;
- const char* name() const throw();
-};
-
-
/** Folder name is invalid.
*/
diff --git a/vmime/fileAttachment.hpp b/vmime/fileAttachment.hpp
index 1516a9da..d75e36fe 100644
--- a/vmime/fileAttachment.hpp
+++ b/vmime/fileAttachment.hpp
@@ -25,8 +25,13 @@
#define VMIME_FILEATTACHMENT_HPP_INCLUDED
-#include "vmime/defaultAttachment.hpp"
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_FILESYSTEM_FEATURES
+
+#include "vmime/defaultAttachment.hpp"
#include "vmime/dateTime.hpp"
@@ -185,4 +190,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+
#endif // VMIME_FILEATTACHMENT_HPP_INCLUDED
diff --git a/vmime/net/connectionInfos.hpp b/vmime/net/connectionInfos.hpp
index 03f01b90..68ecf3e2 100644
--- a/vmime/net/connectionInfos.hpp
+++ b/vmime/net/connectionInfos.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_CONNECTIONINFOS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/object.hpp"
@@ -56,5 +62,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_CONNECTIONINFOS_HPP_INCLUDED
diff --git a/vmime/net/defaultConnectionInfos.hpp b/vmime/net/defaultConnectionInfos.hpp
index 518b4bcd..eaf966e9 100644
--- a/vmime/net/defaultConnectionInfos.hpp
+++ b/vmime/net/defaultConnectionInfos.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_DEFAULTCONNECTIONINFOS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/connectionInfos.hpp"
@@ -54,5 +60,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_DEFAULTCONNECTIONINFOS_HPP_INCLUDED
diff --git a/vmime/net/events.hpp b/vmime/net/events.hpp
index be05c6e2..6b9e7f00 100644
--- a/vmime/net/events.hpp
+++ b/vmime/net/events.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_EVENTS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include <vector>
#include "vmime/utility/path.hpp"
@@ -230,4 +236,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_EVENTS_HPP_INCLUDED
diff --git a/vmime/net/folder.hpp b/vmime/net/folder.hpp
index a50ee0e5..56214299 100644
--- a/vmime/net/folder.hpp
+++ b/vmime/net/folder.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_FOLDER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include <vector>
#include "vmime/types.hpp"
@@ -434,4 +440,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_FOLDER_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPConnection.hpp b/vmime/net/imap/IMAPConnection.hpp
index 820987b3..f766e95e 100644
--- a/vmime/net/imap/IMAPConnection.hpp
+++ b/vmime/net/imap/IMAPConnection.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/socket.hpp"
#include "vmime/net/timeoutHandler.hpp"
#include "vmime/net/session.hpp"
@@ -141,4 +145,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPCONNECTION_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPFolder.hpp b/vmime/net/imap/IMAPFolder.hpp
index 33378581..5471ac49 100644
--- a/vmime/net/imap/IMAPFolder.hpp
+++ b/vmime/net/imap/IMAPFolder.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPFOLDER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include <vector>
#include <map>
@@ -167,4 +173,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPFOLDER_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPMessage.hpp b/vmime/net/imap/IMAPMessage.hpp
index 06f80919..3be8edb9 100644
--- a/vmime/net/imap/IMAPMessage.hpp
+++ b/vmime/net/imap/IMAPMessage.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPMESSAGE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/message.hpp"
#include "vmime/net/folder.hpp"
@@ -137,4 +143,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPMESSAGE_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPMessagePartContentHandler.hpp b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
index 75a03afd..a251bb13 100644
--- a/vmime/net/imap/IMAPMessagePartContentHandler.hpp
+++ b/vmime/net/imap/IMAPMessagePartContentHandler.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPMESSAGEPARTCONTENTHANDLER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/contentHandler.hpp"
#include "vmime/net/imap/IMAPMessage.hpp"
@@ -71,5 +77,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPMESSAGEPARTCONTENTHANDLER_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPParser.hpp b/vmime/net/imap/IMAPParser.hpp
index f4305103..dd220c73 100644
--- a/vmime/net/imap/IMAPParser.hpp
+++ b/vmime/net/imap/IMAPParser.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPPARSER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/base.hpp"
#include "vmime/dateTime.hpp"
#include "vmime/charset.hpp"
@@ -5200,4 +5206,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPPARSER_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPPart.hpp b/vmime/net/imap/IMAPPart.hpp
index d84db1bd..a0625f55 100644
--- a/vmime/net/imap/IMAPPart.hpp
+++ b/vmime/net/imap/IMAPPart.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPPART_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/message.hpp"
#include "vmime/net/imap/IMAPParser.hpp"
@@ -84,5 +90,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPPART_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPSStore.hpp b/vmime/net/imap/IMAPSStore.hpp
index 5772ad96..b9b83f7a 100644
--- a/vmime/net/imap/IMAPSStore.hpp
+++ b/vmime/net/imap/IMAPSStore.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPSSTORE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPStore.hpp"
@@ -59,5 +65,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPSSTORE_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPServiceInfos.hpp b/vmime/net/imap/IMAPServiceInfos.hpp
index 7286b3a8..70c23d14 100644
--- a/vmime/net/imap/IMAPServiceInfos.hpp
+++ b/vmime/net/imap/IMAPServiceInfos.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -80,5 +85,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPSERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPStore.hpp b/vmime/net/imap/IMAPStore.hpp
index ebff2e66..3964e35b 100644
--- a/vmime/net/imap/IMAPStore.hpp
+++ b/vmime/net/imap/IMAPStore.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/store.hpp"
#include "vmime/net/socket.hpp"
#include "vmime/net/folder.hpp"
@@ -110,4 +114,6 @@ protected:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPSTORE_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPStructure.hpp b/vmime/net/imap/IMAPStructure.hpp
index e43676c8..abf76bba 100644
--- a/vmime/net/imap/IMAPStructure.hpp
+++ b/vmime/net/imap/IMAPStructure.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPSTRUCTURE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/message.hpp"
#include "vmime/net/imap/IMAPParser.hpp"
@@ -63,5 +69,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPSTRUCTURE_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPTag.hpp b/vmime/net/imap/IMAPTag.hpp
index cab2d480..05d374fb 100644
--- a/vmime/net/imap/IMAPTag.hpp
+++ b/vmime/net/imap/IMAPTag.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPTAG_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/types.hpp"
@@ -67,4 +73,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPTAG_HPP_INCLUDED
diff --git a/vmime/net/imap/IMAPUtils.hpp b/vmime/net/imap/IMAPUtils.hpp
index 9c9c4205..356c60ff 100644
--- a/vmime/net/imap/IMAPUtils.hpp
+++ b/vmime/net/imap/IMAPUtils.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_IMAP_IMAPUTILS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/types.hpp"
#include "vmime/dateTime.hpp"
@@ -146,4 +152,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
#endif // VMIME_NET_IMAP_IMAPUTILS_HPP_INCLUDED
diff --git a/vmime/net/maildir/format/courierMaildirFormat.hpp b/vmime/net/maildir/format/courierMaildirFormat.hpp
index e8036d51..ab040bc5 100644
--- a/vmime/net/maildir/format/courierMaildirFormat.hpp
+++ b/vmime/net/maildir/format/courierMaildirFormat.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_FORMAT_COURIERMAILDIRFORMAT_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFormat.hpp"
@@ -109,5 +115,7 @@ protected:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_FORMAT_COURIERMAILDIRFORMAT_HPP_INCLUDED
diff --git a/vmime/net/maildir/format/kmailMaildirFormat.hpp b/vmime/net/maildir/format/kmailMaildirFormat.hpp
index e5f72223..cb218d17 100644
--- a/vmime/net/maildir/format/kmailMaildirFormat.hpp
+++ b/vmime/net/maildir/format/kmailMaildirFormat.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_FORMAT_KMAILMAILDIRFORMAT_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFormat.hpp"
@@ -96,5 +102,8 @@ protected:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#endif // VMIME_NET_MAILDIR_FORMAT_KMAILMAILDIRFORMAT_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirFolder.hpp b/vmime/net/maildir/maildirFolder.hpp
index c9ba8996..f13f2782 100644
--- a/vmime/net/maildir/maildirFolder.hpp
+++ b/vmime/net/maildir/maildirFolder.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_MAILDIRFOLDER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include <vector>
#include <map>
@@ -187,4 +193,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_MAILDIRFOLDER_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirFormat.hpp b/vmime/net/maildir/maildirFormat.hpp
index 09406966..cd6c58f2 100644
--- a/vmime/net/maildir/maildirFormat.hpp
+++ b/vmime/net/maildir/maildirFormat.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_FORMAT_MAILDIRFORMAT_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/folder.hpp"
#include "vmime/utility/file.hpp"
@@ -183,5 +189,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_FORMAT_MAILDIRFORMAT_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirMessage.hpp b/vmime/net/maildir/maildirMessage.hpp
index cd66d43c..f680a20d 100644
--- a/vmime/net/maildir/maildirMessage.hpp
+++ b/vmime/net/maildir/maildirMessage.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_MAILDIRMESSAGE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/message.hpp"
#include "vmime/net/folder.hpp"
@@ -106,4 +112,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_MAILDIRMESSAGE_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirServiceInfos.hpp b/vmime/net/maildir/maildirServiceInfos.hpp
index f3b0df81..046cd2e1 100644
--- a/vmime/net/maildir/maildirServiceInfos.hpp
+++ b/vmime/net/maildir/maildirServiceInfos.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -60,5 +65,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_MAILDIRSERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirStore.hpp b/vmime/net/maildir/maildirStore.hpp
index 40ecec3f..99564f7d 100644
--- a/vmime/net/maildir/maildirStore.hpp
+++ b/vmime/net/maildir/maildirStore.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/store.hpp"
#include "vmime/net/socket.hpp"
#include "vmime/net/folder.hpp"
@@ -111,4 +115,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_MAILDIRSTORE_HPP_INCLUDED
diff --git a/vmime/net/maildir/maildirUtils.hpp b/vmime/net/maildir/maildirUtils.hpp
index c4aa0b66..2b155730 100644
--- a/vmime/net/maildir/maildirUtils.hpp
+++ b/vmime/net/maildir/maildirUtils.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MAILDIR_MAILDIRUTILS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/utility/file.hpp"
#include "vmime/utility/path.hpp"
@@ -131,4 +137,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
#endif // VMIME_NET_MAILDIR_MAILDIRUTILS_HPP_INCLUDED
diff --git a/vmime/net/message.hpp b/vmime/net/message.hpp
index 1fbd008d..e25e8cd2 100644
--- a/vmime/net/message.hpp
+++ b/vmime/net/message.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_MESSAGE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/header.hpp"
#include "vmime/mediaType.hpp"
@@ -306,4 +312,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_MESSAGE_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3Folder.hpp b/vmime/net/pop3/POP3Folder.hpp
index 090f948b..88e42e9b 100644
--- a/vmime/net/pop3/POP3Folder.hpp
+++ b/vmime/net/pop3/POP3Folder.hpp
@@ -25,10 +25,15 @@
#define VMIME_NET_POP3_POP3FOLDER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include <vector>
#include <map>
-#include "vmime/config.hpp"
#include "vmime/types.hpp"
#include "vmime/net/folder.hpp"
@@ -155,4 +160,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3FOLDER_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3Message.hpp b/vmime/net/pop3/POP3Message.hpp
index 337cc5d5..5c7209f3 100644
--- a/vmime/net/pop3/POP3Message.hpp
+++ b/vmime/net/pop3/POP3Message.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/message.hpp"
#include "vmime/net/folder.hpp"
@@ -101,4 +105,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3MESSAGE_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3SStore.hpp b/vmime/net/pop3/POP3SStore.hpp
index 1f98bfaf..ca1200ec 100644
--- a/vmime/net/pop3/POP3SStore.hpp
+++ b/vmime/net/pop3/POP3SStore.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_POP3_POP3SSTORE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Store.hpp"
@@ -59,5 +65,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3SSTORE_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3ServiceInfos.hpp b/vmime/net/pop3/POP3ServiceInfos.hpp
index d2dff587..def58670 100644
--- a/vmime/net/pop3/POP3ServiceInfos.hpp
+++ b/vmime/net/pop3/POP3ServiceInfos.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -82,5 +87,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3SERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3Store.hpp b/vmime/net/pop3/POP3Store.hpp
index 16fcce47..816e16c3 100644
--- a/vmime/net/pop3/POP3Store.hpp
+++ b/vmime/net/pop3/POP3Store.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/messageId.hpp"
#include "vmime/net/store.hpp"
@@ -142,4 +147,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3STORE_HPP_INCLUDED
diff --git a/vmime/net/pop3/POP3Utils.hpp b/vmime/net/pop3/POP3Utils.hpp
index 2640c0e6..65d5043d 100644
--- a/vmime/net/pop3/POP3Utils.hpp
+++ b/vmime/net/pop3/POP3Utils.hpp
@@ -25,9 +25,14 @@
#define VMIME_NET_POP3_POP3UTILS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include <map>
-#include "vmime/config.hpp"
#include "vmime/types.hpp"
@@ -63,5 +68,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
#endif // VMIME_NET_POP3_POP3UTILS_HPP_INCLUDED
diff --git a/vmime/net/securedConnectionInfos.hpp b/vmime/net/securedConnectionInfos.hpp
index b27d30bd..d3bbf003 100644
--- a/vmime/net/securedConnectionInfos.hpp
+++ b/vmime/net/securedConnectionInfos.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SECUREDCONNECTIONINFOS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/connectionInfos.hpp"
@@ -43,5 +49,7 @@ class securedConnectionInfos : public connectionInfos
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SECUREDCONNECTIONINFOS_HPP_INCLUDED
diff --git a/vmime/net/sendmail/sendmailServiceInfos.hpp b/vmime/net/sendmail/sendmailServiceInfos.hpp
index a86a4dd4..1b2c57d4 100644
--- a/vmime/net/sendmail/sendmailServiceInfos.hpp
+++ b/vmime/net/sendmail/sendmailServiceInfos.hpp
@@ -26,10 +26,12 @@
#include "vmime/config.hpp"
-#include "vmime/net/serviceInfos.hpp"
-#if VMIME_BUILTIN_PLATFORM_POSIX
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
+
+#include "vmime/net/serviceInfos.hpp"
namespace vmime {
@@ -63,8 +65,7 @@ public:
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
-
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
#endif // VMIME_NET_SENDMAIL_SENDMAILSERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/sendmail/sendmailTransport.hpp b/vmime/net/sendmail/sendmailTransport.hpp
index 5ff8cf2a..eefb46ac 100644
--- a/vmime/net/sendmail/sendmailTransport.hpp
+++ b/vmime/net/sendmail/sendmailTransport.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
+
#include "vmime/net/transport.hpp"
#include "vmime/net/socket.hpp"
#include "vmime/net/timeoutHandler.hpp"
@@ -34,9 +38,6 @@
#include "vmime/net/sendmail/sendmailServiceInfos.hpp"
-#if VMIME_BUILTIN_PLATFORM_POSIX
-
-
namespace vmime {
namespace net {
namespace sendmail {
@@ -91,7 +92,6 @@ private:
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
-
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
#endif // VMIME_NET_SENDMAIL_SENDMAILTRANSPORT_HPP_INCLUDED
diff --git a/vmime/net/service.hpp b/vmime/net/service.hpp
index 5205feea..8c1d1059 100644
--- a/vmime/net/service.hpp
+++ b/vmime/net/service.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/types.hpp"
#include "vmime/net/session.hpp"
@@ -223,4 +228,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SERVICE_HPP_INCLUDED
diff --git a/vmime/net/serviceFactory.hpp b/vmime/net/serviceFactory.hpp
index 0362b472..e752004c 100644
--- a/vmime/net/serviceFactory.hpp
+++ b/vmime/net/serviceFactory.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SERVICEFACTORY_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include <map>
#include "vmime/types.hpp"
@@ -157,4 +163,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SERVICEFACTORY_HPP_INCLUDED
diff --git a/vmime/net/serviceInfos.hpp b/vmime/net/serviceInfos.hpp
index eac77a1d..6a973627 100644
--- a/vmime/net/serviceInfos.hpp
+++ b/vmime/net/serviceInfos.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SERVICEINFOS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include <vector>
#include "vmime/types.hpp"
@@ -235,4 +241,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/session.hpp b/vmime/net/session.hpp
index 426fe7a5..3aa5ef93 100644
--- a/vmime/net/session.hpp
+++ b/vmime/net/session.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SESSION_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/security/authenticator.hpp"
#include "vmime/utility/url.hpp"
@@ -145,4 +151,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SESSION_HPP_INCLUDED
diff --git a/vmime/net/smtp/SMTPResponse.hpp b/vmime/net/smtp/SMTPResponse.hpp
index 5ef4f09b..265e16fe 100644
--- a/vmime/net/smtp/SMTPResponse.hpp
+++ b/vmime/net/smtp/SMTPResponse.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SMTP_SMTPRESPONSE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/object.hpp"
#include "vmime/base.hpp"
@@ -138,5 +144,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
#endif // VMIME_NET_SMTP_SMTPRESPONSE_HPP_INCLUDED
diff --git a/vmime/net/smtp/SMTPSTransport.hpp b/vmime/net/smtp/SMTPSTransport.hpp
index 393a4f58..cb26fb26 100644
--- a/vmime/net/smtp/SMTPSTransport.hpp
+++ b/vmime/net/smtp/SMTPSTransport.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SMTP_SMTPSSTORE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPTransport.hpp"
@@ -59,5 +65,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
#endif // VMIME_NET_SMTP_SMTPSSTORE_HPP_INCLUDED
diff --git a/vmime/net/smtp/SMTPServiceInfos.hpp b/vmime/net/smtp/SMTPServiceInfos.hpp
index 61f5aa8b..db6abc25 100644
--- a/vmime/net/smtp/SMTPServiceInfos.hpp
+++ b/vmime/net/smtp/SMTPServiceInfos.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -81,5 +86,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
#endif // VMIME_NET_SMTP_SMTPSERVICEINFOS_HPP_INCLUDED
diff --git a/vmime/net/smtp/SMTPTransport.hpp b/vmime/net/smtp/SMTPTransport.hpp
index 050fedde..a8b4558b 100644
--- a/vmime/net/smtp/SMTPTransport.hpp
+++ b/vmime/net/smtp/SMTPTransport.hpp
@@ -27,6 +27,10 @@
#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/transport.hpp"
#include "vmime/net/socket.hpp"
#include "vmime/net/timeoutHandler.hpp"
@@ -109,4 +113,6 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
#endif // VMIME_NET_SMTP_SMTPTRANSPORT_HPP_INCLUDED
diff --git a/vmime/net/socket.hpp b/vmime/net/socket.hpp
index b3946494..0fac6514 100644
--- a/vmime/net/socket.hpp
+++ b/vmime/net/socket.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_SOCKET_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/base.hpp"
#include "vmime/net/timeoutHandler.hpp"
@@ -138,4 +144,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_SOCKET_HPP_INCLUDED
diff --git a/vmime/net/store.hpp b/vmime/net/store.hpp
index 1c9ac1cb..f1f16bdb 100644
--- a/vmime/net/store.hpp
+++ b/vmime/net/store.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_STORE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/service.hpp"
#include "vmime/net/folder.hpp"
@@ -103,4 +109,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_STORE_HPP_INCLUDED
diff --git a/vmime/net/timeoutHandler.hpp b/vmime/net/timeoutHandler.hpp
index 6a206658..58d14b40 100644
--- a/vmime/net/timeoutHandler.hpp
+++ b/vmime/net/timeoutHandler.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_TIMEOUTHANDLER_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/types.hpp"
@@ -78,4 +84,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_TIMEOUTHANDLER_HPP_INCLUDED
diff --git a/vmime/net/tls/TLSSecuredConnectionInfos.hpp b/vmime/net/tls/TLSSecuredConnectionInfos.hpp
index d0e40870..eb94dbfc 100644
--- a/vmime/net/tls/TLSSecuredConnectionInfos.hpp
+++ b/vmime/net/tls/TLSSecuredConnectionInfos.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_TLSSECUREDCONNECTIONINFOS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
+
#include "vmime/net/securedConnectionInfos.hpp"
#include "vmime/security/cert/certificateChain.hpp"
@@ -72,5 +78,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
#endif // VMIME_NET_TLSSECUREDCONNECTIONINFOS_HPP_INCLUDED
diff --git a/vmime/net/tls/TLSSession.hpp b/vmime/net/tls/TLSSession.hpp
index e6bd64fd..75241c8c 100644
--- a/vmime/net/tls/TLSSession.hpp
+++ b/vmime/net/tls/TLSSession.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_TLS_TLSSESSION_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include "vmime/types.hpp"
#include "vmime/net/tls/TLSSocket.hpp"
@@ -91,5 +97,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
#endif // VMIME_NET_TLS_TLSSESSION_HPP_INCLUDED
diff --git a/vmime/net/tls/TLSSocket.hpp b/vmime/net/tls/TLSSocket.hpp
index 7c389702..e88d424c 100644
--- a/vmime/net/tls/TLSSocket.hpp
+++ b/vmime/net/tls/TLSSocket.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_TLS_TLSSOCKET_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include "vmime/exception.hpp"
#include "vmime/net/socket.hpp"
@@ -123,5 +129,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
#endif // VMIME_NET_TLS_TLSSOCKET_HPP_INCLUDED
diff --git a/vmime/net/transport.hpp b/vmime/net/transport.hpp
index 45dc5a51..f0b8e2dd 100644
--- a/vmime/net/transport.hpp
+++ b/vmime/net/transport.hpp
@@ -25,6 +25,12 @@
#define VMIME_NET_TRANSPORT_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/service.hpp"
#include "vmime/utility/stream.hpp"
@@ -78,4 +84,6 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_NET_TRANSPORT_HPP_INCLUDED
diff --git a/vmime/platform.hpp b/vmime/platform.hpp
index 02815542..2063268e 100644
--- a/vmime/platform.hpp
+++ b/vmime/platform.hpp
@@ -52,7 +52,7 @@ class platform
{
public:
- /** Handles all platform-dependent operations. It offers an interface to
+ /** Takes care of all platform-dependent operations. It offers an interface to
* access platform-dependent objects: sockets, date/time, file system, etc.
*/
@@ -135,13 +135,8 @@ public:
sm_handler = vmime::create <TYPE>();
}
- static ref <handler> getHandler()
- {
- if (!sm_handler)
- throw exceptions::no_platform_handler();
-
- return (sm_handler);
- }
+ static ref <handler> getDefaultHandler();
+ static ref <handler> getHandler();
private:
@@ -149,10 +144,6 @@ private:
};
-/** Compatibility with older versions of VMime (before 0.8.1). */
-typedef platform platformDependant;
-
-
} // vmime
diff --git a/vmime/platforms/posix/posixChildProcess.hpp b/vmime/platforms/posix/posixChildProcess.hpp
index c25aaca3..c9d34506 100644
--- a/vmime/platforms/posix/posixChildProcess.hpp
+++ b/vmime/platforms/posix/posixChildProcess.hpp
@@ -25,6 +25,12 @@
#define VMIME_PLATFORMS_POSIX_POSIXCHILDPROCESS_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/utility/childProcess.hpp"
#include <sys/types.h>
@@ -80,5 +86,7 @@ public:
} // vmime
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
#endif // VMIME_PLATFORMS_POSIX_POSIXCHILDPROCESS_HPP_INCLUDED
diff --git a/vmime/platforms/posix/posixFile.hpp b/vmime/platforms/posix/posixFile.hpp
index 704b7b00..654764d1 100644
--- a/vmime/platforms/posix/posixFile.hpp
+++ b/vmime/platforms/posix/posixFile.hpp
@@ -25,11 +25,14 @@
#define VMIME_PLATFORMS_POSIX_FILE_HPP_INCLUDED
-#include "vmime/utility/file.hpp"
-#include "vmime/utility/seekableInputStream.hpp"
+#include "vmime/config.hpp"
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
-#if VMIME_HAVE_FILESYSTEM_FEATURES
+
+#include "vmime/utility/file.hpp"
+#include "vmime/utility/seekableInputStream.hpp"
#include <dirent.h>
@@ -209,6 +212,6 @@ public:
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
#endif // VMIME_PLATFORMS_POSIX_FILE_HPP_INCLUDED
diff --git a/vmime/platforms/posix/posixHandler.hpp b/vmime/platforms/posix/posixHandler.hpp
index 8e572a21..80cfb650 100644
--- a/vmime/platforms/posix/posixHandler.hpp
+++ b/vmime/platforms/posix/posixHandler.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX
+
+
#include "vmime/platform.hpp"
#if VMIME_HAVE_MESSAGING_FEATURES
@@ -90,4 +95,6 @@ private:
} // vmime
+#endif // VMIME_PLATFORM_IS_POSIX
+
#endif // VMIME_PLATFORMS_POSIX_HANDLER_HPP_INCLUDED
diff --git a/vmime/platforms/posix/posixSocket.hpp b/vmime/platforms/posix/posixSocket.hpp
index 7e0c2d39..1332505b 100644
--- a/vmime/platforms/posix/posixSocket.hpp
+++ b/vmime/platforms/posix/posixSocket.hpp
@@ -25,10 +25,13 @@
#define VMIME_PLATFORMS_POSIX_SOCKET_HPP_INCLUDED
-#include "vmime/net/socket.hpp"
+#include "vmime/config.hpp"
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
-#if VMIME_HAVE_MESSAGING_FEATURES
+
+#include "vmime/net/socket.hpp"
namespace vmime {
@@ -83,6 +86,6 @@ public:
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
#endif // VMIME_PLATFORMS_POSIX_SOCKET_HPP_INCLUDED
diff --git a/vmime/platforms/windows/windowsFile.hpp b/vmime/platforms/windows/windowsFile.hpp
index f4170329..696803d6 100644
--- a/vmime/platforms/windows/windowsFile.hpp
+++ b/vmime/platforms/windows/windowsFile.hpp
@@ -25,13 +25,17 @@
#define VMIME_PLATFORMS_WINDOWS_FILE_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/utility/file.hpp"
#include "vmime/utility/seekableInputStream.hpp"
#include <windows.h>
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-
namespace vmime {
namespace platforms {
@@ -209,6 +213,6 @@ private:
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
#endif // VMIME_PLATFORMS_WINDOWS_FILE_HPP_INCLUDED
diff --git a/vmime/platforms/windows/windowsHandler.hpp b/vmime/platforms/windows/windowsHandler.hpp
index 53df3636..4f0150f8 100644
--- a/vmime/platforms/windows/windowsHandler.hpp
+++ b/vmime/platforms/windows/windowsHandler.hpp
@@ -26,6 +26,11 @@
#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS
+
+
#include "vmime/platform.hpp"
#if VMIME_HAVE_MESSAGING_FEATURES
@@ -88,4 +93,6 @@ private:
} // vmime
+#endif // VMIME_PLATFORM_IS_WINDOWS
+
#endif // VMIME_PLATFORMS_WINDOWS_HANDLER_HPP_INCLUDED
diff --git a/vmime/platforms/windows/windowsSocket.hpp b/vmime/platforms/windows/windowsSocket.hpp
index 1c89aeb5..c41d8bfe 100644
--- a/vmime/platforms/windows/windowsSocket.hpp
+++ b/vmime/platforms/windows/windowsSocket.hpp
@@ -25,11 +25,14 @@
#define VMIME_PLATFORMS_WINDOWS_SOCKET_HPP_INCLUDED
-#include <winsock2.h>
-#include "vmime/net/socket.hpp"
+#include "vmime/config.hpp"
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
-#if VMIME_HAVE_MESSAGING_FEATURES
+
+#include <winsock2.h>
+#include "vmime/net/socket.hpp"
namespace vmime {
@@ -82,6 +85,6 @@ public:
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
#endif // VMIME_PLATFORMS_WINDOWS_SOCKET_HPP_INCLUDED
diff --git a/vmime/security/authenticator.hpp b/vmime/security/authenticator.hpp
index a31fc5ef..4664e417 100644
--- a/vmime/security/authenticator.hpp
+++ b/vmime/security/authenticator.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_AUTHENTICATOR_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/types.hpp"
@@ -116,5 +122,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_SECURITY_AUTHENTICATOR_HPP_INCLUDED
diff --git a/vmime/security/cert/X509Certificate.hpp b/vmime/security/cert/X509Certificate.hpp
index b916cff5..48fc882c 100644
--- a/vmime/security/cert/X509Certificate.hpp
+++ b/vmime/security/cert/X509Certificate.hpp
@@ -145,7 +145,7 @@ public:
private:
- class X509CertificateInternalData* m_data;
+ struct X509CertificateInternalData* m_data;
};
diff --git a/vmime/security/defaultAuthenticator.hpp b/vmime/security/defaultAuthenticator.hpp
index dfb82983..f9e9a4bf 100644
--- a/vmime/security/defaultAuthenticator.hpp
+++ b/vmime/security/defaultAuthenticator.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_DEFAULTAUTHENTICATOR_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/security/authenticator.hpp"
@@ -61,5 +67,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
#endif // VMIME_SECURITY_DEFAULTAUTHENTICATOR_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLAuthenticator.hpp b/vmime/security/sasl/SASLAuthenticator.hpp
index daa090ac..1573dc20 100644
--- a/vmime/security/sasl/SASLAuthenticator.hpp
+++ b/vmime/security/sasl/SASLAuthenticator.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLAUTHENTICATOR_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
#include "vmime/security/authenticator.hpp"
@@ -84,5 +90,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLAUTHENTICATOR_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLContext.hpp b/vmime/security/sasl/SASLContext.hpp
index 7703ab1d..acdb8b5a 100644
--- a/vmime/security/sasl/SASLContext.hpp
+++ b/vmime/security/sasl/SASLContext.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLCONTEXT_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
#include "vmime/security/sasl/SASLSession.hpp"
@@ -116,5 +122,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLCONTEXT_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLMechanism.hpp b/vmime/security/sasl/SASLMechanism.hpp
index dbb7cd28..678a3030 100644
--- a/vmime/security/sasl/SASLMechanism.hpp
+++ b/vmime/security/sasl/SASLMechanism.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLMECHANISM_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
@@ -119,5 +125,7 @@ public:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLMECHANISM_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLMechanismFactory.hpp b/vmime/security/sasl/SASLMechanismFactory.hpp
index 7b860613..064637a6 100644
--- a/vmime/security/sasl/SASLMechanismFactory.hpp
+++ b/vmime/security/sasl/SASLMechanismFactory.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLMECHANISMFACTORY_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
#include "vmime/base.hpp"
@@ -131,5 +137,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLMECHANISMFACTORY_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLSession.hpp b/vmime/security/sasl/SASLSession.hpp
index 79acfa92..63645b18 100644
--- a/vmime/security/sasl/SASLSession.hpp
+++ b/vmime/security/sasl/SASLSession.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLSESSION_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
#include "vmime/security/sasl/SASLAuthenticator.hpp"
@@ -150,5 +156,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLSESSION_HPP_INCLUDED
diff --git a/vmime/security/sasl/SASLSocket.hpp b/vmime/security/sasl/SASLSocket.hpp
index 03483315..f05ed424 100644
--- a/vmime/security/sasl/SASLSocket.hpp
+++ b/vmime/security/sasl/SASLSocket.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_SASLSOCKET_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/types.hpp"
#include "vmime/net/socket.hpp"
@@ -78,5 +84,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_SASLSOCKET_HPP_INCLUDED
diff --git a/vmime/security/sasl/builtinSASLMechanism.hpp b/vmime/security/sasl/builtinSASLMechanism.hpp
index ac7421cf..aa6c360c 100644
--- a/vmime/security/sasl/builtinSASLMechanism.hpp
+++ b/vmime/security/sasl/builtinSASLMechanism.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_BUILTINSASLMECHANISM_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/SASLMechanism.hpp"
@@ -81,5 +87,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_BUILTINSASLMECHANISM_HPP_INCLUDED
diff --git a/vmime/security/sasl/defaultSASLAuthenticator.hpp b/vmime/security/sasl/defaultSASLAuthenticator.hpp
index 7595de79..aeb9ce47 100644
--- a/vmime/security/sasl/defaultSASLAuthenticator.hpp
+++ b/vmime/security/sasl/defaultSASLAuthenticator.hpp
@@ -25,6 +25,12 @@
#define VMIME_SECURITY_SASL_DEFAULTSASLAUTHENTICATOR_HPP_INCLUDED
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/SASLAuthenticator.hpp"
#include "vmime/security/defaultAuthenticator.hpp"
@@ -78,5 +84,7 @@ private:
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
#endif // VMIME_SECURITY_SASL_DEFAULTSASLAUTHENTICATOR_HPP_INCLUDED