1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2018 */
6 /* See the file NOTICE for conditions of use and distribution. */
9 /*************************************************
10 * Build configuration header for Exim *
11 *************************************************/
13 /* This auxiliary program builds the file config.h by the following
16 First, it determines the size of off_t and time_t variables, and generates
17 macro code to define OFF_T_FMT and TIME_T_FMT as suitable formats, if they are
18 not already defined in the system-specific header file.
20 Then it reads Makefile, looking for certain OS-specific definitions which it
21 uses to define some specific macros. Finally, it reads the defaults file
24 The defaults file contains normal C #define statements for various macros; if
25 the name of a macro is found in the environment, the environment value replaces
26 the default. If the default #define does not contain any value, then that macro
27 is not copied to the created file unless there is some value in the
30 This program is compiled and run as part of the Make process and is not
31 normally called independently. */
38 #include <sys/types.h>
54 static const char *db_opts[] = { "", "USE_DB", "USE_GDBM", "USE_TDB", "USE_NDBM" };
56 static int have_ipv6 = 0;
57 static int have_iconv = 0;
59 static char errno_quota[256];
60 static char ostype[256];
63 /* If any entry is an initial substring of another, the longer one must
66 static have_item have_list[] = {
67 { "HAVE_IPV6", &have_ipv6 },
68 { "HAVE_ICONV", &have_iconv },
72 static save_item save_list[] = {
73 { "ERRNO_QUOTA", errno_quota },
80 /* Subroutine to check a string for precisely one instance of "%s". If not,
84 check_percent_ess(char *value, char *name)
87 char *p = strstr(value, "%s");
88 if (p != NULL) OK = strstr(p+2, "%s") == NULL;
91 printf("\n*** \"%s\" (%s) must contain precisely one occurrence of\n"
92 "*** \"%%s\". Please review your build-time configuration.\n\n/", value,
102 main(int argc, char **argv)
104 off_t test_off_t = 0;
105 time_t test_time_t = 0;
107 #if ! (__STDC_VERSION__ >= 199901L)
108 size_t test_size_t = 0;
109 ssize_t test_ssize_t = 0;
110 unsigned long test_ulong_t = 0L;
111 unsigned int test_uint_t = 0;
113 long test_long_t = 0;
114 long long test_longlong_t = 0;
118 int last_initial = 'A';
121 int in_local_makefile = 0;
122 int use_which_db = 0;
123 int use_which_db_in_local_makefile = 0;
124 int support_crypteq = 0;
129 printf("*** Buildconfig: called with incorrect arguments\n");
133 new = fopen("config.h", "wb");
136 printf("*** Buildconfig: failed to open config.h for output\n");
140 printf("Building configuration file config.h\n");
142 fprintf(new, "/*************************************************\n");
143 fprintf(new, "* Configuration header for Exim *\n");
144 fprintf(new, "*************************************************/\n\n");
146 fprintf(new, "/* This file was automatically generated from Makefile and "
147 "config.h.defaults,\n");
148 fprintf(new, "using values specified in the configuration file Local/Makefile.\n");
149 fprintf(new, "Do not edit it. Instead, edit Local/Makefile and "
150 "rerun make. */\n\n");
152 /* First, deal with the printing format for off_t variables. We assume that if
153 the size of off_t is greater than 4, "%lld" will be available as a format for
154 printing long long variables, and there will be support for the long long type.
155 This assumption is known to be OK for the common operating systems. */
157 fprintf(new, "#ifndef OFF_T_FMT\n");
158 if (sizeof(test_off_t) > sizeof(test_long_t))
159 fprintf(new, "# define OFF_T_FMT \"%%lld\"\n");
161 fprintf(new, "# define OFF_T_FMT \"%%ld\"\n");
162 fprintf(new, "#endif\n\n");
164 fprintf(new, "#ifndef LONGLONG_T\n");
165 if (sizeof(test_longlong_t) > sizeof(test_long_t))
166 fprintf(new, "# define LONGLONG_T long long int\n");
168 fprintf(new, "# define LONGLONG_T long int\n");
169 fprintf(new, "#endif\n\n");
171 /* Now do the same thing for time_t variables. If the length is greater than
172 4, we want to assume long long support (even if off_t was less than 4). If the
173 length is 4 or less, we can leave LONGLONG_T to whatever was defined above for
176 fprintf(new, "#ifndef TIME_T_FMT\n");
177 if (sizeof(test_time_t) > sizeof(test_long_t))
179 fprintf(new, "# define TIME_T_FMT \"%%lld\"\n");
180 fprintf(new, "# undef LONGLONG_T\n");
181 fprintf(new, "# define LONGLONG_T long long int\n");
184 fprintf(new, "# define TIME_T_FMT \"%%ld\"\n");
185 fprintf(new, "#endif\n\n");
187 fprintf(new, "#ifndef INO_T_FMT\n");
188 if (sizeof(test_ino_t) > sizeof(test_long_t))
189 fprintf(new, "# define INO_T_FMT \"%%llu\"\n");
191 fprintf(new, "# define INO_T_FMT \"%%lu\"\n");
192 fprintf(new, "#endif\n\n");
194 fprintf(new, "#ifndef PID_T_FMT\n");
195 fprintf(new, "# define PID_T_FMT \"%%lu\"\n");
196 fprintf(new, "#endif\n\n");
198 /* And for sizeof() results, size_t, which should with C99 be just %zu, deal
199 with C99 not being ubiquitous yet. Unfortunately. Assume ssize_t is same
200 size as size_t on C99; if someone comes up with a version where it's not, fix
203 #if __STDC_VERSION__ >= 199901L
204 fprintf(new, "#define SIZE_T_FMT \"%%zu\"\n");
205 fprintf(new, "#define SSIZE_T_FMT \"%%zd\"\n");
207 if (sizeof(test_size_t) > sizeof (test_ulong_t))
208 fprintf(new, "#define SIZE_T_FMT \"%%llu\"\n");
209 else if (sizeof(test_size_t) > sizeof (test_uint_t))
210 fprintf(new, "#define SIZE_T_FMT \"%%lu\"\n");
212 fprintf(new, "#define SIZE_T_FMT \"%%u\"\n");
214 if (sizeof(test_ssize_t) > sizeof(test_long_t))
215 fprintf(new, "#define SSIZE_T_FMT \"%%lld\"\n");
216 else if (sizeof(test_ssize_t) > sizeof(test_int_t))
217 fprintf(new, "#define SSIZE_T_FMT \"%%ld\"\n");
219 fprintf(new, "#define SSIZE_T_FMT \"%%d\"\n");
222 /* Now search the makefile for certain settings */
224 if (!(base = fopen("Makefile", "rb")))
226 printf("*** Buildconfig: failed to open Makefile\n");
231 errno_quota[0] = 0; /* no over-riding value set */
232 ostype[0] = 0; /* just in case */
235 while (fgets(buffer, sizeof(buffer), base) != NULL)
240 char *p = buffer + (int)strlen(buffer);
242 while (p > buffer && isspace((unsigned char)p[-1])) p--;
245 while (isspace((unsigned char)*p)) p++;
247 /* Notice when we hit the user's makefile */
249 if (strcmp(p, "# From Local/Makefile") == 0)
251 in_local_makefile = 1;
255 /* Remember the last DB option setting. If we hit two in the user's
256 Makefile, complain. */
258 for (i = 1; i < sizeof(db_opts)/sizeof(char *); i++)
260 int len = (int)strlen(db_opts[i]);
261 if (strncmp(p, db_opts[i], len) == 0 && (p[len] == ' ' || p[len] == '='))
263 if (in_local_makefile)
265 if (use_which_db_in_local_makefile)
267 printf("*** Only one of USE_DB, USE_GDBM, or USE_TDB should be "
268 "defined in Local/Makefile\n");
271 use_which_db_in_local_makefile = 1;
277 if (i < sizeof(db_opts)/sizeof(char *)) continue;
279 /* Items where we just save a boolean */
281 for (h = have_list; h->name != NULL; h++)
283 int len = (int)strlen(h->name);
284 if (strncmp(p, h->name, len) == 0)
287 while (isspace((unsigned char)*p)) p++;
290 printf("*** Buildconfig: syntax error in Makefile line %d\n", linecount);
293 while (isspace((unsigned char)*p)) p++;
294 if (strcmp(p, "YES") == 0 || strcmp(p, "yes") == 0) *(h->flag) = 1;
295 else *(h->flag) = 0; /* Must reset in case multiple instances */
300 if (h->name != NULL) continue;
302 /* Items where we save the complete string */
304 for (s = save_list; s->name != NULL; s++)
306 int len = (int)strlen(s->name);
307 if (strncmp(p, s->name, len) == 0)
310 while (isspace((unsigned char)*p)) p++;
313 printf("*** Buildconfig: syntax error in Makefile line %d\n", linecount);
316 while (isspace((unsigned char)*p)) p++;
322 fprintf(new, "#define HAVE_IPV6 %s\n",
323 have_ipv6? "TRUE" : "FALSE");
325 fprintf(new, "#define HAVE_ICONV %s\n",
326 have_iconv? "TRUE" : "FALSE");
328 if (errno_quota[0] != 0)
329 fprintf(new, "\n#define ERRNO_QUOTA %s\n", errno_quota);
331 if (strcmp(cc, "gcc") == 0 &&
332 (strstr(ostype, "IRIX") != NULL || strstr(ostype, "AIX") != NULL))
334 fprintf(new, "\n/* This switch includes the code to fix the inet_ntoa() */");
335 fprintf(new, "\n/* bug when using gcc on an IRIX or AIX system. */");
336 fprintf(new, "\n#define USE_INET_NTOA_FIX");
343 /* Now handle the macros listed in the defaults */
345 base = fopen("../src/config.h.defaults", "rb");
348 printf("*** Buildconfig: failed to open ../src/config.h.defaults\n");
353 while (fgets(buffer, sizeof(buffer), base) != NULL)
361 while (*p == ' ' || *p == '\t') p++;
363 if (strncmp(p, "#ifdef ", 7) == 0
364 || strncmp(p, "#ifndef ", 8) == 0
365 || strncmp(p, "#if ", 4) == 0
366 || strncmp(p, "#endif", 6) == 0
373 if (strncmp(p, "#define ", 8) != 0) continue;
376 while (*p == ' ' || *p == '\t') p++;
378 if (*p < last_initial) fprintf(new, "\n");
381 while (*p && (isalnum((unsigned char)*p) || *p == '_')) *q++ = *p++;
384 /* USE_DB, USE_GDBM, and USE_TDB are special cases. We want to have only
385 one of them set. The scan of the Makefile has saved which was the last one
388 for (i = 1; i < sizeof(db_opts)/sizeof(char *); i++)
389 if (strcmp(name, db_opts[i]) == 0)
391 if (use_which_db == i)
392 fprintf(new, "#define %s %.*syes\n", db_opts[i],
393 21 - (int)strlen(db_opts[i]), " ");
395 fprintf(new, "/* %s not set */\n", name);
398 if (i < sizeof(db_opts)/sizeof(char *)) continue;
400 /* EXIM_USER is a special case. We look in the environment for EXIM_USER or
401 EXIM_UID (the latter for backward compatibility with Exim 3). If the value is
402 not numeric, we look up the user, and default the GID if found. Otherwise,
403 EXIM_GROUP or EXIM_GID must be in the environment. */
405 if (strcmp(name, "EXIM_UID") == 0)
411 char *username = NULL;
412 char *groupname = NULL;
414 char *user = getenv("EXIM_USER");
415 char *group = getenv("EXIM_GROUP");
417 if (user == NULL) user = getenv("EXIM_UID");
418 if (group == NULL) group = getenv("EXIM_GID");
422 printf("\n*** EXIM_USER has not been defined in any of the Makefiles in "
423 "the\n \"Local\" directory. Please review your build-time "
424 "configuration.\n\n");
428 while (isspace((unsigned char)(*user))) user++;
431 printf("\n*** EXIM_USER is defined as an empty string in one of the "
432 "files\n in the \"Local\" directory. Please review your build-time"
433 "\n configuration.\n\n");
437 for (s = user; *s != 0; s++)
439 if (iscntrl((unsigned char)(*s)))
441 printf("\n*** EXIM_USER contains the control character 0x%02X in one "
442 "of the files\n in the \"Local\" directory. Please review your "
443 "build-time\n configuration.\n\n", *s);
448 /* Numeric uid given */
450 if (user[strspn(user, "0123456789")] == 0)
452 uid = (uid_t)atoi(user);
455 /* User name given. Normally, we look up the uid right away. However,
456 people building binary distributions sometimes want to retain the name till
457 runtime. This is supported if the name begins "ref:". */
459 else if (strncmp(user, "ref:", 4) == 0)
462 while (isspace(*user)) user++;
470 struct passwd *pw = getpwnam(user);
473 printf("\n*** User \"%s\" (specified in one of the Makefiles) does not "
474 "exist.\n Please review your build-time configuration.\n\n",
484 /* Use explicit group if set. */
488 while (isspace((unsigned char)(*group))) group++;
491 printf("\n*** EXIM_GROUP is defined as an empty string in one of "
492 "the files in the\n \"Local\" directory. ");
495 printf("If you want the Exim group to be taken from the\n "
496 "password data for the Exim user, just remove the EXIM_GROUP "
497 "setting.\n Otherwise, p");
499 else printf("EXIM_USER is defined numerically, so there is no"
500 "\n default for EXIM_GROUP and you must set it explicitly.\n P");
501 printf("lease review your build-time configuration.\n\n");
505 for (s = group; *s != 0; s++)
507 if (iscntrl((unsigned char)(*s)))
509 printf("\n*** EXIM_GROUP contains the control character 0x%02X in one "
510 "of the files\n in the \"Local\" directory. Please review your "
511 "build-time\n configuration.\n\n", *s);
516 /* Group name given. This may be by reference or to be looked up now,
519 if (strncmp(group, "ref:", 4) == 0)
522 while (isspace(*group)) group++;
526 else if (username != NULL)
531 else if (group[strspn(group, "0123456789")] == 0)
533 gid = (gid_t)atoi(group);
538 struct group *gr = getgrnam(group);
541 printf("\n*** Group \"%s\" (specified in one of the Makefiles) does "
542 "not exist.\n Please review your build-time configuration.\n\n",
550 /* Else trouble unless found in passwd file with user */
554 printf("\n*** No group set for Exim. Please review your build-time "
555 "configuration.\n\n");
559 /* security sanity checks
560 if ref: is being used, we can never be sure, but we can take reasonable
561 steps to filter out the most obvious ones. */
563 if ((!uid_not_set && uid == 0) ||
564 ((username != NULL) && (
565 (strcmp(username, "root") == 0) ||
566 (strcmp(username, "toor") == 0) )))
568 printf("\n*** Exim's internal user must not be root.\n\n");
572 /* Output user and group names or uid/gid. When names are set, uid/gid
573 are set to zero but will be replaced at runtime. */
575 if (username != NULL)
576 fprintf(new, "#define EXIM_USERNAME \"%s\"\n", username);
577 if (groupname != NULL)
578 fprintf(new, "#define EXIM_GROUPNAME \"%s\"\n", groupname);
580 fprintf(new, "#define EXIM_UID %d\n", (int)uid);
581 fprintf(new, "#define EXIM_GID %d\n", (int)gid);
585 /* CONFIGURE_OWNER and CONFIGURE_GROUP are special cases. We look in the
586 environment for first. If the value is not numeric, we look up the user or
587 group. A lot of this code is similar to that for EXIM_USER, but it's easier
588 to keep it separate. */
590 if (strcmp(name, "CONFIGURE_OWNER") == 0 ||
591 strcmp(name, "CONFIGURE_GROUP") == 0)
593 int isgroup = name[10] == 'G';
597 const char *username = NULL;
598 const char *user = getenv(name);
600 if (user == NULL) user = "";
601 while (isspace((unsigned char)(*user))) user++;
604 fprintf(new, "/* %s not set */\n", name);
608 for (s = user; *s != 0; s++)
610 if (iscntrl((unsigned char)(*s)))
612 printf("\n*** %s contains the control character 0x%02X in "
613 "one of the files\n in the \"Local\" directory. Please review "
614 "your build-time\n configuration.\n\n", name, *s);
619 /* Numeric uid given */
621 if (user[strspn(user, "0123456789")] == 0)
624 gid = (gid_t)atoi(user);
626 uid = (uid_t)atoi(user);
629 /* Name given. Normally, we look up the uid or gid right away. However,
630 people building binary distributions sometimes want to retain the name till
631 runtime. This is supported if the name begins "ref:". */
633 else if (strncmp(user, "ref:", 4) == 0)
636 while (isspace(*user)) user++;
641 struct group *gr = getgrnam(user);
644 printf("\n*** Group \"%s\" (specified in one of the Makefiles) does not "
645 "exist.\n Please review your build-time configuration.\n\n",
654 struct passwd *pw = getpwnam(user);
657 printf("\n*** User \"%s\" (specified in one of the Makefiles) does not "
658 "exist.\n Please review your build-time configuration.\n\n",
665 /* Output user and group names or uid/gid. When names are set, uid/gid
666 are set to zero but will be replaced at runtime. */
668 if (username != NULL)
671 fprintf(new, "#define CONFIGURE_GROUPNAME \"%s\"\n", username);
673 fprintf(new, "#define CONFIGURE_OWNERNAME \"%s\"\n", username);
677 fprintf(new, "#define CONFIGURE_GROUP %d\n", (int)gid);
679 fprintf(new, "#define CONFIGURE_OWNER %d\n", (int)uid);
683 /* FIXED_NEVER_USERS is another special case. Look up the uid values and
684 create suitable initialization data for a vector. */
686 if (strcmp(name, "FIXED_NEVER_USERS") == 0)
688 char *list = getenv("FIXED_NEVER_USERS");
691 fprintf(new, "#define FIXED_NEVER_USERS 0\n");
699 while (*p != 0) if (*p++ == ':') count++;
701 vector = malloc((count+1) * sizeof(uid_t));
702 vector[0] = (uid_t)count;
704 for (i = 1, j = 0; i <= count; list++, i++)
709 while (*list != 0 && *list != ':') list++;
710 strncpy(name, p, list-p);
717 else if (name[strspn(name, "0123456789")] == 0)
719 vector[j++] = (uid_t)atoi(name);
723 struct passwd *pw = getpwnam(name);
726 printf("\n*** User \"%s\" (specified for FIXED_NEVER_USERS in one of the Makefiles) does not "
727 "exist.\n Please review your build-time configuration.\n\n",
731 vector[j++] = pw->pw_uid;
734 fprintf(new, "#define FIXED_NEVER_USERS %d", j);
735 for (i = 0; i < j; i++) fprintf(new, ", %d", (unsigned int)vector[i]);
742 /* WITH_CONTENT_SCAN is another special case: it must be set if it or
743 EXPERIMENTAL_DCC is set. */
745 if (strcmp(name, "WITH_CONTENT_SCAN") == 0)
747 char *wcs = getenv("WITH_CONTENT_SCAN");
748 char *dcc = getenv("EXPERIMENTAL_DCC");
749 fprintf(new, wcs || dcc
750 ? "#define WITH_CONTENT_SCAN yes\n"
751 : "/* WITH_CONTENT_SCAN not set */\n");
755 /* DISABLE_DKIM is special; must be forced if DISABLE_TLS */
756 if (strcmp(name, "DISABLE_DKIM") == 0)
758 char *d_dkim = getenv("DISABLE_DKIM");
759 char *notls = getenv("DISABLE_TLS");
762 fprintf(new, "#define DISABLE_DKIM yes\n");
764 fprintf(new, "#define DISABLE_DKIM yes /* forced by lack of TLS */\n");
766 fprintf(new, "/* DISABLE_DKIM not set */\n");
770 /* Otherwise, check whether a value exists in the environment. Remember if
771 it is an AUTH setting or SUPPORT_CRYPTEQ. */
773 if ((value = getenv(name)) != NULL)
776 len = 21 - (int)strlen(name);
778 if (strncmp(name, "AUTH_", 5) == 0) have_auth = 1;
779 if (strncmp(name, "SUPPORT_CRYPTEQ", 15) == 0) support_crypteq = 1;
781 /* The text value of LDAP_LIB_TYPE refers to a macro that gets set. */
783 if (strcmp(name, "LDAP_LIB_TYPE") == 0)
785 if (strcmp(value, "NETSCAPE") == 0 ||
786 strcmp(value, "UMICHIGAN") == 0 ||
787 strcmp(value, "OPENLDAP1") == 0 ||
788 strcmp(value, "OPENLDAP2") == 0 ||
789 strcmp(value, "SOLARIS") == 0 ||
790 strcmp(value, "SOLARIS7") == 0) /* Compatibility */
792 fprintf(new, "#define LDAP_LIB_%s\n", value);
796 printf("\n*** LDAP_LIB_TYPE=%s is not a recognized LDAP library type."
797 "\n*** Please review your build-time configuration.\n\n", value);
802 else if (strcmp(name, "RADIUS_LIB_TYPE") == 0)
804 if (strcmp(value, "RADIUSCLIENT") == 0 ||
805 strcmp(value, "RADIUSCLIENTNEW") == 0 ||
806 strcmp(value, "RADLIB") == 0)
808 fprintf(new, "#define RADIUS_LIB_%s\n", value);
812 printf("\n*** RADIUS_LIB_TYPE=%s is not a recognized RADIUS library type."
813 "\n*** Please review your build-time configuration.\n\n", value);
818 /* Other macros get set to the environment value. */
822 fprintf(new, "#define %s ", name);
823 while(len-- > 0) fputc(' ', new);
825 /* LOG_FILE_PATH is now messy because it can be a path containing %s or
826 it can be "syslog" or ":syslog" or "syslog:path" or even "path:syslog". */
828 if (strcmp(name, "LOG_FILE_PATH") == 0)
834 char *sss = strchr(ss, ':');
837 strncpy(buffer, ss, sss-ss);
838 buffer[sss-ss] = 0; /* For empty case */
842 strncpy(buffer, ss, sizeof(buffer));
843 buffer[sizeof(buffer)-1] = 0;
845 pp = buffer + (int)strlen(buffer);
846 while (pp > buffer && isspace((unsigned char)pp[-1])) pp--;
848 if (buffer[0] != 0 && strcmp(buffer, "syslog") != 0)
849 check_percent_ess(buffer, name);
850 if (sss == NULL) break;
852 while (isspace((unsigned char)*ss)) ss++;
854 fprintf(new, "\"%s\"\n", value);
857 /* Timezone values HEADERS_CHARSET, TCP_WRAPPERS_DAEMON_NAME and
858 WHITELIST_D_MACROS get quoted */
860 else if (strcmp(name, "TIMEZONE_DEFAULT") == 0||
861 strcmp(name, "TCP_WRAPPERS_DAEMON_NAME") == 0||
862 strcmp(name, "HEADERS_CHARSET") == 0||
863 strcmp(name, "WHITELIST_D_MACROS") == 0)
864 fprintf(new, "\"%s\"\n", value);
866 /* GnuTLS constants; first is for debugging, others are tuning */
868 /* less than 0 is not-active; 0-9 are normal, API suggests higher
869 taken without problems */
870 else if (strcmp(name, "EXIM_GNUTLS_LIBRARY_LOG_LEVEL") == 0)
874 nv = strtol(value, &end, 10);
875 if (end != value && *end == '\0' && nv >= -1 && nv <= 100)
877 fprintf(new, "%s\n", value);
881 printf("Value of %s should be -1..9\n", name);
886 /* how many bits Exim, as a client, demands must be in D-H */
887 /* 1024 is a historical figure; some sites actually use lower, so we
888 permit the value to be lowered "dangerously" low, but not "insanely"
889 low. Though actually, 1024 is becoming "dangerous". */
890 else if ((strcmp(name, "EXIM_CLIENT_DH_MIN_MIN_BITS") == 0) ||
891 (strcmp(name, "EXIM_CLIENT_DH_DEFAULT_MIN_BITS") == 0) ||
892 (strcmp(name, "EXIM_SERVER_DH_BITS_PRE2_12") == 0))
896 nv = strtol(value, &end, 10);
897 if (end != value && *end == '\0' && nv >= 512 && nv < 500000)
899 fprintf(new, "%s\n", value);
903 printf("Unreasonable value (%s) of \"%s\".\n", value, name);
908 /* For others, quote any paths and don't quote anything else */
912 if (value[0] == '/') fprintf(new, "\"%s\"\n", value);
913 else fprintf(new, "%s\n", value);
918 /* Value not defined in the environment; use the default */
923 while (*p == ' ' || *p == '\t') p++;
924 if (*p != '\n') fputs(buffer, new); else
927 if (strcmp(name, "BIN_DIRECTORY") == 0 ||
928 strcmp(name, "CONFIGURE_FILE") == 0)
930 printf("\n*** %s has not been defined in any of the Makefiles in the\n"
931 " \"Local\" directory. "
932 "Please review your build-time configuration.\n\n", name);
936 if (strcmp(name, "TIMEZONE_DEFAULT") == 0)
938 char *tz = getenv("TZ");
939 fprintf(new, "#define TIMEZONE_DEFAULT ");
940 if (tz == NULL) fprintf(new, "NULL\n"); else
941 fprintf(new, "\"%s\"\n", tz);
944 else fprintf(new, "/* %s not set */\n", name);
951 /* If any AUTH macros were defined, ensure that SUPPORT_CRYPTEQ is also
955 if (!support_crypteq) fprintf(new, "/* Force SUPPORT_CRYPTEQ for AUTH */\n"
956 "#define SUPPORT_CRYPTEQ\n");
958 /* Check poll() for timer functionality.
959 Some OS' have released with it broken. */
962 struct timeval before, after;
965 gettimeofday(&before, NULL);
966 (void) poll(NULL, 0, 500);
967 gettimeofday(&after, NULL);
969 us = (after.tv_sec - before.tv_sec) * 1000000 +
970 (after.tv_usec - before.tv_usec);
973 fprintf(new, "#define NO_POLL_H\n");
978 fprintf(new, "\n/* End of config.h */\n");
983 /* End of buildconfig.c */