$NetBSD: patch-wscript,v 1.2 2019/12/02 13:34:33 nia Exp $

Support NetBSD.

--- wscript.orig	2017-09-15 20:56:23.000000000 +0000
+++ wscript
@@ -610,7 +610,7 @@ int main() { return 0; }''',
     if opt.stl_debug:
         cxx_flags.append("-D_GLIBCXX_DEBUG")
 
-    if re.search ("freebsd", sys.platform) != None or re.search ("openbsd", sys.platform) != None:
+    if re.search ("[a-z]*bsd", sys.platform) != None:
         linker_flags.append('-lexecinfo')
 
     if conf.env['DEBUG_RT_ALLOC']:
@@ -1009,7 +1009,7 @@ def configure(conf):
 
     # executing a test program is n/a when cross-compiling
     if Options.options.dist_target != 'mingw':
-        if Options.options.dist_target != 'msvc' and re.search ("openbsd", sys.platform) == None:
+        if Options.options.dist_target != 'msvc' and re.search ("openbsd", sys.platform) == None and re.search ("netbsd", sys.platform) == None:
             if re.search ("freebsd", sys.platform) != None:
                 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', uselib_store='DL')
             else:
@@ -1366,7 +1366,7 @@ def build(bld):
     if bld.is_defined ('BEATBOX'):
         bld.recurse('tools/bb')
             
-    bld.install_files (bld.env['CONFDIR'], 'system_config')
+    bld.install_files (os.environ['EGDIR'], 'system_config')
 
     bld.install_files (os.path.join (bld.env['DATADIR'], 'templates'), bld.path.ant_glob ('templates/**'), cwd=bld.path.find_dir ('templates'), relative_trick=True)
 
