Similar to what Eric did for Cygwin it helps at least to compile
without --without-vbox
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
-#if defined(__linux__) || defined(__linux_gnu__) || defined(__sun__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__linux__) || defined(__linux_gnu__) || defined(__sun__) || \
+ defined(__FreeBSD__) || defined(__OpenBSD__) || \
+ defined(__FreeBSD_kernel__)
# define DYNLIB_NAME "VBoxXPCOMC.so"
#elif defined(__APPLE__)
# define DYNLIB_NAME "VBoxXPCOMC.dylib"