MongoDB builds fine on FreeBSD but SConstruct needs a one-line patch for FreeBSD versions newer than 7.
The patch makes it compile on all versions of FreeBSD, which is OK since the defaults given in the configuration have not changed in the last 20-ish years and will with extremely high probability never change.
Tested on: FreeBSD 8.0-RC2.
— ../ori/mongodb-mongo-e316c78/SConstruct 2009-10-22 17:22:10.000000000 +0200
+++ SConstruct 2009-11-01 23:50:01.000000000 +0100
@@ -374,7 +374,7 @@
env.Append( CPPDEFINES=[ "_linux" , "sunos_" ] )
env.Append( LIBS=["socket","resolv"] )
-elif "freebsd7" == os.sys.platform:
+elif os.sys.platform.startswith("freebsd"):
nix = True
freebsd = True
env.Append( CPPPATH=[ "/usr/local/include" ] )