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 <jeff@ocjtech.us>
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 <<EOF
All required packages were found. You may now run the following
# construct the Makefile.config
cat > Makefile.config <<EOF
prefix = /usr/local
-override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags}
+override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags} ${getline}
EOF
--- /dev/null
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/types.h>
+
+int main()
+{
+ ssize_t count = 0;
+ size_t n = 0;
+ char **lineptr = NULL;
+ FILE *stream = NULL;
+
+ count = getline(lineptr, &n, stream);
+}