don't store temporary value returned from c_str()

This is causing problems when compiled by Oracle Studio. Memory pointed
by (const char*)term was already changed once talloc_strdup was called.
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.
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.
gethostbyname: check for libnsl (Solaris support)

Add a check to "configure" to see whether -lnsl is needed for programs
that are using gethostbyname().  This change also adds the file
"compat/check_ghbn.c", which configure uses to perform its check.
configure: check for -Wl,-rpath (Solaris support)

Add a check to "configure" to see whether -Wl,-rpath can be used without
--enable-new-dtags.  Solaris needs the former and doesn't know about the
latter.
install: check for non-SysV version (Solaris support)

Solaris ships a program called "install" in /usr/sbin, which performs a
task that's fairly similar to the GNU and BSD "install" programs but
which uses very different command line arguments.  In particular, if it
is invoked without "-c", "-f", or "-n", it will search the target
directory for a file with the same name as the one being installed, and
it will only install the file if it finds a matching name.  More
excitingly, if it doesn't find a match, it will look in /bin, /usr/bin,
/etc, /lib, and /usr/lib and try to do the same there.

The standard workaround for this is to use GNU install.
It is available via the standard Solaris packaging system (in
"file/gnu-coreutils"), and installs itself as /usr/bin/ginstall.

This patch adds a check to "configure" to see if "install" behaves in a
way that's compatible with GNU and BSD install, and if not, it uses a
program called "ginstall" instead.  It also modifies "configure" to set
the $(INSTALL) variable, and changes various Makefiles to use it.
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).
gen-version-script: parse Solaris "nm" output (Solaris support)

The output of "nm" on Solaris is substantially different from that on
Linux, and the current version of gen-version-script is tied to the
Linux "nm" output.  This patch separates the parts of "nm" processing
which are dependent on the output format into a couple shell functions,
and makes another shell function to use the appropriate version of
"c++filt" to demangle symbols.  It also modifies lib/Makefile.local
to pass the generated symbol table correctly to the Solaris linker.
notmuch-config: use strchr(), not index() (Solaris support)

notmuch-config.c has the only use of the function named "index()" in the
notmuch source.  Several other places use the equivalent function
"strchr()"; this patch just fixes notmuch-config.c to use strchr()
instead.  (Solaris needs to include <strings.h> to get the prototype for
index(), and notmuch-config.c was failing to include that header, so it
wasn't compiling as-is.)
debugger.c: correct return type from getppid() (Solaris support)

Cast the return value of getppid() to "int" from "pid_t" in debugger.c,
since it is being passed to sprintf("%d"), which wants an "int"
argument.  On Solaris, "pid_t" is a "long" for 32-bit programs.
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.

One complication of this fix is that libnotmuch.a includes a call to
parse_time_string() from parse-time-vrp.o, and parse_time_string() in
libparse-time-string.a is the thing which needs to call timegm().  A
straightforward attempt to have the two static libraries reconcile their
symbols from one another fails, because the symbols come from different
.o's, and the linker only does a single pass on each ".a" looking for
dependencies.  To solve this, libparse-time-string includes "compat.h",
and pulls in .o's from the compat directory, in order to get everything
that it needs.
Makefile.local: dependecies compiler flags (Solaris Studio support)

Adds check to "configure" to see whether '-MD -MP -MF' or '-xMD -xMF'
should be used. The change also makes it possible to set the DEPFLAGS
from environment variable similarly to for example CFLAGS.
Replace GNU extension ##__VA_ARGS__ by portable substitution

If you have macro
 #define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
the extension '##' removes preceeding comma ',' if __VA_ARGS__ is empty.
This is however not portable.

The fix uses portable solution described by Richard Hansen:
http://stackoverflow.com/questions/5588855/standard-alternative-to-gccs-va-args-trick
notmuch-new.c: mistakenly used asprintf instead of talloc_asprintf
lib/database.cc: fix declaration and definition discrepancy (Solaris Studio support)

lib/notmuch.h defines all the function in extern "C" { ... } block,
while lib/database.cc does not. This causes problems during linking
because notmuch_database_upgrade is exported in "C" linkage while
notmuch-new.o expects it in "C++" linkage
lib/gen-version-script.sh: standard compliance
lib/Makefile.local: solaris linker has -z defs
lib/gen-version-script.sh: Do not list "FILE" type symbols

Solaris binaries may contain symbols like those:

[1]     |         0|       0|FILE |LOCL |0    |ABS    |getdelim.c

gen-version-script.sh included them into notmuch.sym and the symbols
were then missing during linking.
lib/Makefile.local: missing object files during libnotmuch.a construction

The missing symbols were _internal_error and parse_time_string
lib/Makefile.local: Building static and dynamic library broken

Symlink creation