Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C25CD431FBC for ; Mon, 23 Nov 2009 10:14:25 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vdvHrDos8JbG for ; Mon, 23 Nov 2009 10:14:25 -0800 (PST) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by olra.theworths.org (Postfix) with ESMTP id E824D431FAE for ; Mon, 23 Nov 2009 10:14:24 -0800 (PST) Received: by bwz2 with SMTP id 2so5529207bwz.0 for ; Mon, 23 Nov 2009 10:14:24 -0800 (PST) Received: by 10.103.37.38 with SMTP id p38mr2351632muj.134.1259000064027; Mon, 23 Nov 2009 10:14:24 -0800 (PST) Received: from lt26923.campus.dmacc.edu ([69.57.47.215]) by mx.google.com with ESMTPS id 23sm16753662mum.33.2009.11.23.10.14.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 10:14:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NCdQZ-0003va-QL; Mon, 23 Nov 2009 12:14:19 -0600 From: "Jeffrey C. Ollie" To: Not Much Mail Date: Mon, 23 Nov 2009 12:14:15 -0600 Message-Id: <1259000055-15068-1-git-send-email-jeff@ocjtech.us> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <1258983810-27522-2-git-send-email-jeff@ocjtech.us> References: <1258983810-27522-2-git-send-email-jeff@ocjtech.us> Subject: [notmuch] [PATCH] Add tests to configure script to detect strndup and getline X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 18:14:25 -0000 Add some simple tests to the configure script to detect strndup and getline. It's not important that the tests run, just that they compile and link without any errors. Signed-off-by: Jeffrey C. Ollie --- configure | 20 +++++++++++++++++++- getlinetest.c | 13 +++++++++++++ strnduptest.c | 10 ++++++++++ 3 files changed, 42 insertions(+), 1 deletions(-) create mode 100644 getlinetest.c create mode 100644 strnduptest.c diff --git a/configure b/configure index b4770ec..44c1700 100755 --- a/configure +++ b/configure @@ -118,6 +118,24 @@ EOF exit 1 fi +if ! gcc -o strnduptest strnduptest.c > /dev/null 2>&1 +then + echo "Checking for strndup... No." + strndup=-Dstrndup=_notmuch_strndup +else + echo "Checking for strndup... Yes." +fi +rm -f strnduptest + +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); +} diff --git a/strnduptest.c b/strnduptest.c new file mode 100644 index 0000000..97c7c80 --- /dev/null +++ b/strnduptest.c @@ -0,0 +1,10 @@ +#include + +int main() +{ + char *d; + const char *s = ""; + size_t n = 0; + + d = strndup(s, n); +} -- 1.6.5.2