diff --git a/ChangeLog b/ChangeLog index 433b08a6..8463027d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ VERSION 0.6.4cvs in the same packet as the request. This caused problems with some servers (thanks to Donald Dade). + * SConstruct: modified 'msvc' target to generate automatically the + config file 'config.hpp.msvc'. + 2005-03-27 Stefan Uhrig * Added Windows platform handlers. diff --git a/SConstruct b/SConstruct index 61bf3de9..cfb06174 100644 --- a/SConstruct +++ b/SConstruct @@ -700,6 +700,11 @@ if env['with_messaging'] == 'yes': for proto in messaging_protocols: config_hpp.write('#define VMIME_BUILTIN_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') else: config_hpp.write('#define VMIME_HAVE_MESSAGING_FEATURES 0\n') @@ -710,6 +715,10 @@ config_hpp.write('#define VMIME_BUILTIN_PLATFORMS "' + for platform in platforms: config_hpp.write('#define VMIME_BUILTIN_PLATFORM_' + 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(""" #endif // VMIME_CONFIG_HPP_INCLUDED @@ -1397,27 +1406,46 @@ VMIME_BUILTIN_MESSAGING_PROTOS='' 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') + configure_in.write('fi\n\n') configure_in.write(""" # ** platform handlers VMIME_BUILTIN_PLATFORMS='' +VMIME_DETECT_PLATFORM='' + +case "x${target_os}" in +win* | mingw* | cygwin*) + VMIME_DETECT_PLATFORM='windows' + ;; +x*) + # Default is POSIX + VMIME_DETECT_PLATFORM='posix' + ;; +esac """) + 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(" [ --enable-platform-" + p + " Compile built-in platform handler for '" + p + "' " - + " (default: enabled)],\n") + + " (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(' [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') @@ -1426,7 +1454,7 @@ VMIME_BUILTIN_PLATFORMS='' 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') + configure_in.write('fi\n\n') configure_in.write(""" @@ -1576,7 +1604,7 @@ typedef unsigned ${VMIME_TYPE_INT32} vmime_uint32; configure_in.write('// -- Built-in platform handlers\n') configure_in.write('#define VMIME_BUILTIN_PLATFORMS \\"$VMIME_BUILTIN_PLATFORMS\\"\n') - for p in platforms: + for p in libvmime_platforms_sources: p = string.upper(p) configure_in.write('#define VMIME_BUILTIN_PLATFORM_' + p + " $VMIME_BUILTIN_PLATFORM_" + p + " \n") @@ -1815,8 +1843,85 @@ EndGlobal """) 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 +// -- Wide characters support +#define VMIME_WIDE_CHAR_SUPPORT 0 +#define VMIME_INLINE_TEMPLATE_SPECIALIZATION 1 +#define VMIME_NO_MULTIPLE_INHERITANCE 1 +// -- File-system support +#define VMIME_HAVE_FILESYSTEM_FEATURES 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 +""") + + 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 diff --git a/config.hpp.msvc b/config.hpp.msvc deleted file mode 100644 index 09678355..00000000 --- a/config.hpp.msvc +++ /dev/null @@ -1,60 +0,0 @@ - -// -// This file was automatically generated by configuration script. -// - -#ifndef VMIME_CONFIG_HPP_INCLUDED -#define VMIME_CONFIG_HPP_INCLUDED - - -// Name of package -#define VMIME_PACKAGE "libvmime" - -// Version number of package -#define VMIME_VERSION "0.6.4" -#define VMIME_API "6:4:6" - -// Target OS and architecture -#define VMIME_TARGET_ARCH "i686" -#define VMIME_TARGET_OS "msvc" - -// Set to 1 if debugging should be activated -#define VMIME_DEBUG 0 - -// 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 -// -- Wide characters support -#define VMIME_WIDE_CHAR_SUPPORT 0 -#define VMIME_INLINE_TEMPLATE_SPECIALIZATION 1 -#define VMIME_NO_MULTIPLE_INHERITANCE 1 -// -- File-system support -#define VMIME_HAVE_FILESYSTEM_FEATURES 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 - - -#endif // VMIME_CONFIG_HPP_INCLUDED -