--- wscript.orig
+++ wscript
@@ -529,7 +529,7 @@ def configure(conf):
     # If not, we have to use '-Wl,--allow-shlib-undefined' instead
     # and remove all instances of '-Wl,-no-undefined'.
 
-    if sys.platform.startswith('freebsd'):
+    if sys.platform.startswith(('freebsd', 'midnightbsd')):
         # Do we have Wl,--ignore-unresolved-symbol,environ ?
         flag_added = conf.ADD_LDFLAGS('-Wl,--ignore-unresolved-symbol,environ', testflags=True)
         if not flag_added:
