Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 01 / 3fafc2edff0a7d8f1b2f8fc71e94fcaaec5b8f
1 Return-Path: <jeff@ocjtech.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id C25CD431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:14:25 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id vdvHrDos8JbG for <notmuch@notmuchmail.org>;\r
11         Mon, 23 Nov 2009 10:14:25 -0800 (PST)\r
12 Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com\r
13         [209.85.218.210])\r
14         by olra.theworths.org (Postfix) with ESMTP id E824D431FAE\r
15         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:14:24 -0800 (PST)\r
16 Received: by bwz2 with SMTP id 2so5529207bwz.0\r
17         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:14:24 -0800 (PST)\r
18 Received: by 10.103.37.38 with SMTP id p38mr2351632muj.134.1259000064027;\r
19         Mon, 23 Nov 2009 10:14:24 -0800 (PST)\r
20 Received: from lt26923.campus.dmacc.edu ([69.57.47.215])\r
21         by mx.google.com with ESMTPS id 23sm16753662mum.33.2009.11.23.10.14.22\r
22         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
23         Mon, 23 Nov 2009 10:14:23 -0800 (PST)\r
24 Received: from localhost ([127.0.0.1] helo=localhost.localdomain)\r
25         by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256)\r
26         (Exim 4.69) (envelope-from <jeff@ocjtech.us>)\r
27         id 1NCdQZ-0003va-QL; Mon, 23 Nov 2009 12:14:19 -0600\r
28 From: "Jeffrey C. Ollie" <jeff@ocjtech.us>\r
29 To: Not Much Mail <notmuch@notmuchmail.org>\r
30 Date: Mon, 23 Nov 2009 12:14:15 -0600\r
31 Message-Id: <1259000055-15068-1-git-send-email-jeff@ocjtech.us>\r
32 X-Mailer: git-send-email 1.6.5.2\r
33 In-Reply-To: <1258983810-27522-2-git-send-email-jeff@ocjtech.us>\r
34 References: <1258983810-27522-2-git-send-email-jeff@ocjtech.us>\r
35 Subject: [notmuch] [PATCH] Add tests to configure script to detect strndup\r
36         and getline\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.12\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Mon, 23 Nov 2009 18:14:25 -0000\r
50 \r
51 Add some simple tests to the configure script to detect strndup and\r
52 getline.  It's not important that the tests run, just that they\r
53 compile and link without any errors.\r
54 \r
55 Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>\r
56 ---\r
57  configure     |   20 +++++++++++++++++++-\r
58  getlinetest.c |   13 +++++++++++++\r
59  strnduptest.c |   10 ++++++++++\r
60  3 files changed, 42 insertions(+), 1 deletions(-)\r
61  create mode 100644 getlinetest.c\r
62  create mode 100644 strnduptest.c\r
63 \r
64 diff --git a/configure b/configure\r
65 index b4770ec..44c1700 100755\r
66 --- a/configure\r
67 +++ b/configure\r
68 @@ -118,6 +118,24 @@ EOF\r
69      exit 1\r
70  fi\r
71  \r
72 +if ! gcc -o strnduptest strnduptest.c > /dev/null 2>&1\r
73 +then\r
74 +    echo "Checking for strndup... No."\r
75 +    strndup=-Dstrndup=_notmuch_strndup\r
76 +else\r
77 +    echo "Checking for strndup... Yes."\r
78 +fi\r
79 +rm -f strnduptest\r
80 +\r
81 +if ! gcc -o getlinetest getlinetest.c > /dev/null 2>&1\r
82 +then\r
83 +    echo "Checking for getline... No."\r
84 +    getline=-Dgetline=_notmuch_getline\r
85 +else\r
86 +    echo "Checking for getline... Yes."\r
87 +fi\r
88 +rm -f getlinetest\r
89 +\r
90  cat <<EOF\r
91  \r
92  All required packages were found. You may now run the following\r
93 @@ -132,5 +150,5 @@ EOF\r
94  cat > Makefile.config <<EOF\r
95  prefix = /usr/local\r
96  bash_completion_dir = /etc/bash_completion.d\r
97 -CFLAGS += ${have_valgrind}\r
98 +CFLAGS += ${have_valgrind} ${strndup} ${getline}\r
99  EOF\r
100 diff --git a/getlinetest.c b/getlinetest.c\r
101 new file mode 100644\r
102 index 0000000..2a21a50\r
103 --- /dev/null\r
104 +++ b/getlinetest.c\r
105 @@ -0,0 +1,13 @@\r
106 +#define _GNU_SOURCE\r
107 +#include <stdio.h>\r
108 +#include <sys/types.h>\r
109 +\r
110 +int main()\r
111 +{\r
112 +  ssize_t count = 0;\r
113 +  size_t n = 0;\r
114 +  char **lineptr = NULL;\r
115 +  FILE *stream = NULL;\r
116 +\r
117 +  count = getline(lineptr, &n, stream);\r
118 +}\r
119 diff --git a/strnduptest.c b/strnduptest.c\r
120 new file mode 100644\r
121 index 0000000..97c7c80\r
122 --- /dev/null\r
123 +++ b/strnduptest.c\r
124 @@ -0,0 +1,10 @@\r
125 +#include <string.h>\r
126 +\r
127 +int main()\r
128 +{\r
129 +  char *d;\r
130 +  const char *s = "";\r
131 +  size_t n = 0;\r
132 +\r
133 +  d = strndup(s, n);\r
134 +}\r
135 -- \r
136 1.6.5.2\r
137 \r