Index: Makefile.in --- Makefile.in.orig 2014-09-17 13:42:41.000000000 +0200 +++ Makefile.in 2014-09-18 13:05:59.280395929 +0200 @@ -1264,7 +1264,7 @@ p11-kit/p11-kit.c \ $(NULL) -p11_kit_p11_kit_LDADD = \ +p11_kit_p11_kit_LDADD = -static \ libp11-kit.la \ libp11-tool.la \ libp11-common.la \ Index: common/compat.c --- common/compat.c.orig 2014-09-17 09:50:07.000000000 +0200 +++ common/compat.c 2014-09-18 13:10:51.500424515 +0200 @@ -39,6 +39,9 @@ * on older pthreads implementations */ #define _XOPEN_SOURCE 700 +#ifdef __FreeBSD__ +#define __BSD_VISIBLE 1 +#endif #include "compat.h" Index: configure --- configure.orig 2014-09-17 13:42:40.000000000 +0200 +++ configure 2014-09-18 13:05:59.280395929 +0200 @@ -16007,9 +16007,6 @@ -if test "$enable_static" = "yes"; then - as_fn_error $? "p11-kit cannot be used as a static library" "$LINENO" 5 -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for win32" >&5 $as_echo_n "checking for win32... " >&6; } Index: p11-kit/modules.c --- p11-kit/modules.c.orig 2014-09-17 09:50:08.000000000 +0200 +++ p11-kit/modules.c 2014-09-18 13:05:59.280395929 +0200 @@ -68,6 +68,7 @@ #include #include #include +#include /** * SECTION:p11-kit