I had to apply the following patches in order to make Firebird 2.5 RC1. Some are specific for the Debian/kFreeBSD architecture (that is GNU userland plus Debian package management over FreeBSD kernel), others are relevant for plain FreeBSD too.
freebsd-mutex-sysv.patch - makes mutex code use SYSV semaphores for mutexes on FreeBSD (same as DARWIN)
optional_posix_fadv.patch: use advisory posix features only when available. apparently the POSIX_FADV_* constants are not available on Debian/kFreeBSD
install_freebsd_as_linux.patch: use linux install makefile on k*BSD; the 'normal' freebsd install makefile misses the image/tar building targets
freebsd_targets.patch: fixes Makefile targets on FreeBSD. The current prefix file misses the fbsvcmgr and fbtracemgr targets