TLS: move from SUPPORT_TLS to DISABLE_TLS macro for the build
[exim.git] / src / src / buildconfig.c
index 310798fdd30e897f055e596be02db7de44c66fd6..71cf97b18d34e6821022890ffae3c666a4bc94f7 100644 (file)
@@ -36,6 +36,8 @@ normally called independently. */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/time.h>
+#include <poll.h>
 #include <pwd.h>
 #include <grp.h>
 
@@ -751,15 +753,15 @@ else if (isgroup)
     continue;
     }
 
-  /* DISABLE_DKIM is special; must be forced if no SUPPORT_TLS */
+  /* DISABLE_DKIM is special; must be forced if DISABLE_TLS */
   if (strcmp(name, "DISABLE_DKIM") == 0)
     {
     char *d_dkim = getenv("DISABLE_DKIM");
-    char *tls = getenv("SUPPORT_TLS");
+    char *notls = getenv("DISABLE_TLS");
 
     if (d_dkim)
       fprintf(new, "#define DISABLE_DKIM          yes\n");
-    else if (!tls)
+    else if (notls)
       fprintf(new, "#define DISABLE_DKIM          yes /* forced by lack of TLS */\n");
     else
       fprintf(new, "/* DISABLE_DKIM not set */\n");
@@ -951,9 +953,25 @@ else if (isgroup)
 defined. */
 
 if (have_auth)
-  {
   if (!support_crypteq) fprintf(new, "/* Force SUPPORT_CRYPTEQ for AUTH */\n"
     "#define SUPPORT_CRYPTEQ\n");
+
+/* Check poll() for timer functionality.
+Some OS' have released with it broken. */
+
+  {
+  struct timeval before, after;
+  size_t us;
+
+  gettimeofday(&before, NULL);
+  (void) poll(NULL, 0, 500);
+  gettimeofday(&after, NULL);
+
+  us = (after.tv_sec - before.tv_sec) * 1000000 +
+    (after.tv_usec - before.tv_usec);
+
+  if (us < 400000)
+    fprintf(new, "#define NO_POLL_H\n");
   }
 
 /* End off */