summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-08-21 23:44:06 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-08-22 15:23:37 +0100
commitfbbd45ff5ade30d38ca60ea5aeccc305501c9174 (patch)
tree17be713e07ab77592e8ea44a670ec24da5a6c47f /src
parent6acd9fcf8454b0a18065bcd6ee865c5ddc82e44d (diff)
Add automatic macros for compile-time feature options
Diffstat (limited to 'src')
-rw-r--r--src/src/readconf.c231
1 files changed, 231 insertions, 0 deletions
diff --git a/src/src/readconf.c b/src/src/readconf.c
index c145c7749..646932412 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -3003,6 +3003,234 @@ return status == 0;
+/*************************************************/
+/* Create compile-time feature macros */
+static void
+readconf_features(void)
+{
+/* Probably we could work out a static initialiser for wherever
+macros are stored, but this will do for now. Some names are awkward
+due to conflicts with other common macros. */
+
+#ifdef SUPPORT_CRYPTEQ
+ read_macro_assignment("_HAVE_CRYPTEQ=y");
+#endif
+#if HAVE_ICONV
+ read_macro_assignment("_HAVE_ICONV=y");
+#endif
+#if HAVE_IPV6
+ read_macro_assignment("_HAVE_IPV6=y");
+#endif
+#ifdef HAVE_SETCLASSRESOURCES
+ read_macro_assignment("_HAVE_SETCLASSRESOURCES=y");
+#endif
+#ifdef SUPPORT_PAM
+ read_macro_assignment("_HAVE_PAM=y");
+#endif
+#ifdef EXIM_PERL
+ read_macro_assignment("_HAVE_PERL=y");
+#endif
+#ifdef EXPAND_DLFUNC
+ read_macro_assignment("_HAVE_DLFUNC=y");
+#endif
+#ifdef USE_TCP_WRAPPERS
+ read_macro_assignment("_HAVE_TCPWRAPPERS=y");
+#endif
+#ifdef SUPPORT_TLS
+ read_macro_assignment("_HAVE_TLS=y");
+# ifdef USE_GNUTLS
+ read_macro_assignment("_HAVE_GNUTLS=y");
+# else
+ read_macro_assignment("_HAVE_OPENSSL=y");
+# endif
+#endif
+#ifdef SUPPORT_TRANSLATE_IP_ADDRESS
+ read_macro_assignment("_HAVE_TRANSLATE_IP_ADDRESS=y");
+#endif
+#ifdef SUPPORT_MOVE_FROZEN_MESSAGES
+ read_macro_assignment("_HAVE_MOVE_FROZEN_MESSAGES=y");
+#endif
+#ifdef WITH_CONTENT_SCAN
+ read_macro_assignment("_HAVE_CONTENT_SCANNING=y");
+#endif
+#ifndef DISABLE_DKIM
+ read_macro_assignment("_HAVE_DKIM=y");
+#endif
+#ifndef DISABLE_DNSSEC
+ read_macro_assignment("_HAVE_DNSSEC=y");
+#endif
+#ifndef DISABLE_EVENT
+ read_macro_assignment("_HAVE_Event=y");
+#endif
+#ifdef SUPPORT_I18N
+ read_macro_assignment("_HAVE_I18N=y");
+#endif
+#ifndef DISABLE_OCSP
+ read_macro_assignment("_HAVE_OCSP=y");
+#endif
+#ifndef DISABLE_PRDR
+ read_macro_assignment("_HAVE_PRDR=y");
+#endif
+#ifdef SUPPORT_PROXY
+ read_macro_assignment("_HAVE_PROXY=y");
+#endif
+#ifdef SUPPORT_SOCKS
+ read_macro_assignment("_HAVE_SOCKS=y");
+#endif
+#ifdef EXPERIMENTAL_LMDB
+ read_macro_assignment("_HAVE_LMDB=y");
+#endif
+#ifdef EXPERIMENTAL_SPF
+ read_macro_assignment("_HAVE_SPF=y");
+#endif
+#ifdef EXPERIMENTAL_SRS
+ read_macro_assignment("_HAVE_SRS=y");
+#endif
+#ifdef EXPERIMENTAL_BRIGHTMAIL
+ read_macro_assignment("_HAVE_BRIGHTMAIL=y");
+#endif
+#ifdef EXPERIMENTAL_DANE
+ read_macro_assignment("_HAVE_DANE=y");
+#endif
+#ifdef EXPERIMENTAL_DCC
+ read_macro_assignment("_HAVE_DCC=y");
+#endif
+#ifdef EXPERIMENTAL_DMARC
+ read_macro_assignment("_HAVE_DMARC=y");
+#endif
+#ifdef EXPERIMENTAL_DSN_INFO
+ read_macro_assignment("_HAVE_DSN_INFO=y");
+#endif
+
+#ifdef LOOKUP_LSEARCH
+ read_macro_assignment("_HAVE_LKUP_LSEARCH=y");
+#endif
+#ifdef LOOKUP_CDB
+ read_macro_assignment("_HAVE_LKUP_CDB=y");
+#endif
+#ifdef LOOKUP_DBM
+ read_macro_assignment("_HAVE_LKUP_DBM=y");
+#endif
+#ifdef LOOKUP_DNSDB
+ read_macro_assignment("_HAVE_LKUP_DNSDB=y");
+#endif
+#ifdef LOOKUP_DSEARCH
+ read_macro_assignment("_HAVE_LKUP_DSEARCH=y");
+#endif
+#ifdef LOOKUP_IBASE
+ read_macro_assignment("_HAVE_LKUP_IBASE=y");
+#endif
+#ifdef LOOKUP_LDAP
+ read_macro_assignment("_HAVE_LKUP_LDAP=y");
+#endif
+#ifdef EXPERIMENTAL_LMDB
+ read_macro_assignment("_HAVE_LKUP_LMDB=y");
+#endif
+#ifdef LOOKUP_MYSQL
+ read_macro_assignment("_HAVE_LKUP_MYSQL=y");
+#endif
+#ifdef LOOKUP_NIS
+ read_macro_assignment("_HAVE_LKUP_NIS=y");
+#endif
+#ifdef LOOKUP_NISPLUS
+ read_macro_assignment("_HAVE_LKUP_NISPLUS=y");
+#endif
+#ifdef LOOKUP_ORACLE
+ read_macro_assignment("_HAVE_LKUP_ORACLE=y");
+#endif
+#ifdef LOOKUP_PASSWD
+ read_macro_assignment("_HAVE_LKUP_PASSWD=y");
+#endif
+#ifdef LOOKUP_PGSQL
+ read_macro_assignment("_HAVE_LKUP_PGSQL=y");
+#endif
+#ifdef LOOKUP_REDIS
+ read_macro_assignment("_HAVE_LKUP_REDIS=y");
+#endif
+#ifdef LOOKUP_SQLITE
+ read_macro_assignment("_HAVE_LKUP_SQLITE=y");
+#endif
+#ifdef LOOKUP_TESTDB
+ read_macro_assignment("_HAVE_LKUP_TESTDB=y");
+#endif
+#ifdef LOOKUP_WHOSON
+ read_macro_assignment("_HAVE_LKUP_WHOSON=y");
+#endif
+
+#ifdef AUTH_CRAM_MD5
+ read_macro_assignment("_HAVE_AUTH_CRAM_MD5=y");
+#endif
+#ifdef AUTH_CYRUS_SASL
+ read_macro_assignment("_HAVE_AUTH_CYRUS_SASL=y");
+#endif
+#ifdef AUTH_DOVECOT
+ read_macro_assignment("_HAVE_AUTH_DOVECOT=y");
+#endif
+#ifdef AUTH_GSASL
+ read_macro_assignment("_HAVE_AUTH_GSASL=y");
+#endif
+#ifdef AUTH_HEIMDAL_GSSAPI
+ read_macro_assignment("_HAVE_AUTH_HEIMDAL_GSSAPI=y");
+#endif
+#ifdef AUTH_PLAINTEXT
+ read_macro_assignment("_HAVE_AUTH_PLAINTEXT=y");
+#endif
+#ifdef AUTH_SPA
+ read_macro_assignment("_HAVE_AUTH_SPA=y");
+#endif
+#ifdef AUTH_TLS
+ read_macro_assignment("_HAVE_AUTH_TLS=y");
+#endif
+
+#ifdef ROUTER_ACCEPT
+ read_macro_assignment("_HAVE_RTR_ACCEPT=y");
+#endif
+#ifdef ROUTER_DNSLOOKUP
+ read_macro_assignment("_HAVE_RTR_DNSLOOKUP=y");
+#endif
+#ifdef ROUTER_IPLITERAL
+ read_macro_assignment("_HAVE_RTR_IPLITERAL=y");
+#endif
+#ifdef ROUTER_IPLOOKUP
+ read_macro_assignment("_HAVE_RTR_IPLOOKUP=y");
+#endif
+#ifdef ROUTER_MANUALROUTE
+ read_macro_assignment("_HAVE_RTR_MANUALROUTE=y");
+#endif
+#ifdef ROUTER_QUERYPROGRAM
+ read_macro_assignment("_HAVE_RTR_QUERYPROGRAM=y");
+#endif
+#ifdef ROUTER_REDIRECT
+ read_macro_assignment("_HAVE_RTR_REDRCT=y");
+#endif
+
+#ifdef TRANSPORT_APPENDFILE
+ read_macro_assignment("_HAVE_TPT_APPENDFILE=y");
+# ifdef SUPPORT_MAILDIR
+ read_macro_assignment("_HAVE_TPT_APPEND_MAILDR=y");
+# endif
+# ifdef SUPPORT_MAILSTORE
+ read_macro_assignment("_HAVE_TPT_APPEND_MAILSTORE=y");
+# endif
+# ifdef SUPPORT_MBX
+ read_macro_assignment("_HAVE_TPT_APPEND_MBX=y");
+# endif
+#endif
+#ifdef TRANSPORT_AUTOREPLY
+ read_macro_assignment("_HAVE_TPT_AUTOREPLY=y");
+#endif
+#ifdef TRANSPORT_LMTP
+ read_macro_assignment("_HAVE_TPT_LMTP=y");
+#endif
+#ifdef TRANSPORT_PIPE
+ read_macro_assignment("_HAVE_TPT_PIPE=y");
+#endif
+#ifdef TRANSPORT_SMTP
+ read_macro_assignment("_HAVE_TPT_SMTP=y");
+#endif
+}
+
+
/*************************************************
* Read main configuration options *
*************************************************/
@@ -3039,6 +3267,9 @@ struct stat statbuf;
uschar *s, *filename;
const uschar *list = config_main_filelist;
+/* First create compile-time feature macros */
+readconf_features();
+
/* Loop through the possible file names */
while((filename = string_nextinlist(&list, &sep, big_buffer, big_buffer_size))