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