 +      target = target[3:]
 +
 +    if spec['type'] == 'static_library':
-+      return '%s.a' % target
++      return 'lib%s.a' % target
 +    elif spec['type'] in ('loadable_module', 'shared_library'):
-+      return '%s.so' % target
++      return 'lib%s.so' % target
 +    elif spec['type'] == 'none':
 +      return '%s.stamp' % target
 +    elif spec['type'] == 'settings':

+  def WriteSources(self, config, sources, predepends):
+    self.WriteVariableList('defines', ['-D' + d for d in config.get('defines', [])],
+                           quoter=MaybeQuoteShellArgument)
+    self.WriteVariableList('includes', ['-I' + self.FullPath(i) for i in config.get('include_dirs', [])])
+    self.WriteVariableList('cflags', config.get('cflags'))
+    self.WriteVariableList('cflags_cc', config.get('cflags_c'))
+    self.WriteVariableList('cflags_cxx', config.get('cflags_cc'))

+cxx = g++
+
+rule cc
+  depfile = $out.d
+  description = CC $out
+  command = $cc -MMD -MF $out.d $cflags $cflags_cc $defines $includes \
+    -c $in -o $out
+
+rule cxx
+  depfile = $out.d
+  description = CXX $out
+  command = $cxx -MMD -MF $out.d $cflags $cflags_cxx $defines $includes \
+    -c $in -o $out
+
+rule alink
+  description = AR $out
