Commits

Ross Light committed 87f40a0

Add default settings to environment

Comments (0)

Files changed (1)

 go_scanner = Scanner(function=_go_scan_func, skeys=['.go'])
 
 def _gc_emitter(target, source, env):
-    if env.get('GO_STRIPTESTS', False):
+    if env['GO_STRIPTESTS']:
         return (target, [s for s in source if not str(s).endswith('_test.go')])
     else:
         return (target, source)
 def _get_package_info(env, node):
     package_name = splitext(node.name)[0]
     # Find import path
-    for path in env['GO_LIBPATH']:
+    for path in env['GO_LIBPATH'] + [env['GO_PKGROOT']]:
         search_dir = env.Dir(path)
         if node.is_under(search_dir):
             return package_name, splitext(search_dir.rel_path(node))[0]
         GO_LDCOM='$GO_LD -o $TARGET ${_concat("-L ", GO_LIBPATH, "", __env__)} $GO_LDFLAGS $SOURCE',
         GO_ACOM='$GO_A -o $TARGET $SOURCE',
         GO_PACKCOM='rm -f $TARGET ; $GO_PACK gcr $TARGET $SOURCES',
+        GO_LIBPATH=[],
+        GO_STRIPTESTS=False,
     )
 
 def exists(env):