=================================================================== RCS file: /cvs/mandoc/configure,v retrieving revision 1.34 retrieving revision 1.37 diff -u -p -r1.34 -r1.37 --- mandoc/configure 2015/11/07 17:58:55 1.34 +++ mandoc/configure 2015/11/26 07:42:11 1.37 @@ -16,8 +16,8 @@ set -e -[ -e config.log ] && mv config.log config.log.old -[ -e config.h ] && mv config.h config.h.old +[ -w config.log ] && mv config.log config.log.old +[ -w config.h ] && mv config.h config.h.old # Output file descriptor usage: # 1 (stdout): config.h, Makefile.local @@ -45,6 +45,7 @@ BUILD_CGI=0 HAVE_DIRENT_NAMLEN= HAVE_ERR= HAVE_FTS= +HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= HAVE_MKDTEMP= @@ -101,7 +102,7 @@ INSTALL_DATA= # --- manual settings from configure.local ----------------------------- -if [ -e ./configure.local ]; then +if [ -r ./configure.local ]; then echo "configure.local: reading..." 1>&2 echo "configure.local: reading..." 1>&3 cat ./configure.local 1>&3 @@ -176,6 +177,7 @@ runtest() { runtest dirent-namlen DIRENT_NAMLEN || true runtest err ERR || true runtest fts FTS || true +runtest getline GETLINE || true runtest getsubopt GETSUBOPT || true runtest isblank ISBLANK || true runtest mkdtemp MKDTEMP || true @@ -287,10 +289,11 @@ cat << __HEREDOC__ __HEREDOC__ -[ ${HAVE_REALLOCARRAY} -eq 0 -o \ +[ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \ && echo "#include " [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include " +[ ${HAVE_GETLINE} -eq 0 ] && echo "#include " echo echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\"" @@ -302,6 +305,7 @@ cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} #define HAVE_ERR ${HAVE_ERR} #define HAVE_FTS ${HAVE_FTS} +#define HAVE_GETLINE ${HAVE_GETLINE} #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT} #define HAVE_ISBLANK ${HAVE_ISBLANK} #define HAVE_MKDTEMP ${HAVE_MKDTEMP} @@ -335,9 +339,13 @@ __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 **);"