Index: source-builder/sb/darwin.py
===================================================================
--- source-builder/sb/darwin.py	(revision 9ea19cf760d66e9001d2644bfc42f62d51ed34ef)
+++ source-builder/sb/darwin.py	(revision a14171f524f3cc60b3c2758bde78310137b799a9)
@@ -36,4 +36,7 @@
     else:
         ncpus = '1'
+    version = uname[2]
+    if version.find('.'):
+        version = version.split('.')[0]
     defines = {
         '_ncpus':           ('none',    'none',     ncpus),
@@ -42,4 +45,5 @@
         '_host_vendor':     ('none',    'none',     'apple'),
         '_host_os':         ('none',    'none',     'darwin'),
+        '_host_os_version': ('none',    'none',     version),
         '_host_cpu':        ('none',    'none',     uname[4]),
         '_host_alias':      ('none',    'none',     '%{nil}'),
@@ -56,5 +60,4 @@
         }
 
-    version = uname[2]
     if version.find('.'):
         version = version.split('.')[0]
Index: source-builder/sb/freebsd.py
===================================================================
--- source-builder/sb/freebsd.py	(revision 9ea19cf760d66e9001d2644bfc42f62d51ed34ef)
+++ source-builder/sb/freebsd.py	(revision a14171f524f3cc60b3c2758bde78310137b799a9)
@@ -48,21 +48,22 @@
         version = version.split('-')[0]
     defines = {
-        '_ncpus':        ('none',    'none',     ncpus),
-        '_os':           ('none',    'none',     'freebsd'),
-        '_host':         ('triplet', 'required', cpu + '-freebsd' + version),
-        '_host_vendor':  ('none',    'none',     'pc'),
-        '_host_os':      ('none',    'none',     'freebsd'),
-        '_host_cpu':     ('none',    'none',     cpu),
-        '_host_alias':   ('none',    'none',     '%{nil}'),
-        '_host_arch':    ('none',    'none',     cpu),
-        '_usr':          ('dir',     'required', '/usr/local'),
-        '_var':          ('dir',     'optional', '/usr/local/var'),
-        '__bash':        ('exe',     'optional', '/usr/local/bin/bash'),
-        '__bison':       ('exe',     'required', '/usr/local/bin/bison'),
-        '__git':         ('exe',     'required', '/usr/local/bin/git'),
-        '__svn':         ('exe',     'required', '/usr/local/bin/svn'),
-        '__xz':          ('exe',     'optional', '/usr/bin/xz'),
-        '__make':        ('exe',     'required', 'gmake'),
-        '__patch_opts':  ('none',     'none',    '-E')
+        '_ncpus':           ('none',    'none',     ncpus),
+        '_os':              ('none',    'none',     'freebsd'),
+        '_host':            ('triplet', 'required', cpu + '-freebsd' + version),
+        '_host_vendor':     ('none',    'none',     'pc'),
+        '_host_os':         ('none',    'none',     'freebsd'),
+        '_host_os_version': ('none',    'none',     version),
+        '_host_cpu':        ('none',    'none',     cpu),
+        '_host_alias':      ('none',    'none',     '%{nil}'),
+        '_host_arch':       ('none',    'none',     cpu),
+        '_usr':             ('dir',     'required', '/usr/local'),
+        '_var':             ('dir',     'optional', '/usr/local/var'),
+        '__bash':           ('exe',     'optional', '/usr/local/bin/bash'),
+        '__bison':          ('exe',     'required', '/usr/local/bin/bison'),
+        '__git':            ('exe',     'required', '/usr/local/bin/git'),
+        '__svn':            ('exe',     'required', '/usr/local/bin/svn'),
+        '__xz':             ('exe',     'optional', '/usr/bin/xz'),
+        '__make':           ('exe',     'required', 'gmake'),
+        '__patch_opts':     ('none',     'none',    '-E')
         }
 
Index: source-builder/sb/linux.py
===================================================================
--- source-builder/sb/linux.py	(revision 9ea19cf760d66e9001d2644bfc42f62d51ed34ef)
+++ source-builder/sb/linux.py	(revision a14171f524f3cc60b3c2758bde78310137b799a9)
@@ -51,18 +51,20 @@
         cpu = uname[4]
 
+    version = uname[2]
     defines = {
-        '_ncpus':         ('none',    'none',     ncpus),
-        '_os':            ('none',    'none',     'linux'),
-        '_host':          ('triplet', 'required', cpu + '-linux-gnu'),
-        '_host_vendor':   ('none',    'none',     'gnu'),
-        '_host_os':       ('none',    'none',     'linux'),
-        '_host_cpu':      ('none',    'none',     cpu),
-        '_host_alias':    ('none',    'none',     '%{nil}'),
-        '_host_arch':     ('none',    'none',     cpu),
-        '_usr':           ('dir',     'required', '/usr'),
-        '_var':           ('dir',     'required', '/var'),
-        '__bzip2':        ('exe',     'required', '/usr/bin/bzip2'),
-        '__gzip':         ('exe',     'required', '/bin/gzip'),
-        '__tar':          ('exe',     'required', '/bin/tar')
+        '_ncpus':           ('none',    'none',     ncpus),
+        '_os':              ('none',    'none',     'linux'),
+        '_host':            ('triplet', 'required', cpu + '-linux-gnu'),
+        '_host_vendor':     ('none',    'none',     'gnu'),
+        '_host_os':         ('none',    'none',     'linux'),
+        '_host_os_version': ('none',    'none',     version),
+        '_host_cpu':        ('none',    'none',     cpu),
+        '_host_alias':      ('none',    'none',     '%{nil}'),
+        '_host_arch':       ('none',    'none',     cpu),
+        '_usr':             ('dir',     'required', '/usr'),
+        '_var':             ('dir',     'required', '/var'),
+        '__bzip2':          ('exe',     'required', '/usr/bin/bzip2'),
+        '__gzip':           ('exe',     'required', '/bin/gzip'),
+        '__tar':            ('exe',     'required', '/bin/tar')
         }
 
Index: source-builder/sb/netbsd.py
===================================================================
--- source-builder/sb/netbsd.py	(revision 9ea19cf760d66e9001d2644bfc42f62d51ed34ef)
+++ source-builder/sb/netbsd.py	(revision a14171f524f3cc60b3c2758bde78310137b799a9)
@@ -48,22 +48,23 @@
         version = version.split('-')[0]
     defines = {
-        '_ncpus':        ('none',    'none',    '1'),
-        '_os':           ('none',    'none',     'netbsd'),
-        '_host':         ('triplet', 'required', cpu + '-netbsd' + version),
-        '_host_vendor':  ('none',    'none',     'pc'),
-        '_host_os':      ('none',    'none',     'netbsd'),
-        '_host_cpu':     ('none',    'none',     cpu),
-        '_host_alias':   ('none',    'none',     '%{nil}'),
-        '_host_arch':    ('none',    'none',     cpu),
-        '_usr':          ('dir',     'required', '/usr'),
-        '_var':          ('dir',     'optional', '/var'),
-        'optincludes':   ('none',    'none',     '-I/usr/pkg/include -L/usr/pkg/lib'),
-        '__bash':        ('exe',     'optional', '/usr/pkg/bin/bash'),
-        '__bison':       ('exe',     'required', '/usr/pkg/bin/bison'),
-        '__git':         ('exe',     'required', '/usr/pkg/bin/git'),
-        '__svn':         ('exe',     'required', '/usr/pkg/bin/svn'),
-        '__xz':          ('exe',     'optional', '/usr/pkg/bin/xz'),
-        '__make':        ('exe',     'required', 'gmake'),
-        '__patch_opts':  ('none',     'none',    '-E')
+        '_ncpus':           ('none',    'none',    '1'),
+        '_os':              ('none',    'none',     'netbsd'),
+        '_host':            ('triplet', 'required', cpu + '-netbsd' + version),
+        '_host_vendor':     ('none',    'none',     'pc'),
+        '_host_os':         ('none',    'none',     'netbsd'),
+        '_host_os_version': ('none',    'none',     version),
+        '_host_cpu':        ('none',    'none',     cpu),
+        '_host_alias':      ('none',    'none',     '%{nil}'),
+        '_host_arch':       ('none',    'none',     cpu),
+        '_usr':             ('dir',     'required', '/usr'),
+        '_var':             ('dir',     'optional', '/var'),
+        'optincludes':      ('none',    'none',     '-I/usr/pkg/include -L/usr/pkg/lib'),
+        '__bash':           ('exe',     'optional', '/usr/pkg/bin/bash'),
+        '__bison':          ('exe',     'required', '/usr/pkg/bin/bison'),
+        '__git':            ('exe',     'required', '/usr/pkg/bin/git'),
+        '__svn':            ('exe',     'required', '/usr/pkg/bin/svn'),
+        '__xz':             ('exe',     'optional', '/usr/pkg/bin/xz'),
+        '__make':           ('exe',     'required', 'gmake'),
+        '__patch_opts':     ('none',     'none',    '-E')
         }
 
Index: source-builder/sb/windows.py
===================================================================
--- source-builder/sb/windows.py	(revision 9ea19cf760d66e9001d2644bfc42f62d51ed34ef)
+++ source-builder/sb/windows.py	(revision a14171f524f3cc60b3c2758bde78310137b799a9)
@@ -63,59 +63,61 @@
         ncpus = '1'
 
+    version = uname[2]
     defines = {
-        '_ncpus':         ('none',    'none',     ncpus),
-        '_os':            ('none',    'none',     'win32'),
-        '_build':         ('triplet', 'required', build_triple),
-        '_build_vendor':  ('none',    'none',     'microsoft'),
-        '_build_os':      ('none',    'none',     'win32'),
-        '_build_cpu':     ('none',    'none',     hosttype),
-        '_build_alias':   ('none',    'none',     '%{nil}'),
-        '_build_arch':    ('none',    'none',     hosttype),
-        '_host':          ('triplet', 'required', host_triple),
-        '_host_vendor':   ('none',    'none',     'microsoft'),
-        '_host_os':       ('none',    'none',     'win32'),
-        '_host_cpu':      ('none',    'none',     hosttype),
-        '_host_alias':    ('none',    'none',     '%{nil}'),
-        '_host_arch':     ('none',    'none',     hosttype),
-        '_usr':           ('dir',     'optional', '/opt/local'),
-        '_var':           ('dir',     'optional', '/opt/local/var'),
-        '__bash':         ('exe',     'required', 'bash'),
-        '__bzip2':        ('exe',     'required', 'bzip2'),
-        '__bison':        ('exe',     'required', 'bison'),
-        '__cat':          ('exe',     'required', 'cat'),
-        '__cc':           ('exe',     'required', 'gcc'),
-        '__chgrp':        ('exe',     'required', 'chgrp'),
-        '__chmod':        ('exe',     'required', 'chmod'),
-        '__chown':        ('exe',     'required', 'chown'),
-        '__cp':           ('exe',     'required', 'cp'),
-        '__cvs':          ('exe',     'required', 'cvs'),
-        '__cxx':          ('exe',     'required', 'g++'),
-        '__flex':         ('exe',     'required', 'flex'),
-        '__git':          ('exe',     'required', 'git'),
-        '__grep':         ('exe',     'required', 'grep'),
-        '__gzip':         ('exe',     'required', 'gzip'),
-        '__id':           ('exe',     'required', 'id'),
-        '__install':      ('exe',     'required', 'install'),
-        '__install_info': ('exe',     'required', 'install-info'),
-        '__ld':           ('exe',     'required', 'ld'),
-        '__ldconfig':     ('exe',     'none',     ''),
-        '__makeinfo':     ('exe',     'required', 'makeinfo'),
-        '__mkdir':        ('exe',     'required', 'mkdir'),
-        '__mv':           ('exe',     'required', 'mv'),
-        '__nm':           ('exe',     'required', 'nm'),
-        '__nm':           ('exe',     'required', 'nm'),
-        '__objcopy':      ('exe',     'required', 'objcopy'),
-        '__objdump':      ('exe',     'required', 'objdump'),
-        '__patch':        ('exe',     'required', 'patch'),
-        '__patch_bin':    ('exe',     'required', 'patch'),
-        '__rm':           ('exe',     'required', 'rm'),
-        '__sed':          ('exe',     'required', 'sed'),
-        '__sh':           ('exe',     'required', 'sh'),
-        '__tar':          ('exe',     'required', 'bsdtar'),
-        '__touch':        ('exe',     'required', 'touch'),
-        '__unzip':        ('exe',     'required', 'unzip'),
-        '__xz':           ('exe',     'required', 'xz'),
-        '_buildshell':    ('exe',     'required', '%{__sh}'),
-        '___setup_shell': ('exe',     'required', '%{__sh}')
+        '_ncpus':            ('none',    'none',     ncpus),
+        '_os':               ('none',    'none',     'win32'),
+        '_build':            ('triplet', 'required', build_triple),
+        '_build_vendor':     ('none',    'none',     'microsoft'),
+        '_build_os':         ('none',    'none',     'win32'),
+        '_build_os_version': ('none',    'none',     version),
+        '_build_cpu':        ('none',    'none',     hosttype),
+        '_build_alias':      ('none',    'none',     '%{nil}'),
+        '_build_arch':       ('none',    'none',     hosttype),
+        '_host':             ('triplet', 'required', host_triple),
+        '_host_vendor':      ('none',    'none',     'microsoft'),
+        '_host_os':          ('none',    'none',     'win32'),
+        '_host_cpu':         ('none',    'none',     hosttype),
+        '_host_alias':       ('none',    'none',     '%{nil}'),
+        '_host_arch':        ('none',    'none',     hosttype),
+        '_usr':              ('dir',     'optional', '/opt/local'),
+        '_var':              ('dir',     'optional', '/opt/local/var'),
+        '__bash':            ('exe',     'required', 'bash'),
+        '__bzip2':           ('exe',     'required', 'bzip2'),
+        '__bison':           ('exe',     'required', 'bison'),
+        '__cat':             ('exe',     'required', 'cat'),
+        '__cc':              ('exe',     'required', 'gcc'),
+        '__chgrp':           ('exe',     'required', 'chgrp'),
+        '__chmod':           ('exe',     'required', 'chmod'),
+        '__chown':           ('exe',     'required', 'chown'),
+        '__cp':              ('exe',     'required', 'cp'),
+        '__cvs':             ('exe',     'required', 'cvs'),
+        '__cxx':             ('exe',     'required', 'g++'),
+        '__flex':            ('exe',     'required', 'flex'),
+        '__git':             ('exe',     'required', 'git'),
+        '__grep':            ('exe',     'required', 'grep'),
+        '__gzip':            ('exe',     'required', 'gzip'),
+        '__id':              ('exe',     'required', 'id'),
+        '__install':         ('exe',     'required', 'install'),
+        '__install_info':    ('exe',     'required', 'install-info'),
+        '__ld':              ('exe',     'required', 'ld'),
+        '__ldconfig':        ('exe',     'none',     ''),
+        '__makeinfo':        ('exe',     'required', 'makeinfo'),
+        '__mkdir':           ('exe',     'required', 'mkdir'),
+        '__mv':              ('exe',     'required', 'mv'),
+        '__nm':              ('exe',     'required', 'nm'),
+        '__nm':              ('exe',     'required', 'nm'),
+        '__objcopy':         ('exe',     'required', 'objcopy'),
+        '__objdump':         ('exe',     'required', 'objdump'),
+        '__patch':           ('exe',     'required', 'patch'),
+        '__patch_bin':       ('exe',     'required', 'patch'),
+        '__rm':              ('exe',     'required', 'rm'),
+        '__sed':             ('exe',     'required', 'sed'),
+        '__sh':              ('exe',     'required', 'sh'),
+        '__tar':             ('exe',     'required', 'bsdtar'),
+        '__touch':           ('exe',     'required', 'touch'),
+        '__unzip':           ('exe',     'required', 'unzip'),
+        '__xz':              ('exe',     'required', 'xz'),
+        '_buildshell':       ('exe',     'required', '%{__sh}'),
+        '___setup_shell':    ('exe',     'required', '%{__sh}')
         }
     return defines
