]> git.notmuchmail.org Git - notmuch/blob - configure
configure: Clean up the introductory message a bit.
[notmuch] / configure
1 #! /bin/sh
2
3 cat <<EOF
4 Welcome to Notmuch, a system for indexing, searching and tagging your email.
5
6 We hope that the process of building and installing notmuch is quick
7 and smooth so that you can soon be reading and processing your email
8 more efficiently than ever.
9
10 If anything goes wrong in the configure process, you can override any
11 decisions it makes by manually editing the Makefile.config file that
12 it creates. Also please do as much as you can to figure out what could
13 be different on your machine compared to those of the notmuch
14 developers. Then, please email those details to the Notmuch list
15 (notmuch@notmuchmail.org) so that we can hopefully make future
16 versions of notmuch easier for you to use.
17
18 We'll now investigate your system to verify that all required
19 dependencies are available:
20
21 EOF
22
23 errors=0
24
25 if pkg-config --version > /dev/null 2>&1; then
26     have_pkg_config=1
27 else
28     have_pkg_config=0
29 fi
30
31 if xapian-config --version > /dev/null 2>&1; then
32     echo "Checking for Xapian development files... Yes."
33     have_xapian=1
34 else
35     echo "Checking for Xapian development files... No."
36     have_xapian=0
37     errors=$((errors + 1))
38 fi
39
40 if pkg-config --modversion gmime-2.4 > /dev/null 2>&1; then
41     echo "Checking for GMime 2.4 development files... Yes."
42     have_gmime=1
43 else
44     echo "Checking for GMime 2.4 development files... No."
45     have_gmime=0
46     errors=$((errors + 1))
47 fi
48
49 if pkg-config --modversion talloc > /dev/null 2>&1; then
50     echo "Checking for talloc development files... Yes."
51     have_talloc=1
52 else
53     echo "Checking for talloc development files... No."
54     have_talloc=0
55     errors=$((errors + 1))
56 fi
57
58 if pkg-config --modversion valgrind > /dev/null 2>&1; then
59     echo "Checking for valgrind development files... Yes."
60     have_valgrind=-DHAVE_VALGRIND
61 else
62     echo "Checking for valgrind development files... No."
63     have_valgrind=
64 fi
65
66 if [ $errors -gt 0 ]; then
67     cat <<EOF
68
69 *** Error: The dependencies of notmuch could not be satisfied. You will
70 need to install the following packages before being able to compile
71 notmuch:
72
73 EOF
74     if [ $have_xapian -eq 0 ]; then
75         echo "  Xapian library (including development files such as headers)"
76         echo "  http://xapian.org/"
77     fi
78     if [ $have_gmime -eq 0 ]; then
79         echo "  GMime 2.4 library (including development files such as headers)"
80         echo "  http://spruce.sourceforge.net/gmime/"
81     fi
82     if [ $have_talloc -eq 0 ]; then
83         echo "  The talloc library (including development files such as headers)"
84         echo "  http://talloc.samba.org/"
85     fi
86     cat <<EOF
87
88 On a modern, package-based operating system such as Debian, you can
89 install all of the dependencies with the following simple command
90 line:
91
92         sudo apt-get install libxapian-dev libgmime-2.4-dev libtalloc-dev
93
94 On other systems, a similar command can be used, but the details of the 
95 package names may be different, (such as "devel" in place of "dev").
96
97 EOF
98     if [ $have_pkg_config -eq 0 ]; then
99 cat <<EOF
100 Note: the pkg-config program is not available. Both this configure
101 script and the Makefile of notmuch use pkg-config to find the
102 compilation flags required to link against the various libraries
103 needed by notmuch. It's possible you simply need to install pkg-config
104 with a command such as:
105
106         sudo apt-get install pkg-config
107
108 But if pkg-config is not available for your system, then you will need
109 to manually edit the notmuch Makefile to set NOTMUCH_CFLAGS and
110 NOTMUCH_LDFLAGS to the correct values without calling pkg-config.
111
112 EOF
113     fi
114 cat <<EOF
115 When you have installed the necessary dependencies, you can run
116 configure again to ensure the packages can be found, or simply run
117 "make" to compile notmuch.
118
119 EOF
120     exit 1
121 fi
122
123 cat <<EOF
124
125 All required packages were found. You may now run the following
126 commands to compile and install notmuch:
127
128         make
129         sudo make install
130
131 EOF
132
133 # construct the Makefile.config
134 cat > Makefile.config <<EOF
135 prefix = /usr/local
136 bash_completion_dir = /etc/bash_completion.d
137 CFLAGS += ${have_valgrind}
138 EOF