+echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
+echo "#define MANPATH_BASE \"${MANPATH_BASE}\""
+echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
+[ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
+[ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
+[ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
+[ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
+[ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0"
+[ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
+if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then
+ echo "#define be32toh ntohl"
+ echo "#define htobe32 htonl"
+fi
+
+cat << __HEREDOC__
+#define HAVE_CMSG_XPG42 ${HAVE_CMSG_XPG42}
+#define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
+#define HAVE_ENDIAN ${HAVE_ENDIAN}
+#define HAVE_ERR ${HAVE_ERR}
+#define HAVE_FTS ${HAVE_FTS}
+#define HAVE_FTS_COMPARE_CONST ${HAVE_FTS_COMPARE_CONST}
+#define HAVE_GETLINE ${HAVE_GETLINE}
+#define HAVE_GETSUBOPT ${HAVE_GETSUBOPT}
+#define HAVE_ISBLANK ${HAVE_ISBLANK}
+#define HAVE_MKDTEMP ${HAVE_MKDTEMP}
+#define HAVE_NTOHL ${HAVE_NTOHL}
+#define HAVE_PLEDGE ${HAVE_PLEDGE}
+#define HAVE_PROGNAME ${HAVE_PROGNAME}
+#define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
+#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY}
+#define HAVE_REWB_BSD ${HAVE_REWB_BSD}
+#define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}
+#define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}
+#define HAVE_STRCASESTR ${HAVE_STRCASESTR}
+#define HAVE_STRINGLIST ${HAVE_STRINGLIST}
+#define HAVE_STRLCAT ${HAVE_STRLCAT}
+#define HAVE_STRLCPY ${HAVE_STRLCPY}
+#define HAVE_STRNDUP ${HAVE_STRNDUP}
+#define HAVE_STRPTIME ${HAVE_STRPTIME}
+#define HAVE_STRSEP ${HAVE_STRSEP}
+#define HAVE_STRTONUM ${HAVE_STRTONUM}
+#define HAVE_SYS_ENDIAN ${HAVE_SYS_ENDIAN}
+#define HAVE_VASPRINTF ${HAVE_VASPRINTF}
+#define HAVE_WCHAR ${HAVE_WCHAR}
+#define HAVE_OHASH ${HAVE_OHASH}
+
+#define BINM_APROPOS "${BINM_APROPOS}"
+#define BINM_CATMAN "${BINM_CATMAN}"
+#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
+#define BINM_MAN "${BINM_MAN}"
+#define BINM_SOELIM "${BINM_SOELIM}"
+#define BINM_WHATIS "${BINM_WHATIS}"
+
+__HEREDOC__
+
+if [ ${HAVE_ERR} -eq 0 ]; then
+ echo "extern void err(int, const char *, ...);"
+ echo "extern void errx(int, const char *, ...);"
+ echo "extern void warn(const char *, ...);"
+ echo "extern void warnx(const char *, ...);"
+fi
+
+[ ${HAVE_GETLINE} -eq 0 ] && \
+ echo "extern ssize_t getline(char **, size_t *, FILE *);"
+
+[ ${HAVE_GETSUBOPT} -eq 0 ] && \
+ echo "extern int getsubopt(char **, char * const *, char **);"
+
+[ ${HAVE_ISBLANK} -eq 0 ] && \
+ echo "extern int isblank(int);"
+
+[ ${HAVE_MKDTEMP} -eq 0 ] && \
+ echo "extern char *mkdtemp(char *);"
+
+if [ ${HAVE_PROGNAME} -eq 0 ]; then
+ echo "extern const char *getprogname(void);"
+ echo "extern void setprogname(const char *);"
+fi
+
+[ ${HAVE_REALLOCARRAY} -eq 0 ] && \
+ echo "extern void *reallocarray(void *, size_t, size_t);"
+
+[ ${HAVE_RECALLOCARRAY} -eq 0 ] && \
+ echo "extern void *recallocarray(void *, size_t, size_t, size_t);"
+
+[ ${HAVE_STRCASESTR} -eq 0 ] && \
+ echo "extern char *strcasestr(const char *, const char *);"
+
+[ ${HAVE_STRLCAT} -eq 0 ] && \
+ echo "extern size_t strlcat(char *, const char *, size_t);"
+
+[ ${HAVE_STRLCPY} -eq 0 ] && \
+ echo "extern size_t strlcpy(char *, const char *, size_t);"
+
+[ ${HAVE_STRNDUP} -eq 0 ] && \
+ echo "extern char *strndup(const char *, size_t);"
+
+[ ${HAVE_STRSEP} -eq 0 ] && \
+ echo "extern char *strsep(char **, const char *);"
+
+[ ${HAVE_STRTONUM} -eq 0 ] && \
+ echo "extern long long strtonum(const char *, long long, long long, const char **);"
+
+[ ${HAVE_VASPRINTF} -eq 0 ] && \
+ echo "extern int vasprintf(char **, const char *, va_list);"
+
+echo "file config.h: written" 1>&2
+echo "file config.h: written" 1>&3
+
+# --- tests for Makefile.local -----------------------------------------
+
+exec > Makefile.local
+
+[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
+[ -z "${SBINDIR}" ] && SBINDIR="${PREFIX}/sbin"
+[ -z "${BIN_FROM_SBIN}" ] && BIN_FROM_SBIN="../bin"
+[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc"
+[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib/mandoc"
+[ -z "${MANDIR}" ] && MANDIR="${PREFIX}/man"
+
+[ -z "${HTDOCDIR}" ] && HTDOCDIR="${WWWPREFIX}/htdocs"
+[ -z "${CGIBINDIR}" ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
+
+[ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
+[ -z "${INSTALL_LIB}" ] && INSTALL_LIB="${INSTALL} -m 0444"
+[ -z "${INSTALL_MAN}" ] && INSTALL_MAN="${INSTALL} -m 0444"
+[ -z "${INSTALL_DATA}" ] && INSTALL_DATA="${INSTALL} -m 0444"
+
+BUILD_TARGETS=
+[ ${BUILD_CGI} -gt 0 ] && BUILD_TARGETS="man.cgi"
+[ ${BUILD_CATMAN} -gt 0 ] && \
+ BUILD_TARGETS="${BUILD_TARGETS} mandocd catman"
+INSTALL_TARGETS=
+[ ${INSTALL_LIBMANDOC} -gt 0 ] && INSTALL_TARGETS="lib-install"
+[ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install"
+[ ${BUILD_CATMAN} -gt 0 ] && \
+ INSTALL_TARGETS="${INSTALL_TARGETS} catman-install"
+
+cat << __HEREDOC__
+BUILD_TARGETS = ${BUILD_TARGETS}
+INSTALL_TARGETS = ${INSTALL_TARGETS}
+CC = ${CC}
+CFLAGS = ${CFLAGS}
+LDADD = ${LDADD}
+LDFLAGS = ${LDFLAGS}
+STATIC = ${STATIC}
+PREFIX = ${PREFIX}
+BINDIR = ${BINDIR}
+SBINDIR = ${SBINDIR}
+BIN_FROM_SBIN = ${BIN_FROM_SBIN}
+INCLUDEDIR = ${INCLUDEDIR}
+LIBDIR = ${LIBDIR}
+MANDIR = ${MANDIR}
+WWWPREFIX = ${WWWPREFIX}
+HTDOCDIR = ${HTDOCDIR}
+CGIBINDIR = ${CGIBINDIR}
+BINM_APROPOS = ${BINM_APROPOS}
+BINM_CATMAN = ${BINM_CATMAN}
+BINM_MAKEWHATIS = ${BINM_MAKEWHATIS}
+BINM_MAN = ${BINM_MAN}
+BINM_SOELIM = ${BINM_SOELIM}
+BINM_WHATIS = ${BINM_WHATIS}
+MANM_MAN = ${MANM_MAN}
+MANM_MANCONF = ${MANM_MANCONF}
+MANM_MDOC = ${MANM_MDOC}
+MANM_ROFF = ${MANM_ROFF}
+MANM_EQN = ${MANM_EQN}
+MANM_TBL = ${MANM_TBL}
+INSTALL = ${INSTALL}
+INSTALL_PROGRAM = ${INSTALL_PROGRAM}
+INSTALL_LIB = ${INSTALL_LIB}
+INSTALL_MAN = ${INSTALL_MAN}
+INSTALL_DATA = ${INSTALL_DATA}
+LN = ${LN}
+__HEREDOC__
+
+echo "file Makefile.local: written" 1>&2
+echo "file Makefile.local: written" 1>&3