mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
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 <jeff@ocjtech.us>
This commit is contained in:
parent
1682633f65
commit
3054bc462c
2 changed files with 23 additions and 1 deletions
11
configure
vendored
11
configure
vendored
|
@ -126,6 +126,15 @@ EOF
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
cat <<EOF
|
||||||
|
|
||||||
All required packages were found. You may now run the following
|
All required packages were found. You may now run the following
|
||||||
|
@ -139,5 +148,5 @@ EOF
|
||||||
# construct the Makefile.config
|
# construct the Makefile.config
|
||||||
cat > Makefile.config <<EOF
|
cat > Makefile.config <<EOF
|
||||||
prefix = /usr/local
|
prefix = /usr/local
|
||||||
override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags}
|
override CFLAGS += -DHAVE_VALGRIND=${have_valgrind} ${valgrind_flags} ${getline}
|
||||||
EOF
|
EOF
|
||||||
|
|
13
getlinetest.c
Normal file
13
getlinetest.c
Normal file
|
@ -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);
|
||||||
|
}
|
Loading…
Reference in a new issue