Commit graph

191 commits

Author SHA1 Message Date
Tomi Ollila
2ee9351224 configure: combine common parts of CONFIGURE_C{,XX}FLAGS
By combining the common parts of CONFIGURE_CFLAGS and CONFIGURE_CXXFLAGS
to a separate make variable and using that as part of their
definitions makes setting of these easier, DRYer and less error prone
(especially as we cannot check potential typing errors there).
2016-05-19 07:45:09 -03:00
David Bremner
1aa6f90a10 configure: check directly for xapian compaction API
This is consistent with the check for FieldProcessor, and probably a bit
more robust.
2016-05-13 20:50:49 -03:00
David Bremner
1871be319a configure: detect Xapian:FieldProcessor
Rather than check versions, it seems more robust to do a test compile.
2016-05-08 08:17:07 -03:00
Tomi Ollila
124a67e96e configure: add set -u
In case of any unset variable, make ./configure exit with nonzero value;
an attempt to expand an unset variable is a bug in the script
(usually a spelling mistake) and those should not pass through
unnoticed.
2016-05-07 14:40:14 -03:00
Tomi Ollila
43eb32527b configure: replace ${CXXLAGS} with ${CXXFLAGS_for_sh}
Variable CXXLAGS expands to nothing, CXXFLAGS something unusable
here; CXXFLAGS_for_sh expands to what we expect here.
2016-05-07 14:38:01 -03:00
Jani Nikula
2c1a7321e9 configure: SC2016: Expressions don't expand in single quotes
Fix shellcheck warnings. Use double quotes but escape $ to make it
look more intentional.
2016-05-01 21:21:53 -03:00
Jani Nikula
b191de511e configure: SC2034: glib_cflags and glib_ldflags appear unused.
Fix shellcheck warnings.
2016-05-01 21:21:39 -03:00
Jani Nikula
8a75fcfa7b configure: SC2059: Don't use variables in the printf format string.
Fix shellcheck warnings. Use printf "..%s.." "$foo".
2016-05-01 21:20:54 -03:00
Jani Nikula
2b7b32fc47 configure: SC2006: Use $(..) instead of legacy ..
Fix shellcheck warnings.
2016-05-01 21:20:05 -03:00
David Bremner
deb4e5567c configure: add test for default xapian backend
This is mainly for the test suite.  We already expect the tests to be
run in the same environment as configure was run, at least to get the
name of the python interpreter. So we are not really imposing a new
restriction.
2016-04-12 20:14:43 -03:00
David Bremner
d93d3779b8 configure: autodetect xapian-1.3
Mimic the handling of python2 versus python3. In particular if both
xapian-config and xapian-config-1.3 are found, use xapian-config
2016-04-01 18:29:52 -03:00
Tomi Ollila
79856189a2 configure: pass HAVE_TIMEGM to build
Checking the existence of timegm() function and setting
configure internal variable ${have_timegm} was done, but
actually defining HAVE_TIMEGM in build was not done --
meaning that compat timegm() was always part of final
notmuch binaries.
2016-02-13 12:32:20 -04:00
David Bremner
88c0bc4cc6 configure: drop use of "pkg-config emacs"
This does not play well with --prefix. As Tomi notes in
id:m2k2p2rwth.fsf@guru.guru-group.fi, people still have the option of e.g.

% ./configure ---emacslispdir=`pkg-config emacs --variable sitepkglispdir`
2015-12-06 12:06:11 -04:00
David Bremner
005c2f0df1 cli/lib: remove support for GMime 2.4
It's becoming a maintenance burden to do anything things with the
crypto glue code twice, once for 2.4 and once for 2.6. I don't have
any 2.4 version available to test on my development machine anymore,
so the 2.4 specific code paths are likely not very well tested.
2015-08-26 20:01:45 -03:00
Jani Nikula
c9e1c4f1c4 configure: clean up messages around reading libnotmuch version
Clean up punctuation for consistency, and add newline for clean
configure output.
2015-08-10 21:24:40 +02:00
David Bremner
765556c1f1 build: extract library versions from notmuch.h
- Make lib/notmuch.h the canonical location for the library versioning
information.

- Since the release-check should never fail now, remove it to reduce
complexity.

- Make the version numbers in notmuch.h consistent with the (now
  deleted) ones in lib/Makefile.local
2015-08-10 13:53:55 +02:00
David Bremner
23d86773b9 test: use the python interpreter in sh.config
The configure script chooses "python" if both python and python{2,3}
exist exists, so this could change the version of python used to run
the test suite.

The checking for ${NOTMUCH_PYTHON} in the test suite is arguably
over-engineering, since the configure step will fail if it can't find
it.
2015-08-04 09:19:18 +02:00
David Bremner
2eb558fd9b configure: support --without-ruby
Apparently some ruby installs are broken in ways that prevent the ruby
bindings from building.
2015-07-30 08:16:29 +02:00
David Bremner
a57b3d4303 configure: support --with-docs=no
Since we promise --with-foo=no is equivalent to --without-foo
2015-07-30 08:08:31 +02:00
David Bremner
a63b5db873 configure: alphabetize --without help
Now that the "without" options seem to be multiplying, try to make it
easier for people to find the one they want.
2015-07-30 08:00:55 +02:00
David Bremner
b4e0c8320a configure: fix typo in comment
Some lazy person, probably me, forgot to press shift.
2015-07-30 07:57:04 +02:00
David Bremner
1fef811fd7 configure: whitespace cleanup
This is the result of running M-x whitespace-cleanup in emacs.  In
particular this replaces some spaces at the beginning of lines with
tabs.
2015-07-28 15:29:38 +02:00
Mikhail
edb485e0b9 configure: add --without-docs switch
Previously documentation was build automatically if sphinx/doxygen
executable were found. The switch is used to unconditionally disable
sphinx/doxygen detection and therefor, building of documentation
(including man pages).
2015-07-27 22:34:38 +02:00
David Bremner
53035dafe0 lib, ruby: make use of -Wl,--no-undefined configurable
In particular this is supposed to help build on systems (presumably
using a non-gnu ld) where this flag is not available.
2015-06-13 17:52:48 +02:00
David Bremner
d038b93209 build: integrate building ruby bindings into notmuch build process
Because ruby generates a Makefile, we have to use recursive make.
Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
in the parent directory.
2015-06-12 09:12:28 +02:00
David Bremner
98b6638a7a configure: add ability to force python version via environment
This is makes it a bit easier to run our test suite under alternative
python versions.
2015-06-08 16:42:01 +02:00
David Bremner
ccd7c0b0e6 configure: Add sanity checking for environment variables
Passing in environment variables incompatible with the compiler may
cause other parts of the configure script to fail in hard to
understand ways, so we abort early.
2015-05-23 20:28:06 +02:00
Tomi Ollila
91ef2ae524 configure: consistent command -v usage
When the shell builtin `command -v` operates normally, it either
prints the path of the arg given to it and returns zero -- or it
returns nonzero and prints nothing.
In abnormal situations something might be printed to stderr and
in that case we want to know about it; therefore the used
command -v stderr redirections to /dev/null have been removed.

The `hash` (builtin) command in ksh returns zero even the arg
given to is is not found in path. For that and for consistency
the one appearance of it has been converted to `command -v`.
2015-02-19 19:14:29 +01:00
David Bremner
d241a486fa doc: remove support for rst2man
It was becoming increasingly complicated to support rst2man, and there
were apparently not many people that relied on it.
2015-01-22 08:37:25 +01:00
David Bremner
bd96b4c4ba configure: add check for python interepreter name
Currently we hardcode "python" in several places. This makes things
hard for people who have only commands called python3 and/or
python2. We also add the name to sh.config to eventually replace the
current workaround in the test suite.
2015-01-03 16:40:43 +01:00
Tomi Ollila
96988e35c7 configure: move make {,install} instructions to the end
There was theorical possibility that writing the config files could
have skipped (by interruption) after the instructions how to make
notmuch was printed out.
2014-11-02 19:40:05 +01:00
David Bremner
68dd804544 configure: add debug flags by default.
This makes development (in particular the test suite) easier. Those
concerned about the extra diskspace can override the default or use
strip.
2014-10-05 07:27:49 +02:00
Jani Nikula
57540a1952 build: generate sh.config for feeding configure results to shell scripts
Only include the relevant information.

Amended by David Bremner:

	Use a prefix NOTMUCH_ to minimize collisions with other
	variables.
2014-07-13 12:15:47 -03:00
David Bremner
1022433551 doc: build and install doxygen api docs
In order to support out of tree builds and avoid hardcoding version
number, generate `doc/config.dox` from configure.
2014-07-09 19:32:15 -03:00
Fraser Tweedale
0e50854a7f configure: use cc/c++ instead of gcc/g++
Some systems (e.g. FreeBSD 10) do not ship with the GNU Compiler
Collection.  Use generic cc/c++ instead of gcc/g++ (unless the
CC/CXX environment variables are used).
2014-07-04 08:56:32 -03:00
Felipe Contreras
0c698ef037 configure: add workaround for systems without zlib.pc
Some systems (e.g. FreeBSD) might not have installed the appropriate
pkg-config file as they should. We can workaround the issue by creating
the .pc file they should have distributed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-06-21 16:40:39 -03:00
David Bremner
2d024ff48c configure: fix comment, pass HAVE_CANONICALIZE_FILE_NAME to build
Apparently omitting it is not fatal, but let's be consistent with the
other compat functions.
2014-04-19 05:58:59 +09:00
Tomi Ollila
3921d2345a configure: add $(ZLIB_CFLAGS) to CONFIGURE_CFLAGS
As it is defined in CONFIGURE_CXXFLAGS.
2014-04-13 08:42:38 -03:00
David Bremner
3c13bc0321 dump: support gzipped and atomic output
The main goal is to support gzipped output for future internal
calls (e.g. from notmuch-new) to notmuch_database_dump.

The additional dependency is not very heavy since xapian already pulls
in zlib.

We want the dump to be "atomic", in the sense that after running the
dump file is either present and complete, or not present.  This avoids
certain classes of mishaps involving overwriting a good backup with a
bad or partial one.
2014-04-12 07:59:44 -03:00
David Bremner
af5c3afa91 compat: add canonicalize_file_name
the POSIX 2008 behaviour of realpath is not available everywhere so we
provide a simple wrapper function.  We use (and provide) the gnu
extension canonicalize_file_name to make it cleaner to test for the
feature we need; otherwise we have to rely on realpath segfaulting if
the second argument is null.
2014-04-08 07:27:14 -03:00
David Bremner
57b4ef6f30 doc: fix out-of-tree build
The subtle part is adding .rst and .py files to vpath so they can be
used as dependencies without prefixing with $(srcdir)

We also change the interface to mkbuildeps.py: rather than getting the
containing directory from the conf file path, we go the other way.
2014-03-25 08:32:10 -03:00
David Bremner
26556f9b11 build: move canonical list of subdirectories to configure script
The configure script needs this list for out of tree builds. Grabbing
it from the Makefile via sed was fragile and broken.
2014-03-25 08:32:10 -03:00
David Bremner
beef0a8f55 doc: configure detection of sphinx and rst2man
Because sphinx-build does not provide a convenient way of listing
which builders exist, and some people actually have pre 1.0 sphinx, we
try loading a relevant python module.

Currently the assumption is that no python in path -> no sphinx-build
in path.
2014-03-18 07:39:32 -03:00
Austin Clements
b1fa95721b new: Detect dirent.d_type support at configure time
Support for dirent.d_type is OS-specific.  Previously, we used
_DIRENT_HAVE_D_TYPE to detect support for this, but this is apparently
a glic-ism (FreeBSD, for example, supports d_type, but does not define
this).  Since there's no cross-platform way to detect support for
dirent.d_type, detect it using a test compile at configure time.
2014-02-14 08:42:45 -04:00
Jani Nikula
aff5af582e configure: only install bash completion if supported
Our bash completion depends on bash-completion 1.90 or later. Only
install where available.
2014-02-03 16:19:08 -04:00
David Bremner
b9f0e6923d util: detect byte order
Unfortunately old versions of GCC and clang do not provide byte order
macros, so we re-invent them.

If UTIL_BYTE_ORDER is not defined or defined to 0, we fall back to
macros supported by recent versions of GCC and clang
2013-11-27 07:43:29 -04:00
Ben Gamari
0bd11b654e database: Add notmuch_database_compact_close
This function uses Xapian's Compactor machinery to compact the notmuch
database. The compacted database is built in a temporary directory and
later moved into place while the original uncompacted database is
preserved.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
2013-10-09 21:46:49 -03:00
Blake Jones
8c6b2e7e9d timegm: add portable implementation (Solaris support)
The timegm(3) function is a non-standard extension to libc which is
available in GNU libc and on some BSDs.  Although SunOS had this
function in its libc, Solaris (unfortunately) removed it.  This patch
implements a very simple version of timegm() which is good enough for
parse-time-string.c.

Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
2013-08-23 17:57:35 +02:00
Blake Jones
43843745dc strsep: check for availability (Solaris support)
Solaris does not ship a version of the strsep() function.  This change
adds a check to "configure" to see whether notmuch needs to provide its
own implementation, and if so, it uses the new version in
"compat/strsep.c" (which was copied from Mutt, and apparently before
that from glibc).

Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
2013-08-23 17:55:39 +02:00
Vladimir Marek
49a0b96486 asctime: check for standards compliance (Solaris support)
Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs
to be defined to get the right number of arguments in the prototypes for
asctime_r().  Solaris' default implementation conforms to POSIX.1c
Draft 6, rather than the final POSIX.1c spec.  The standards-compliant
version can be used by defining _POSIX_PTHREAD_SEMANTICS.

This change also adds the file "compat/check_asctime.c", which
configure uses to perform its check, and modifies compat/compat.h to
define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.

Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
2013-08-23 17:55:23 +02:00
Blake Jones
31c7001c99 getpwuid: check for standards compliance (Solaris support)
Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs
to be defined to get the right number of arguments in the prototypes for
getpwuid_r().  Solaris' default implementation conforms to POSIX.1c
Draft 6, rather than the final POSIX.1c spec.  The standards-compliant
version can be used by defining _POSIX_PTHREAD_SEMANTICS.

This change also adds the file "compat/check_getpwuid.c", which
configure uses to perform its check, and modifies compat/compat.h to
define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.

Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
2013-08-23 17:53:17 +02:00
David Bremner
51b14fb3c3 configure: grab CPPFLAGS from the environment.
This is needed in particular for hardening flags.
2013-06-02 20:45:56 -03:00
David Bremner
3c6b2d5071 configure: really expand libdir_expanded
It turns out that if people really use configure in autotools style and pass
libdir containing '${prefix}/foo' then the ldconfig previously failed.

This uses sed for portability (versus bash parameter expansion with
substitution) and hopefully a bit more robustness than blindly
parameter expanding the string.
2012-12-01 08:04:30 -04:00
Jani Nikula
c158201ee2 build: drop the -Wswitch-enum warning
-Wswitch-enum is a bit awkward if a switch statement is intended to
handle just some of the named codes of an enumeration especially, and
leave the rest to the default label.

We already have -Wall, which enables -Wswitch by default, and per GCC
documentation, "The only difference between -Wswitch and this option
[-Wswitch-enum] is that this option gives a warning about an omitted
enumeration code even if there is a default label."

Drop -Wswitch-enum to not force listing all named codes of
enumerations in switch statements that have a default label.
2012-10-31 16:39:25 -03:00
Austin Clements
b04c062aee Support OpenBSD
OpenBSD's build flags are identical to FreeBSD, except that libraries
need to be explicitly linked against libc.  No code changes are
necessary.

From: Cody Cutler <ccutler@csail.mit.edu>
2012-10-27 09:35:47 -03:00
Mike Kelly
df6f3cdf9d configure: Add support for FreeBSD.
This makes FreeBSD a recognized platform. Follow up patches make it
work properly.
2012-09-01 23:15:53 -03:00
Tomi Ollila
4cedb2a3ea configure: check whether shell is capable of parameter substring processing
'configure' script uses parameter substring extensively. It is Posix shell
feature. Original Bourne shell does not have such features. Some systems
still ships such shells as /bin/sh (for compatibility reasons -- shell
scripts written on those platforms are expected to work on 1990's systems).

Just testing whether parameter substring processing works will make the
shell exit due to syntax error if it is not compatible. Therefore the test
is executed in a subshell -- subshell exits with nonzero value when the
operation in question fails.

As 'if ! ...' does not work in Bourne shell, Short-circuiting construct
'||' is used to print information message and exit when expected.
2012-07-25 08:17:24 -03:00
Jameson Graef Rollins
12772b6762 config: add quoting to fix IFS bug
Without proper quoting the DEFAULT_IFS was getting set incorrectly,
which was causing problems with the storage of some variables later in
the script.  Quoting fixes the problem.
2012-06-03 13:26:44 -03:00
Jameson Graef Rollins
fae97b1013 configure: add help note about gmime version 2012-05-25 21:40:55 -03:00
David Bremner
6acd61dad9 configure: change gmime version in help message to 2.6
Since GMime 2.6 is now the stable version upstream, and probably the
most tested by notmuch developers, it makes sense to suggest that to
users to install.
2012-04-05 08:01:32 -03:00
Tomi Ollila
3c7d97c3c7 configure: print info about required gmime 2.4 or 2.6 versions
In case required gmime (2.4 or 2.6) version if not found print information
about both alternatives (and currently minimal 2.6 version that is needed).
2012-04-05 07:53:04 -03:00
Tomi Ollila
e8138c522b configure: add empty line after each missing component message
Currently whenever message about missing GMime, Glib or talloc is
printed the message is 2 lines, component info and its http location
in next line. In the future the amount of lines will vary. To ease
reading in these cases newline is added after each message.
2012-04-05 07:50:51 -03:00
Tomi Ollila
8bf1842b19 Allow selecting which version of gmime is used to build notmuch.
This allows for testing against both versions of gmime on a single
machine, without having to mess with pkg-config paths.

This is rework of Tom Prince's patch submitted in
id:"1331402091-15663-1-git-send-email-tom.prince@ualberta.net"
2012-03-20 08:11:27 -03:00
Tomi Ollila
1ef9f769d7 configure: store $IFS to $DEFAULT_IFS readonly variable
In the future, IFS value needs to be changed in a few places
in configure -- and then restored. Store the original value
to $DEFAULT_IFS for easy restoration.
2012-03-20 08:10:57 -03:00
Justus Winter
1984a26646 Do not try to parse the options for --build and --host arguments
Formerly the code assumed the arguments to be triples and threw an
error if this was not the case. But those arguments are only there for
compatibility with autotools and are not used within the build system,
so just dropping the code parsing these values makes the build system
more robust.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-03-20 08:10:57 -03:00
Justus Winter
524f01a7b5 Add GNU as a valid platform
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-03-20 08:10:57 -03:00
Thomas Jost
f34613ea83 build: Require gmime >= 2.6.7
gmime-2.6 had a bug [1] which made it impossible to tell why a signature
verification failed when the signer key was unavailable (empty "sigstatus" field
in the JSON output). Since 00b5623d the corresponding test is marked as broken
when using gmime-2.6 (2.4 is fine).

This bug has been fixed in gmime 2.6.5, which is now the minimal gmime-2.6
version required for building notmuch (gmime-2.4 is still available). As a
consequence the version check in test/crypto can be removed.

[Added by db]

Although less unambigously a bug, Gmime 2.6 prior to 2.6.7 also was
more strict about parsing, and rejected messages with initial "From "
headers.  This restriction is relaxed in [2].  For reasons explained in [3],
we want to keep this more relaxed parsing for now.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=668085

[2] http://git.gnome.org/browse/gmime/commit/?id=d311f576baf750476e06e9a1367a2dc1793ea7eb

[3] id:"1331385931-1610-1-git-send-email-david@tethera.net"
2012-03-11 22:13:48 -03:00
Jameson Graef Rollins
4d136995ce Fix configure script to properly detect gmime-2.6 if available.
Previously, the configure script would appear to detect gmime-2.6 if
present.  However, the binaries would end up being compiled against
gmime-2.4.  The addition of a break fixes things so that now gmime-2.6
will be used if available, falling back to gmime-2.4.
2012-03-10 21:39:13 -04:00
Pieter Praet
b44b344595 configure: update explicit check for glib : >= 2.22
As of commit b3caef1f, we're using g_array_unref() in 'lib/query.cc',
which was only introduced in glib 2.22, so update the dependency.

Thanks to datapipe@gmail.com for reporting this [1].

Also see commit b88e6abc.

[1] id:"alpine.DEB.2.02.1201132130220.21970@ltspubuntu4.int.smq.datapipe.net"
2012-02-03 21:10:55 -04:00
Amadeusz Żołnowski
e6d85fb97d Separate Emacs misc. files dir. from Emacs code dir.
New option --emacsetcdir was added, but it's set default to the same
value as --emacslispdir for backward compatibility.
2011-10-28 14:07:44 -03:00
Pieter Praet
730acd4764 fix sum moar typos [build scripts, Makefiles]
Various typo fixes in comments within the Makefile and other build scripts.

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just build files.
2011-06-23 15:44:59 -07:00
Carl Worth
574f408816 configure: Fix detection of libdir in ldconfig configuration
Ever since commit b4b5e9ce4d the
detection of libdir in the ldconfig configuration has been broken,
resulting in RPATH being set when not needed and not wanted.

The cause was a change from an IFS setting of:

	IFS="$(printf '\n\t')"

to a new setting of:

	IFS="$(printf '\n')"

That looks desirable since we want to split the output of ldconfig
based on newlines, (and not split on any filename that might have an
embedded tab in it). The subtle bug in the above is that the shell
trims any trailing newlines when performing command substitution so
the final statement above was equivalent to:

	IFS=''

which prevented any splitting of the ldconfig output at all.

Fix this by avoiding command substitution and just using a literal
newline in the source file for setting this variable.
2011-06-01 13:02:58 -07:00
Carl Worth
2d6718b837 build: Save configure options and re-use them for automatic runs of configure
This supports the case of a user running "configure --prefix=/foo" then later
updating the soruce (including the configure script) and re-running make.

In this case, the make invocation will re-run configure. Before this change,
this run of configure would lose the user's carefully chosen prefix. This
is now fixed so that configrue is re-run with the user's options.
2011-03-10 11:30:06 -08:00
Carl Worth
3e4a9d60a9 build: Add support for non-source-directory builds.
Such as:

     mkdir build
     cd build
     ../configure
     make

This is implemented by having the configure script set a srcdir
variable in Makefile.config, and then sprinkling $(srcdir) into
various make rules. We also use vpath directives to convince GNU make
to find the source files from the original source directory.
2011-03-09 15:10:03 -08:00
Michal Sojka
b4b5e9ce4d configure: Drop global setting of IFS (without space in it).
This was originally intended to help support filenames with spaces in
them, but this actually breaks things when someone sets a command with
a space in it, (such as CC="ccache cc").

Instead, we now only set a custom IFS when acting on the
newline-separated list of files from /sbin/ldconfig.
2011-01-26 23:29:03 +10:00
Cédric Cabessa
26b4cc4aad configure: add options to disable emacs/zsh/bash and choose install dir.
add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
installation dir for bash/zsh completion files

Make some features optional:
  --without-emacs / --with-emacs=no do not install lisp file
  --without-bash-completion / --with-bash-completion=no  do not install bash
files
  --without-zsh-completion / --with-zsh-completion=no do not install zsh files
By default, everything is enabled. You can reenable something with
  --with-feature=yes
2011-01-26 22:30:32 +10:00
Carl Worth
b88e6abccd configure: Add explicit check for glib >= 2.14
For cases where GMime is present, but happy with glib 2.12, for example.
2010-11-16 09:00:34 -08:00
Carl Worth
8df28ec509 configure: Use pkg-config --exists rather than --modversion
With --modversion we were asking for output that we were just throwing
away anyway. The --exists option does just what we want, (no output
and communivating only via return value).

Also, --exists allows for testing versions of the package as well.
2010-11-16 08:51:50 -08:00
Carl Worth
6b9a717c26 configure: Add a check for the -Wl,--as-needed flag.
This fits with our general build philosophy of checking at configure
time for desired support, (rather than putting platform-specific
conditionals into our Makefiles).
2010-10-30 13:20:33 -07:00
Carl Worth
e94db26c5c fixup 2010-10-30 13:16:50 -07:00
Carl Worth
660510ee4c configure: Remove a debugging print message.
This was never intended to be committed.
2010-10-30 13:15:00 -07:00
Carl Worth
8753b9defa configure: Test for flag to set rpath
This is better than the previous approach which had a hardcoded Linux-specific
value in the Makefile.
2010-10-30 13:15:00 -07:00
Carl Worth
b802c18d3b configure: Test for each compiler warning before enabling it.
This should allow the build to be much more automatically portable
to compilers with different sets of warning options.
2010-10-30 13:11:56 -07:00
Carl Worth
6e3007bec0 configure: Set XAPIAN_CONFIG to only "xapian-config" by default.
Previously, we preferred a value of "xapian-config-1.1" first. This
was convenient for compiling against Xapian 1.1 while Xapian 1.2 was
unreleased. But now that Xapian 1.2 is realease, and since it ships a
xapian-config, the xapian-config-1.1 value can mask the newer library.

Instead of trying to track the latest xapian-config-1.x in our
configure script let's simply expect the user to set
XAPIAN_CONFIG=xapian-config-1.x in order to compile against an
unreleased Xapian.
2010-10-29 14:49:20 -07:00
Felipe Contreras
9d9668e3e7 configure: optimize uname finding a bit
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2010-10-29 14:33:14 -07:00
Carl Worth
d64d0cc8d9 make install: Run ldconfig or install a DT_RUNPATH in binary as appropriate.
Various users were confused as to why they couldn't run notmuch
immediately after "make install", (with linker errors saying that
libnotmuch.so could not be found). The errors came from two different
causes:

1. The user had installed to a system library directory, but had not
   yet run ldconfig.

2. The user had installed to some non-system directory, and had not
   set the LD_LIBRARY_PATH variable.

With this change we fix both problems (on Linux) without the user
having to do anything additional. We first use ldconfig to find the
system library directories. If the user is installing to one of these,
then we run ldconfig as part of "make install".

For case (2) we use the -rpath and --enable-new-dtags linker options
to install a DT_RUNPATH entry in the binary. This entry tells the
dynamic linker where to find libnotmuch. Without the
--enable-new-dtags option only a DT_RPATH option would be installed,
(which has the drawback of not allowing any override with the
LD_LIBRARY_PATH variable).

Distributions (such as Debian and Fedora) don't want to see binaries
packaged with a DT_RPATH or DT_RUNPATH entry. This should be avoided
automatically as long as the packages install to standard locations,
(such as /usr/lib).
2010-06-04 16:52:56 -07:00
Carl Worth
b3076ed269 configure: Remove space from IFS (using tab as necessary)
The idea here is to more easily support filenames with spaces in them
in various loops. We're about to add a loop over the paths configured
by the dynamic linker. Hopefully, they wouldn't contain spaces, but
one never knows so we might as well be prepared.
2010-06-04 16:51:32 -07:00
Tomas Carnecky
a54cecfc8e Add support for the Solaris platform
Like on Mac OS X, the linker doesn't automatically resolve dependencies.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
2010-06-03 18:17:03 -07:00
Tomas Carnecky
80d5d162be configure: Respect LDFLAGS from the environment.
The configure usage string documents that it respects LDFLAGS, but
currently it doesn't do anything with the configure-time LDFLAGS
value.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
[Tomas and Nelson sent almost identical patches which I've merged
together here.]
2010-06-03 18:16:11 -07:00
Cédric Cabessa
42bda003a0 configure: add ignored options for compatibility.
gentoo's ebuild script expects 2 more options for configure:
  --host (same format as --build)
  --datadir
2010-04-26 07:18:21 -07:00
Carl Worth
2186cac8e7 configure: Print version of Xapian found during configure check.
This might be handy to know, (since there are important performance
considerations that depend on the Xapian version).
2010-04-21 14:18:56 -07:00
Carl Worth
cbcc3454ae configure: Generalize the GMime configure checks.
This way when GMime 2.8 comes out we can simply add it to the list
rather than adding an additional block of conditional code for it.
Also GMime 2.6 is now preferred over GMime 2.4.
2010-04-21 14:17:14 -07:00
Adrien Bustany
65b634145a configure: Add support for GMime 2.6
Notmuch compiles just fine with GMime 2.6, so accept it in the configure
script.
2010-04-21 14:17:14 -07:00
Gregor Hoffleit
18433e4aff configure: Fix syntax error (spaces in assignment).
Before and after the assignment operator, no spaces are allowed.
I don't know if there are any /bin/sh which allow spaces, but at least
in bash, csh and zsh, the former code was no valid assigment.
2010-04-15 19:45:11 -07:00
Carl Worth
3d7af74ce5 Makefile: Fix final linking of notmuch binary for OS X.
Apparently the OS X linker can't resolve symbols when linking a
program (notmuch) against a library (libnotmuch) when the library
depends on another library (libgmime) that the program doesn't depend
on directly.

For this case, we need to link the program directly against both
libraries, but we don't want to do this on Linux, where the linker can
do this on its own and the explicit, unneeded link would cause
problems.
2010-04-14 16:29:50 -07:00
Aaron Ecay
8c8079a8b1 Add infrastructure for building shared library on OS X.
This patch adds a configure check for OS X (actually Darwin),
and sets up the Makefiles to build a proper shared library on
that platform.

Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
2010-04-14 16:10:27 -07:00
Dirk Hohndel
d09154465a Add simplistic reimplementation of strcasestr to compat library
While all systems that I have access to support strcasestr, it is
in fact not part of POSIX. So here's a fallback reimplementation
based on POSIX functions.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>

Tested-by: Tomas Carnecky <tom@dbservice.com> (on OpenSolaris snv_134)
2010-04-14 11:34:12 -07:00
Mike Kelly
37b8f5a8f2 Fix the default value for --includedir. 2010-04-07 16:00:48 -07:00
Carl Worth
a7a961c510 Makefile: Install emacs code to site-lisp, not site-lisp/notmuch
And just make the Debian packaging request site-lisp/notmuch like it
wants. Otherwise, the installed files won't appear on the load-path
so won't be found by emacs.
2010-04-07 10:09:35 -07:00
Carl Worth
dfbec15b23 Install emacs lisp files into a notmuch sub-directory of site-lisp.
Now that we have multiple emacs-lisp source files, it's just more
polite this way.
2010-04-06 18:30:43 -07:00