From 3054bc462c8f31965f342808fce48c72f2858cfc Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 23 Nov 2009 12:14:15 -0600 Subject: [PATCH] Add test to configure script to detect getline Add a simple test to the configure script to detect getline. It's not important that the test run, just that it compiles and links without any errors. Signed-off-by: Jeffrey C. Ollie --- configure | 11 ++++++++++- getlinetest.c | 13 +++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 getlinetest.c diff --git a/configure b/configure index 6b571977..1b5f7e04 100755 --- a/configure +++ b/configure @@ -126,6 +126,15 @@ EOF exit 1 fi +if ! gcc -o getlinetest getlinetest.c > /dev/null 2>&1 +then + echo "Checking for getline... No." + getline=-Dgetline=_notmuch_getline +else + echo "Checking for getline... Yes." +fi +rm -f getlinetest + cat < Makefile.config < +#include + +int main() +{ + ssize_t count = 0; + size_t n = 0; + char **lineptr = NULL; + FILE *stream = NULL; + + count = getline(lineptr, &n, stream); +}