From c87f2b1ba757fbed3fb5c8015cc690c723f61b93 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 7 Nov 2015 20:52:52 +0000 Subject: provide a simple stand-alone implementation of getline(3) for systems lacking it --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 108a4e58..afc916f5 100755 --- a/configure +++ b/configure @@ -45,6 +45,7 @@ BUILD_CGI=0 HAVE_DIRENT_NAMLEN= HAVE_ERR= HAVE_FTS= +HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= HAVE_MKDTEMP= @@ -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} @@ -339,6 +343,9 @@ if [ ${HAVE_ERR} -eq 0 ]; then 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 **);" -- cgit