test: Only build death tests on platforms that support them

googletest does not support death tests on FreeBSD.  I've submitted a
patch upstream that trivially enables support, but in the meantime we
can't compile death tests for Ceph on FreeBSD.

https://groups.google.com/forum/#!topic/googletestframework/tjY6UjWgNOw

Signed-off-by: Alan Somers <asomers@gmail.com>
test: On FreeBSD, must include sys/socket.h to define AF_INET

Signed-off-by: Alan Somers <asomers@gmail.com>
test: Use a portable syntax for seq(1)

Use a portable syntax for seq(1).  GNU seq has a default INCR of 1, but
BSD seq has a default INCR of either +1 or -1, depending on the other
arguments.  INCR must be explicitly specified for portability.

This bug is the reason that I was running into the segfaults whose
fix I reported as BUG #6510.

Signed-off-by: Alan Somers <asomers@gmail.com>
test: Change interpreter from /bin/bash to /bin/sh

Change interpreter from /bin/bash to /bin/sh.  bash is not guaranteed
to be installed on all Unix systems, and it's not guaranteed to be
installed into /bin either.

There are other scripts that specify /bin/bash; they need to be
examined one by one to look for bashisms.  This was the only one I had
to modify to get unit tests working.

Signed-off-by: Alan Somers <asomers@gmail.com>
xattr: xattr.c needs errno.h to use errno

A previous version of wip-port included errno.h on FreeBSD in xattr.c.
However, the version as of 2013-09-30 significantly refactored that file
and the inclusion got dropped.  This patch will put it back.

Signed-off-by: Alan Somers <asomers@gmail.com>
configure: fix detection of libresolv

Based on the 2013-09-30 version of wip-port.  On FreeBSD, one must
include netinet/in.h to get the definitions for stuff in resolv.h.
Also, resolv.h's functions are part of libc instead of libresolv.

Signed-off-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
configure.ac: autoconf test for execinfo

Add an autoconf test for whether we need -lexecinfo, instead of
hardcoding it for FreeBSD in the makefile.

Signed-off-by: Alan Somers <asomers@gmail.com>
make: Need -lexecinfo for libcommon.a, used by the unit tests.

Signed-off-by: Alan Somers <asomers@gmail.com>
ceph_context: replace semaphore with pipe/poll

sem_timedwait is not portable, so we fake the semaphore semantics here
with pipe/poll, which can be used with a timeout.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
fiemap: Fix double-free of fiemap

Signed-off-by: Alan Somers <asomers@gmail.com>
pybind: use find_library to look for librados

Works on OSX.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>