]> git.notmuchmail.org Git - notmuch/commitdiff
configure: Move getlinetest.c down into config/have_getline.c.
authorCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:56:39 +0000 (16:56 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 2 Dec 2009 00:56:39 +0000 (16:56 -0800)
This keeps configure-related clutter out of the main directory, and
also gives a more direct correlation between the name of the test and
the feature being tested for.

config/README [new file with mode: 0644]
config/have_getline.c [new file with mode: 0644]
configure
getlinetest.c [deleted file]

diff --git a/config/README b/config/README
new file mode 100644 (file)
index 0000000..eabfe28
--- /dev/null
@@ -0,0 +1,5 @@
+notmuch/config
+
+This directory consists of small programs used by the notmuch
+configure script to test for the availability of certain system
+features, (library functions, etc.).
diff --git a/config/have_getline.c b/config/have_getline.c
new file mode 100644 (file)
index 0000000..a8bcd17
--- /dev/null
@@ -0,0 +1,13 @@
+#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);
+}
index bb1f0dbc22b4519521ee47f7aef41dc2e6b0e532..ef90a8ba27c40822ed406ab8005bae19ca64c518 100755 (executable)
--- a/configure
+++ b/configure
@@ -127,15 +127,15 @@ EOF
 fi
 
 printf "Checking for getline... "
 fi
 
 printf "Checking for getline... "
-if ! gcc -o getlinetest getlinetest.c > /dev/null 2>&1
+if gcc -o config/have_getline config/have_getline.c > /dev/null 2>&1
 then
 then
-    printf "No.\n"
-    have_getline=0
-else
     printf "Yes.\n"
     have_getline=1
     printf "Yes.\n"
     have_getline=1
+else
+    printf "No (will use our own instead).\n"
+    have_getline=0
 fi
 fi
-rm -f getlinetest
+rm -f config/have_getline
 
 cat <<EOF
 
 
 cat <<EOF
 
diff --git a/getlinetest.c b/getlinetest.c
deleted file mode 100644 (file)
index 2a21a50..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#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);
-}