Currently, building bdb for *BSD HOSTs in depends fails with:
0libtool: compile: clang -m64 -c -I. -I../dist/./.. -I/home/ubuntu/bitcoin/depends/x86_64-unknown-freebsd/include -D_THREAD_SAFE -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security ../dist/./../mutex/mut_tas.c -fPIC -DPIC -o mut_tas.o
1In file included from ../dist/./../mutex/mut_tas.c:11:
2In file included from ./db_int.h:884:
3In file included from ../dist/./../dbinc/mutex.h:15:
4../dist/./../dbinc/mutex_int.h:932:2: error: unknown type name 'pthread_rwlock_t'
5 MUTEX_FIELDS /* Opaque thread mutex structures. */
6 ^
7../dist/./../dbinc/mutex_int.h:65:3: note: expanded from macro 'MUTEX_FIELDS'
8 pthread_rwlock_t rwlock; /* Read/write lock */ \
9 ^
101 error generated.
Defining _XOPEN_SOURCE
>=600 fixes access to the missing pthread_rwlock_t
definitions.