Mac OS X packaging fixes
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 1a0e680..977d91e 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -20,6 +20,7 @@
     import google, distutils.util # bbfreeze seems to need these
     import pkg_resources # pyinstaller / protobuf 2.5 seem to need these
     import proto.nanopb_pb2 as nanopb_pb2 # pyinstaller seems to need this
+    import pkg_resources.py2_warn
 except:
     # Don't care, we will error out later if it is actually important.
     pass
diff --git a/tests/SConstruct b/tests/SConstruct
index e62e61b..b48c327 100644
--- a/tests/SConstruct
+++ b/tests/SConstruct
@@ -20,6 +20,7 @@
 ''')
 
 import os
+import platform
 env = Environment(ENV = os.environ, tools = ['default', 'nanopb'])
 env.SConsignFile("build/sconsign")
 env.Replace(CONFIGUREDIR = "build/config")
@@ -37,6 +38,11 @@
 except:
     pass
 
+# On Mac OS X, gcc is usually alias for clang.
+# To avoid problem with default options, use clang directly.
+if platform.system() == "Darwin":
+    env.Replace(CC = "clang", CXX = "clang")
+
 # Allow overriding the compiler with scons CC=???
 if 'CC' in ARGUMENTS: env.Replace(CC = ARGUMENTS['CC'])
 if 'CXX' in ARGUMENTS: env.Replace(CXX = ARGUMENTS['CXX'])