=================================================================== RCS file: /cvs/mandoc/configure,v retrieving revision 1.26 retrieving revision 1.29 diff -u -p -r1.26 -r1.29 --- mandoc/configure 2015/05/20 22:22:59 1.26 +++ mandoc/configure 2015/11/06 16:30:33 1.29 @@ -43,12 +43,14 @@ BUILD_DB=1 BUILD_CGI=0 HAVE_DIRENT_NAMLEN= +HAVE_ERR= HAVE_FGETLN= HAVE_FTS= HAVE_GETSUBOPT= HAVE_ISBLANK= HAVE_MKDTEMP= HAVE_MMAP= +HAVE_PROGNAME= HAVE_REALLOCARRAY= HAVE_STRCASESTR= HAVE_STRINGLIST= @@ -171,12 +173,14 @@ runtest() { # --- library functions --- runtest dirent-namlen DIRENT_NAMLEN || true +runtest err ERR || true runtest fgetln FGETLN || true runtest fts FTS || true runtest getsubopt GETSUBOPT || true runtest isblank ISBLANK || true runtest mkdtemp MKDTEMP || true runtest mmap MMAP || true +runtest progname PROGNAME || true runtest reallocarray REALLOCARRAY || true runtest strcasestr STRCASESTR || true runtest stringlist STRINGLIST || true @@ -239,9 +243,9 @@ fi # --- DBLIB --- if [ ${BUILD_DB} -eq 0 ]; then - DBLIB= + DBLIB="-lz" elif [ -z "${DBLIB}" ]; then - DBLIB="${DETECTLIB}" + DBLIB="${DETECTLIB} -lz" echo "DBLIB=\"${DBLIB}\"" 1>&2 echo "DBLIB=\"${DBLIB}\"" 1>&3 echo 1>&3 @@ -290,12 +294,14 @@ echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} +#define HAVE_ERR ${HAVE_ERR} #define HAVE_FGETLN ${HAVE_FGETLN} #define HAVE_FTS ${HAVE_FTS} #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT} #define HAVE_ISBLANK ${HAVE_ISBLANK} #define HAVE_MKDTEMP ${HAVE_MKDTEMP} #define HAVE_MMAP ${HAVE_MMAP} +#define HAVE_PROGNAME ${HAVE_PROGNAME} #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} #define HAVE_STRCASESTR ${HAVE_STRCASESTR} #define HAVE_STRINGLIST ${HAVE_STRINGLIST} @@ -334,6 +340,12 @@ cat << __HEREDOC__ __HEREDOC__ +if [ ${HAVE_ERR} -eq 0 ]; then + echo "extern void err(int, const char *, ...);" + echo "extern void warn(const char *, ...);" + echo "extern void warnx(const char *, ...);" +fi + [ ${HAVE_FGETLN} -eq 0 ] && \ echo "extern char *fgetln(FILE *, size_t *);" @@ -345,6 +357,11 @@ __HEREDOC__ [ ${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);"