Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 2e / 2e89fa6eb61fa76bbf3c579802db7b478bdf3f
1 Return-Path: <bremner@tesseract.cs.unb.ca>\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 77955431FBC\r
6         for <notmuch@notmuchmail.org>; Sat,  3 Jan 2015 04:58:49 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id yYshOHJCJB3n for <notmuch@notmuchmail.org>;\r
16         Sat,  3 Jan 2015 04:58:45 -0800 (PST)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id CFC6A431FB6\r
21         for <notmuch@notmuchmail.org>; Sat,  3 Jan 2015 04:58:45 -0800 (PST)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tesseract.cs.unb.ca>)\r
24         id 1Y7OI0-0006EP-MZ; Sat, 03 Jan 2015 08:58:44 -0400\r
25 Received: (nullmailer pid 29779 invoked by uid 1000); Sat, 03 Jan 2015\r
26         12:58:38 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [PATCH 1/2] configure: add check for python interepreter name\r
30 Date: Sat,  3 Jan 2015 13:58:19 +0100\r
31 Message-Id: <1420289900-29717-1-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 2.1.3\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Sat, 03 Jan 2015 12:58:49 -0000\r
46 \r
47 Currently we hardcode "python" in several places. This makes things\r
48 hard for people who have only commands called python3 and/or\r
49 python2. We also add the name to sh.config to eventually replace the\r
50 current workaround in the test suite.\r
51 ---\r
52  configure | 26 ++++++++++++++++++++++++++\r
53  1 file changed, 26 insertions(+)\r
54 \r
55 diff --git a/configure b/configure\r
56 index d14e7d1..5a02de4 100755\r
57 --- a/configure\r
58 +++ b/configure\r
59 @@ -374,6 +374,23 @@ else\r
60      errors=$((errors + 1))\r
61  fi\r
62  \r
63 +printf "Checking for python... "\r
64 +have_python=0\r
65 +\r
66 +for name in python python2 python3; do\r
67 +    if command -v $name > /dev/null 2>&1; then\r
68 +       have_python=1\r
69 +       python=$name\r
70 +       printf "Yes: $name.\n"\r
71 +       break\r
72 +    fi\r
73 +done\r
74 +\r
75 +if [ $have_python -eq 0 ]; then\r
76 +    printf "No.\n"\r
77 +    errors=$((errors + 1))\r
78 +fi\r
79 +\r
80  printf "Checking for valgrind development files... "\r
81  if pkg-config --exists valgrind; then\r
82      printf "Yes.\n"\r
83 @@ -522,6 +539,9 @@ need to install the following packages before being able to compile\r
84  notmuch:\r
85  \r
86  EOF\r
87 +    if [ $have_python -eq 0 ]; then\r
88 +       echo "  python interpreter"\r
89 +    fi\r
90      if [ $have_xapian -eq 0 ]; then\r
91         echo "  Xapian library (including development files such as headers)"\r
92         echo "  http://xapian.org/"\r
93 @@ -787,6 +807,9 @@ WARN_CXXFLAGS=${WARN_CXXFLAGS}\r
94  # Flags to enable warnings when using the C compiler\r
95  WARN_CFLAGS=${WARN_CFLAGS}\r
96  \r
97 +# Name of python interpreter\r
98 +PYTHON = ${python}\r
99 +\r
100  # The prefix to which notmuch should be installed\r
101  # Note: If you change this value here, be sure to ensure that the\r
102  # LIBDIR_IN_LDCONFIG value below is still set correctly.\r
103 @@ -958,6 +981,9 @@ NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}\r
104  # Whether there's either sphinx or rst2man available for building\r
105  # documentation\r
106  NOTMUCH_HAVE_MAN=$((have_sphinx || have_rst2man))\r
107 +\r
108 +# Name of python interpreter\r
109 +NOTMUCH_PYTHON=${python}\r
110  EOF\r
111  \r
112  # Finally, after everything configured, inform the user how to continue.\r
113 -- \r
114 2.1.3\r
115 \r