]> git.notmuchmail.org Git - notmuch/blobdiff - configure
Add test to configure script to detect getline
[notmuch] / configure
index 2ceda74bc65c3d237ab3449340533b495a086d49..1b5f7e04eee3f584ac4c8a56d1c58d03dc221d06 100755 (executable)
--- a/configure
+++ b/configure
@@ -61,10 +61,12 @@ fi
 printf "Checking for valgrind development files... "
 if pkg-config --modversion valgrind > /dev/null 2>&1; then
     printf "Yes.\n"
-    have_valgrind=-DHAVE_VALGRIND
+    have_valgrind=1
+    valgrind_flags=$(pkg-config --cflags valgrind)
 else
     printf "No (but that's fine).\n"
-    have_valgrind=
+    have_valgrind=0
+    valgrind_flags=
 fi
 
 if [ $errors -gt 0 ]; then
@@ -124,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 <<EOF
 
 All required packages were found. You may now run the following
@@ -137,5 +148,5 @@ EOF
 # construct the Makefile.config
 cat > Makefile.config <<EOF
 prefix = /usr/local
-CFLAGS += ${have_valgrind}
+override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags} ${getline}
 EOF