1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) The Exim Maintainers 2022 */
6 /* Copyright (c) University of Cambridge 1995 - 2018 */
7 /* See the file NOTICE for conditions of use and distribution. */
8 /* SPDX-License-Identifier: GPL-2.0-only */
11 /*************************************************
12 * Build configuration header for Exim *
13 *************************************************/
15 /* This auxiliary program builds the file config.h by the following
18 First, it determines the size of off_t and time_t variables, and generates
19 macro code to define OFF_T_FMT and TIME_T_FMT as suitable formats, if they are
20 not already defined in the system-specific header file.
22 Then it reads Makefile, looking for certain OS-specific definitions which it
23 uses to define some specific macros. Finally, it reads the defaults file
26 The defaults file contains normal C #define statements for various macros; if
27 the name of a macro is found in the environment, the environment value replaces
28 the default. If the default #define does not contain any value, then that macro
29 is not copied to the created file unless there is some value in the
32 This program is compiled and run as part of the Make process and is not
33 normally called independently. */
40 #include <sys/types.h>
56 static const char *db_opts[] = { "", "USE_DB", "USE_GDBM", "USE_TDB", "USE_NDBM" };
58 static int have_ipv6 = 0;
59 static int have_iconv = 0;
61 static char errno_quota[256];
62 static char ostype[256];
65 /* If any entry is an initial substring of another, the longer one must
68 static have_item have_list[] = {
69 { "HAVE_IPV6", &have_ipv6 },
70 { "HAVE_ICONV", &have_iconv },
74 static save_item save_list[] = {
75 { "ERRNO_QUOTA", errno_quota },
82 /* Subroutine to check a string for precisely one instance of "%s". If not,
86 check_percent_ess(char *value, char *name)
89 char *p = strstr(value, "%s");
90 if (p != NULL) OK = strstr(p+2, "%s") == NULL;
93 printf("\n*** \"%s\" (%s) must contain precisely one occurrence of\n"
94 "*** \"%%s\". Please review your build-time configuration.\n\n/", value,
104 main(int argc, char **argv)
106 off_t test_off_t = 0;
107 time_t test_time_t = 0;
109 #if ! (__STDC_VERSION__ >= 199901L)
110 size_t test_size_t = 0;
111 ssize_t test_ssize_t = 0;
112 unsigned long test_ulong_t = 0L;
113 unsigned int test_uint_t = 0;
115 long test_long_t = 0;
116 long long test_longlong_t = 0;
120 int last_initial = 'A';
123 int in_local_makefile = 0;
124 int use_which_db = 0;
125 int use_which_db_in_local_makefile = 0;
126 int support_crypteq = 0;
131 printf("*** Buildconfig: called with incorrect arguments\n");
135 new = fopen("config.h", "wb");
138 printf("*** Buildconfig: failed to open config.h for output\n");
142 printf("Building configuration file config.h\n");
144 fprintf(new, "/*************************************************\n");
145 fprintf(new, "* Configuration header for Exim *\n");
146 fprintf(new, "*************************************************/\n\n");
148 fprintf(new, "/* This file was automatically generated from Makefile and "
149 "config.h.defaults,\n");
150 fprintf(new, "using values specified in the configuration file Local/Makefile.\n");
151 fprintf(new, "Do not edit it. Instead, edit Local/Makefile and "
152 "rerun make. */\n\n");
154 /* First, deal with the printing format for off_t variables. We assume that if
155 the size of off_t is greater than 4, "%lld" will be available as a format for
156 printing long long variables, and there will be support for the long long type.
157 This assumption is known to be OK for the common operating systems. */
159 fprintf(new, "#ifndef OFF_T_FMT\n");
160 if (sizeof(test_off_t) > sizeof(test_long_t))
161 fprintf(new, "# define OFF_T_FMT \"%%lld\"\n");
163 fprintf(new, "# define OFF_T_FMT \"%%ld\"\n");
164 fprintf(new, "#endif\n\n");
166 fprintf(new, "#ifndef LONGLONG_T\n");
167 if (sizeof(test_longlong_t) > sizeof(test_long_t))
168 fprintf(new, "# define LONGLONG_T long long int\n");
170 fprintf(new, "# define LONGLONG_T long int\n");
171 fprintf(new, "#endif\n\n");
173 /* Now do the same thing for time_t variables. If the length is greater than
174 4, we want to assume long long support (even if off_t was less than 4). If the
175 length is 4 or less, we can leave LONGLONG_T to whatever was defined above for
178 fprintf(new, "#ifndef TIME_T_FMT\n");
179 if (sizeof(test_time_t) > sizeof(test_long_t))
181 fprintf(new, "# define TIME_T_FMT \"%%lld\"\n");
182 fprintf(new, "# undef LONGLONG_T\n");
183 fprintf(new, "# define LONGLONG_T long long int\n");
186 fprintf(new, "# define TIME_T_FMT \"%%ld\"\n");
187 fprintf(new, "#endif\n\n");
189 fprintf(new, "#ifndef INO_T_FMT\n");
190 if (sizeof(test_ino_t) > sizeof(test_long_t))
191 fprintf(new, "# define INO_T_FMT \"%%llu\"\n");
193 fprintf(new, "# define INO_T_FMT \"%%lu\"\n");
194 fprintf(new, "#endif\n\n");
196 fprintf(new, "#ifndef PID_T_FMT\n");
197 fprintf(new, "# define PID_T_FMT \"%%lu\"\n");
198 fprintf(new, "#endif\n\n");
200 /* And for sizeof() results, size_t, which should with C99 be just %zu, deal
201 with C99 not being ubiquitous yet. Unfortunately. Assume ssize_t is same
202 size as size_t on C99; if someone comes up with a version where it's not, fix
205 #if __STDC_VERSION__ >= 199901L
206 fprintf(new, "#define SIZE_T_FMT \"%%zu\"\n");
207 fprintf(new, "#define SSIZE_T_FMT \"%%zd\"\n");
209 if (sizeof(test_size_t) > sizeof (test_ulong_t))
210 fprintf(new, "#define SIZE_T_FMT \"%%llu\"\n");
211 else if (sizeof(test_size_t) > sizeof (test_uint_t))
212 fprintf(new, "#define SIZE_T_FMT \"%%lu\"\n");
214 fprintf(new, "#define SIZE_T_FMT \"%%u\"\n");
216 if (sizeof(test_ssize_t) > sizeof(test_long_t))
217 fprintf(new, "#define SSIZE_T_FMT \"%%lld\"\n");
218 else if (sizeof(test_ssize_t) > sizeof(test_int_t))
219 fprintf(new, "#define SSIZE_T_FMT \"%%ld\"\n");
221 fprintf(new, "#define SSIZE_T_FMT \"%%d\"\n");
224 /* Now search the makefile for certain settings */
226 if (!(base = fopen("Makefile", "rb")))
228 printf("*** Buildconfig: failed to open Makefile\n");
233 errno_quota[0] = 0; /* no over-riding value set */
234 ostype[0] = 0; /* just in case */
237 while (fgets(buffer, sizeof(buffer), base) != NULL)
242 char *p = buffer + (int)strlen(buffer);
244 while (p > buffer && isspace((unsigned char)p[-1])) p--;
247 while (isspace((unsigned char)*p)) p++;
249 /* Notice when we hit the user's makefile */
251 if (strcmp(p, "# From Local/Makefile") == 0)
253 in_local_makefile = 1;
257 /* Remember the last DB option setting. If we hit two in the user's
258 Makefile, complain. */
260 for (i = 1; i < sizeof(db_opts)/sizeof(char *); i++)
262 int len = (int)strlen(db_opts[i]);
263 if (strncmp(p, db_opts[i], len) == 0 && (p[len] == ' ' || p[len] == '='))
265 if (in_local_makefile)
267 if (use_which_db_in_local_makefile)
269 printf("*** Only one of USE_DB, USE_GDBM, or USE_TDB should be "
270 "defined in Local/Makefile\n");
273 use_which_db_in_local_makefile = 1;
279 if (i < sizeof(db_opts)/sizeof(char *)) continue;
281 /* Items where we just save a boolean */
283 for (h = have_list; h->name != NULL; h++)
285 int len = (int)strlen(h->name);
286 if (strncmp(p, h->name, len) == 0)
289 while (isspace((unsigned char)*p)) p++;
292 printf("*** Buildconfig: syntax error in Makefile line %d\n", linecount);
295 while (isspace((unsigned char)*p)) p++;
296 if (strcmp(p, "YES") == 0 || strcmp(p, "yes") == 0) *(h->flag) = 1;
297 else *(h->flag) = 0; /* Must reset in case multiple instances */
302 if (h->name != NULL) continue;
304 /* Items where we save the complete string */
306 for (s = save_list; s->name != NULL; s++)
308 int len = (int)strlen(s->name);
309 if (strncmp(p, s->name, len) == 0)
312 while (isspace((unsigned char)*p)) p++;
315 printf("*** Buildconfig: syntax error in Makefile line %d\n", linecount);
318 while (isspace((unsigned char)*p)) p++;
324 fprintf(new, "#define HAVE_IPV6 %s\n",
325 have_ipv6? "TRUE" : "FALSE");
327 fprintf(new, "#define HAVE_ICONV %s\n",
328 have_iconv? "TRUE" : "FALSE");
330 if (errno_quota[0] != 0)
331 fprintf(new, "\n#define ERRNO_QUOTA %s\n", errno_quota);
333 if (strcmp(cc, "gcc") == 0 &&
334 (strstr(ostype, "IRIX") != NULL || strstr(ostype, "AIX") != NULL))
336 fprintf(new, "\n/* This switch includes the code to fix the inet_ntoa() */");
337 fprintf(new, "\n/* bug when using gcc on an IRIX or AIX system. */");
338 fprintf(new, "\n#define USE_INET_NTOA_FIX");
345 /* Now handle the macros listed in the defaults */
347 base = fopen("../src/config.h.defaults", "rb");
350 printf("*** Buildconfig: failed to open ../src/config.h.defaults\n");
355 while (fgets(buffer, sizeof(buffer), base) != NULL)
363 while (*p == ' ' || *p == '\t') p++;
365 if (strncmp(p, "#ifdef ", 7) == 0
366 || strncmp(p, "#ifndef ", 8) == 0
367 || strncmp(p, "#if ", 4) == 0
368 || strncmp(p, "#endif", 6) == 0
375 if (strncmp(p, "#define ", 8) != 0) continue;
378 while (*p == ' ' || *p == '\t') p++;
380 if (*p < last_initial) fprintf(new, "\n");
383 while (*p && (isalnum((unsigned char)*p) || *p == '_')) *q++ = *p++;
386 /* USE_DB, USE_GDBM, and USE_TDB are special cases. We want to have only
387 one of them set. The scan of the Makefile has saved which was the last one
390 for (i = 1; i < sizeof(db_opts)/sizeof(char *); i++)
391 if (strcmp(name, db_opts[i]) == 0)
393 if (use_which_db == i)
394 fprintf(new, "#define %s %.*syes\n", db_opts[i],
395 21 - (int)strlen(db_opts[i]), " ");
397 fprintf(new, "/* %s not set */\n", name);
400 if (i < sizeof(db_opts)/sizeof(char *)) continue;
402 /* EXIM_USER is a special case. We look in the environment for EXIM_USER or
403 EXIM_UID (the latter for backward compatibility with Exim 3). If the value is
404 not numeric, we look up the user, and default the GID if found. Otherwise,
405 EXIM_GROUP or EXIM_GID must be in the environment. */
407 if (strcmp(name, "EXIM_UID") == 0)
413 char *username = NULL;
414 char *groupname = NULL;
416 char *user = getenv("EXIM_USER");
417 char *group = getenv("EXIM_GROUP");
419 if (user == NULL) user = getenv("EXIM_UID");
420 if (group == NULL) group = getenv("EXIM_GID");
424 printf("\n*** EXIM_USER has not been defined in any of the Makefiles in "
425 "the\n \"Local\" directory. Please review your build-time "
426 "configuration.\n\n");
430 while (isspace((unsigned char)(*user))) user++;
433 printf("\n*** EXIM_USER is defined as an empty string in one of the "
434 "files\n in the \"Local\" directory. Please review your build-time"
435 "\n configuration.\n\n");
439 for (s = user; *s != 0; s++)
441 if (iscntrl((unsigned char)(*s)))
443 printf("\n*** EXIM_USER contains the control character 0x%02X in one "
444 "of the files\n in the \"Local\" directory. Please review your "
445 "build-time\n configuration.\n\n", *s);
450 /* Numeric uid given */
452 if (user[strspn(user, "0123456789")] == 0)
454 uid = (uid_t)atoi(user);
457 /* User name given. Normally, we look up the uid right away. However,
458 people building binary distributions sometimes want to retain the name till
459 runtime. This is supported if the name begins "ref:". */
461 else if (strncmp(user, "ref:", 4) == 0)
464 while (isspace(*user)) user++;
472 struct passwd *pw = getpwnam(user);
475 printf("\n*** User \"%s\" (specified in one of the Makefiles) does not "
476 "exist.\n Please review your build-time configuration.\n\n",
486 /* Use explicit group if set. */
490 while (isspace((unsigned char)(*group))) group++;
493 printf("\n*** EXIM_GROUP is defined as an empty string in one of "
494 "the files in the\n \"Local\" directory. ");
497 printf("If you want the Exim group to be taken from the\n "
498 "password data for the Exim user, just remove the EXIM_GROUP "
499 "setting.\n Otherwise, p");
501 else printf("EXIM_USER is defined numerically, so there is no"
502 "\n default for EXIM_GROUP and you must set it explicitly.\n P");
503 printf("lease review your build-time configuration.\n\n");
507 for (s = group; *s != 0; s++)
509 if (iscntrl((unsigned char)(*s)))
511 printf("\n*** EXIM_GROUP contains the control character 0x%02X in one "
512 "of the files\n in the \"Local\" directory. Please review your "
513 "build-time\n configuration.\n\n", *s);
518 /* Group name given. This may be by reference or to be looked up now,
521 if (strncmp(group, "ref:", 4) == 0)
524 while (isspace(*group)) group++;
528 else if (username != NULL)
533 else if (group[strspn(group, "0123456789")] == 0)
535 gid = (gid_t)atoi(group);
540 struct group *gr = getgrnam(group);
543 printf("\n*** Group \"%s\" (specified in one of the Makefiles) does "
544 "not exist.\n Please review your build-time configuration.\n\n",
552 /* Else trouble unless found in passwd file with user */
556 printf("\n*** No group set for Exim. Please review your build-time "
557 "configuration.\n\n");
561 /* security sanity checks
562 if ref: is being used, we can never be sure, but we can take reasonable
563 steps to filter out the most obvious ones. */
565 if ((!uid_not_set && uid == 0) ||
566 ((username != NULL) && (
567 (strcmp(username, "root") == 0) ||
568 (strcmp(username, "toor") == 0) )))
570 printf("\n*** Exim's internal user must not be root.\n\n");
574 /* Output user and group names or uid/gid. When names are set, uid/gid
575 are set to zero but will be replaced at runtime. */
577 if (username != NULL)
578 fprintf(new, "#define EXIM_USERNAME \"%s\"\n", username);
579 if (groupname != NULL)
580 fprintf(new, "#define EXIM_GROUPNAME \"%s\"\n", groupname);
582 fprintf(new, "#define EXIM_UID %d\n", (int)uid);
583 fprintf(new, "#define EXIM_GID %d\n", (int)gid);
587 /* CONFIGURE_OWNER and CONFIGURE_GROUP are special cases. We look in the
588 environment for first. If the value is not numeric, we look up the user or
589 group. A lot of this code is similar to that for EXIM_USER, but it's easier
590 to keep it separate. */
592 if (strcmp(name, "CONFIGURE_OWNER") == 0 ||
593 strcmp(name, "CONFIGURE_GROUP") == 0)
595 int isgroup = name[10] == 'G';
599 const char *username = NULL;
600 const char *user = getenv(name);
602 if (user == NULL) user = "";
603 while (isspace((unsigned char)(*user))) user++;
606 fprintf(new, "/* %s not set */\n", name);
610 for (s = user; *s != 0; s++)
612 if (iscntrl((unsigned char)(*s)))
614 printf("\n*** %s contains the control character 0x%02X in "
615 "one of the files\n in the \"Local\" directory. Please review "
616 "your build-time\n configuration.\n\n", name, *s);
621 /* Numeric uid given */
623 if (user[strspn(user, "0123456789")] == 0)
626 gid = (gid_t)atoi(user);
628 uid = (uid_t)atoi(user);
631 /* Name given. Normally, we look up the uid or gid right away. However,
632 people building binary distributions sometimes want to retain the name till
633 runtime. This is supported if the name begins "ref:". */
635 else if (strncmp(user, "ref:", 4) == 0)
638 while (isspace(*user)) user++;
643 struct group *gr = getgrnam(user);
646 printf("\n*** Group \"%s\" (specified in one of the Makefiles) does not "
647 "exist.\n Please review your build-time configuration.\n\n",
656 struct passwd *pw = getpwnam(user);
659 printf("\n*** User \"%s\" (specified in one of the Makefiles) does not "
660 "exist.\n Please review your build-time configuration.\n\n",
667 /* Output user and group names or uid/gid. When names are set, uid/gid
668 are set to zero but will be replaced at runtime. */
670 if (username != NULL)
673 fprintf(new, "#define CONFIGURE_GROUPNAME \"%s\"\n", username);
675 fprintf(new, "#define CONFIGURE_OWNERNAME \"%s\"\n", username);
679 fprintf(new, "#define CONFIGURE_GROUP %d\n", (int)gid);
681 fprintf(new, "#define CONFIGURE_OWNER %d\n", (int)uid);
685 /* FIXED_NEVER_USERS is another special case. Look up the uid values and
686 create suitable initialization data for a vector. */
688 if (strcmp(name, "FIXED_NEVER_USERS") == 0)
690 char *list = getenv("FIXED_NEVER_USERS");
693 fprintf(new, "#define FIXED_NEVER_USERS 0\n");
701 while (*p != 0) if (*p++ == ':') count++;
703 vector = malloc((count+1) * sizeof(uid_t));
704 vector[0] = (uid_t)count;
706 for (i = 1, j = 0; i <= count; list++, i++)
711 while (*list != 0 && *list != ':') list++;
712 strncpy(name, p, list-p);
719 else if (name[strspn(name, "0123456789")] == 0)
721 vector[j++] = (uid_t)atoi(name);
725 struct passwd *pw = getpwnam(name);
728 printf("\n*** User \"%s\" (specified for FIXED_NEVER_USERS in one of the Makefiles) does not "
729 "exist.\n Please review your build-time configuration.\n\n",
733 vector[j++] = pw->pw_uid;
736 fprintf(new, "#define FIXED_NEVER_USERS %d", j);
737 for (i = 0; i < j; i++) fprintf(new, ", %d", (unsigned int)vector[i]);
744 /* DISABLE_DKIM is special; must be forced if DISABLE_TLS */
745 if (strcmp(name, "DISABLE_DKIM") == 0)
747 char *d_dkim = getenv("DISABLE_DKIM");
748 char *notls = getenv("DISABLE_TLS");
751 fprintf(new, "#define DISABLE_DKIM yes\n");
753 fprintf(new, "#define DISABLE_DKIM yes /* forced by lack of TLS */\n");
755 fprintf(new, "/* DISABLE_DKIM not set */\n");
759 /* Otherwise, check whether a value exists in the environment. Remember if
760 it is an AUTH setting or SUPPORT_CRYPTEQ. */
762 if ((value = getenv(name)) != NULL)
765 len = 21 - (int)strlen(name);
767 if (strncmp(name, "AUTH_", 5) == 0) have_auth = 1;
768 if (strncmp(name, "SUPPORT_CRYPTEQ", 15) == 0) support_crypteq = 1;
770 /* The text value of LDAP_LIB_TYPE refers to a macro that gets set. */
772 if (strcmp(name, "LDAP_LIB_TYPE") == 0)
774 if (strcmp(value, "NETSCAPE") == 0 ||
775 strcmp(value, "UMICHIGAN") == 0 ||
776 strcmp(value, "OPENLDAP1") == 0 ||
777 strcmp(value, "OPENLDAP2") == 0 ||
778 strcmp(value, "SOLARIS") == 0 ||
779 strcmp(value, "SOLARIS7") == 0) /* Compatibility */
781 fprintf(new, "#define LDAP_LIB_%s\n", value);
785 printf("\n*** LDAP_LIB_TYPE=%s is not a recognized LDAP library type."
786 "\n*** Please review your build-time configuration.\n\n", value);
791 else if (strcmp(name, "RADIUS_LIB_TYPE") == 0)
793 if (strcmp(value, "RADIUSCLIENT") == 0 ||
794 strcmp(value, "RADIUSCLIENTNEW") == 0 ||
795 strcmp(value, "RADLIB") == 0)
797 fprintf(new, "#define RADIUS_LIB_%s\n", value);
801 printf("\n*** RADIUS_LIB_TYPE=%s is not a recognized RADIUS library type."
802 "\n*** Please review your build-time configuration.\n\n", value);
807 /* Other macros get set to the environment value. */
811 fprintf(new, "#define %s ", name);
812 while(len-- > 0) fputc(' ', new);
814 /* LOG_FILE_PATH is now messy because it can be a path containing %s or
815 it can be "syslog" or ":syslog" or "syslog:path" or even "path:syslog". */
817 if (strcmp(name, "LOG_FILE_PATH") == 0)
823 char *sss = strchr(ss, ':');
826 strncpy(buffer, ss, sss-ss);
827 buffer[sss-ss] = 0; /* For empty case */
831 strncpy(buffer, ss, sizeof(buffer));
832 buffer[sizeof(buffer)-1] = 0;
834 pp = buffer + (int)strlen(buffer);
835 while (pp > buffer && isspace((unsigned char)pp[-1])) pp--;
837 if (buffer[0] != 0 && strcmp(buffer, "syslog") != 0)
838 check_percent_ess(buffer, name);
839 if (sss == NULL) break;
841 while (isspace((unsigned char)*ss)) ss++;
843 fprintf(new, "\"%s\"\n", value);
846 /* Timezone values HEADERS_CHARSET, TCP_WRAPPERS_DAEMON_NAME and
847 WHITELIST_D_MACROS get quoted */
849 else if (strcmp(name, "TIMEZONE_DEFAULT") == 0||
850 strcmp(name, "TCP_WRAPPERS_DAEMON_NAME") == 0||
851 strcmp(name, "HEADERS_CHARSET") == 0||
852 strcmp(name, "WHITELIST_D_MACROS") == 0)
853 fprintf(new, "\"%s\"\n", value);
855 /* GnuTLS constants; first is for debugging, others are tuning */
857 /* less than 0 is not-active; 0-9 are normal, API suggests higher
858 taken without problems */
859 else if (strcmp(name, "EXIM_GNUTLS_LIBRARY_LOG_LEVEL") == 0)
863 nv = strtol(value, &end, 10);
864 if (end != value && *end == '\0' && nv >= -1 && nv <= 100)
866 fprintf(new, "%s\n", value);
870 printf("Value of %s should be -1..9\n", name);
875 /* how many bits Exim, as a client, demands must be in D-H */
876 /* 1024 is a historical figure; some sites actually use lower, so we
877 permit the value to be lowered "dangerously" low, but not "insanely"
878 low. Though actually, 1024 is becoming "dangerous". */
879 else if ((strcmp(name, "EXIM_CLIENT_DH_MIN_MIN_BITS") == 0) ||
880 (strcmp(name, "EXIM_CLIENT_DH_DEFAULT_MIN_BITS") == 0) ||
881 (strcmp(name, "EXIM_SERVER_DH_BITS_PRE2_12") == 0))
885 nv = strtol(value, &end, 10);
886 if (end != value && *end == '\0' && nv >= 512 && nv < 500000)
888 fprintf(new, "%s\n", value);
892 printf("Unreasonable value (%s) of \"%s\".\n", value, name);
897 /* For others, quote any paths and don't quote anything else */
901 if (value[0] == '/') fprintf(new, "\"%s\"\n", value);
902 else fprintf(new, "%s\n", value);
907 /* Value not defined in the environment; use the default */
912 while (*p == ' ' || *p == '\t') p++;
913 if (*p != '\n') fputs(buffer, new); else
916 if (strcmp(name, "BIN_DIRECTORY") == 0 ||
917 strcmp(name, "CONFIGURE_FILE") == 0)
919 printf("\n*** %s has not been defined in any of the Makefiles in the\n"
920 " \"Local\" directory. "
921 "Please review your build-time configuration.\n\n", name);
925 if (strcmp(name, "TIMEZONE_DEFAULT") == 0)
927 char *tz = getenv("TZ");
928 fprintf(new, "#define TIMEZONE_DEFAULT ");
929 if (tz == NULL) fprintf(new, "NULL\n"); else
930 fprintf(new, "\"%s\"\n", tz);
933 else fprintf(new, "/* %s not set */\n", name);
940 /* If any AUTH macros were defined, ensure that SUPPORT_CRYPTEQ is also
944 if (!support_crypteq) fprintf(new, "/* Force SUPPORT_CRYPTEQ for AUTH */\n"
945 "#define SUPPORT_CRYPTEQ\n");
947 /* Check poll() for timer functionality.
948 Some OS' have released with it broken. */
951 struct timeval before, after;
954 gettimeofday(&before, NULL);
955 (void) poll(NULL, 0, 500);
956 gettimeofday(&after, NULL);
958 us = (after.tv_sec - before.tv_sec) * 1000000 +
959 (after.tv_usec - before.tv_usec);
962 fprintf(new, "#define NO_POLL_H\n");
967 fprintf(new, "\n/* End of config.h */\n");
972 /* End of buildconfig.c */