Exemplo n.º 1
0
 def set_host_details(self, host, opts, macros):
     if host not in host_profiles:
         raise error.general('invalid host: ' + host)
     for m in host_profiles[host]:
         opts.defaults[m] = host_profiles[host][m]
         macros[m] = host_profiles[host][m]
     macros_to_copy = [('%{_build}',        '%{_host}'),
                       ('%{_build_alias}',  '%{_host_alias}'),
                       ('%{_build_arch}',   '%{_host_arch}'),
                       ('%{_build_cpu}',    '%{_host_cpu}'),
                       ('%{_build_os}',     '%{_host_os}'),
                       ('%{_build_vendor}', '%{_host_vendor}')]
     for m in macros_to_copy:
         opts.defaults[m[0]] = opts.defaults[m[1]]
         macros[m[0]] = macros[m[1]]
     #
     # Look for a valid cc and cxx.
     #
     for cc in ['/usr/bin/cc', '/usr/bin/clang', '/usr/bin/gcc']:
         if check.check_exe(cc, cc):
             opts.defaults['__cc'] = cc
             macros['__cc'] = cc
             break
     if not macros.defined('__cc'):
         raise error.general('no valid cc found')
     for cxx in ['/usr/bin/c++', '/usr/bin/clang++', '/usr/bin/g++']:
         if check.check_exe(cxx, cxx):
             opts.defaults['__cxx'] = cxx
             macros['__cxx'] = cxx
     if not macros.defined('__cxx'):
         raise error.general('no valid c++ found')
Exemplo n.º 2
0
 def set_host_details(self, host, opts, macros):
     if host not in host_profiles:
         raise error.general('invalid host: ' + host)
     for m in host_profiles[host]:
         opts.defaults[m] = host_profiles[host][m]
         macros[m] = host_profiles[host][m]
     macros_to_copy = [('%{_build}', '%{_host}'),
                       ('%{_build_alias}', '%{_host_alias}'),
                       ('%{_build_arch}', '%{_host_arch}'),
                       ('%{_build_cpu}', '%{_host_cpu}'),
                       ('%{_build_os}', '%{_host_os}'),
                       ('%{_build_vendor}', '%{_host_vendor}')]
     for m in macros_to_copy:
         opts.defaults[m[0]] = opts.defaults[m[1]]
         macros[m[0]] = macros[m[1]]
     #
     # Look for a valid cc and cxx.
     #
     for cc in ['/usr/bin/cc', '/usr/bin/clang', '/usr/bin/gcc']:
         if check.check_exe(cc, cc):
             opts.defaults['__cc'] = cc
             macros['__cc'] = cc
             break
     if not macros.defined('__cc'):
         raise error.general('no valid cc found')
     for cxx in ['/usr/bin/c++', '/usr/bin/clang++', '/usr/bin/g++']:
         if check.check_exe(cxx, cxx):
             opts.defaults['__cxx'] = cxx
             macros['__cxx'] = cxx
     if not macros.defined('__cxx'):
         raise error.general('no valid c++ found')
Exemplo n.º 3
0
def load():
    uname = os.uname()
    sysctl = '/sbin/sysctl '
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
    if exit_code == 0:
        ncpus = output.split(' ')[1].strip()
    else:
        ncpus = '1'
    if uname[4] == 'amd64':
        cpu = 'x86_64'
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find('-') > 0:
        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_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_build':
        ('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')
    }

    defines['_build'] = defines['_host']
    defines['_build_vendor'] = defines['_host_vendor']
    defines['_build_os'] = defines['_host_os']
    defines['_build_cpu'] = defines['_host_cpu']
    defines['_build_alias'] = defines['_host_alias']
    defines['_build_arch'] = defines['_host_arch']

    for gv in ['47', '48', '49']:
        gcc = '%s-portbld-netbsd%s-gcc%s' % (cpu, version, gv)
        if check.check_exe(gcc, gcc):
            defines['__cc'] = gcc
            break
    for gv in ['47', '48', '49']:
        gxx = '%s-portbld-netbsd%s-g++%s' % (cpu, version, gv)
        if check.check_exe(gxx, gxx):
            defines['__cxx'] = gxx
            break

    return defines
Exemplo n.º 4
0
def load():
    uname = os.uname()
    sysctl = '/sbin/sysctl '
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
    if exit_code == 0:
        ncpus = output.split(' ')[1].strip()
    else:
        ncpus = '1'
    if uname[4] == 'amd64':
        cpu = 'x86_64'
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find('-') > 0:
        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_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_build': ('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')
        }

    defines['_build']        = defines['_host']
    defines['_build_vendor'] = defines['_host_vendor']
    defines['_build_os']     = defines['_host_os']
    defines['_build_cpu']    = defines['_host_cpu']
    defines['_build_alias']  = defines['_host_alias']
    defines['_build_arch']   = defines['_host_arch']

    for gv in ['47', '48', '49']:
        gcc = '%s-portbld-netbsd%s-gcc%s' % (cpu, version, gv)
        if check.check_exe(gcc, gcc):
            defines['__cc'] = gcc
            break
    for gv in ['47', '48', '49']:
        gxx = '%s-portbld-netbsd%s-g++%s' % (cpu, version, gv)
        if check.check_exe(gxx, gxx):
            defines['__cxx'] = gxx
            break

    return defines
Exemplo n.º 5
0
def load():
    uname = os.uname()
    sysctl = "/sbin/sysctl "
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + "hw.ncpu")
    if exit_code == 0:
        ncpus = output.split(" ")[1].strip()
    else:
        ncpus = "1"
    if uname[4] == "amd64":
        cpu = "x86_64"
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find("-") > 0:
        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_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_build": ("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"),
    }

    defines["_build"] = defines["_host"]
    defines["_build_vendor"] = defines["_host_vendor"]
    defines["_build_os"] = defines["_host_os"]
    defines["_build_cpu"] = defines["_host_cpu"]
    defines["_build_alias"] = defines["_host_alias"]
    defines["_build_arch"] = defines["_host_arch"]

    for gv in ["47", "48", "49"]:
        gcc = "%s-portbld-netbsd%s-gcc%s" % (cpu, version, gv)
        if check.check_exe(gcc, gcc):
            defines["__cc"] = gcc
            break
    for gv in ["47", "48", "49"]:
        gxx = "%s-portbld-netbsd%s-g++%s" % (cpu, version, gv)
        if check.check_exe(gxx, gxx):
            defines["__cxx"] = gxx
            break

    return defines
Exemplo n.º 6
0
def overrides():
    uname = os.uname()
    ncpus = '%d' % (cpus())
    if uname[4] == 'amd64':
        cpu = 'x86_64'
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find('-') > 0:
        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_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_build':
        ('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')
    }

    defines['_build'] = defines['_host']
    defines['_build_vendor'] = defines['_host_vendor']
    defines['_build_os'] = defines['_host_os']
    defines['_build_cpu'] = defines['_host_cpu']
    defines['_build_alias'] = defines['_host_alias']
    defines['_build_arch'] = defines['_host_arch']

    for gv in ['47', '48', '49']:
        gcc = '%s-portbld-netbsd%s-gcc%s' % (cpu, version, gv)
        if check.check_exe(gcc, gcc):
            defines['__cc'] = gcc
            break
    for gv in ['47', '48', '49']:
        gxx = '%s-portbld-netbsd%s-g++%s' % (cpu, version, gv)
        if check.check_exe(gxx, gxx):
            defines['__cxx'] = gxx
            break

    return defines
Exemplo n.º 7
0
def load():
    uname = os.uname()
    sysctl = '/sbin/sysctl '
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
    if exit_code == 0:
        ncpus = output.split(' ')[1].strip()
    else:
        ncpus = '1'
    if uname[4] == 'amd64':
        cpu = 'x86_64'
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find('-') > 0:
        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_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')
    }

    defines['_build'] = defines['_host']
    defines['_build_vendor'] = defines['_host_vendor']
    defines['_build_os'] = defines['_host_os']
    defines['_build_cpu'] = defines['_host_cpu']
    defines['_build_alias'] = defines['_host_alias']
    defines['_build_arch'] = defines['_host_arch']

    # FreeBSD 10 and above no longer have /usr/bin/cvs, but it can (e.g.) be
    # installed to /usr/local/bin/cvs through the devel/cvs port
    if int(float(version)) >= 10:
        #
        # FreeBSD has switched to clang plus gcc. On 10.0 cc is gcc based and
        # clang is provided however it is not building binutils-2.24.
        #
        cc = '/usr/bin/cc'
        if check.check_exe(cc, cc):
            defines['__cc'] = cc
        else:
            cc = '/usr/bin/clang'
            if not check.check_exe(cc, cc):
                raise error.general('no valid cc found')
        cxx = '/usr/bin/c++'
        if check.check_exe(cxx, cxx):
            defines['__cxx'] = cxx
        else:
            cxx = '/usr/bin/clang++'
            if check.check_exe(cxx, cxx):
                raise error.general('no valid c++ found')
        #
        # Assume the compiler is clang and so we need to increase
        # bracket depth build build the gcc ARM compiler.
        #
        defines['build_cflags'] = '-O2 -pipe -fbracket-depth=1024'
        defines['build_cxxflags'] = '-O2 -pipe -fbracket-depth=1024'
        cvs = 'cvs'
        if check.check_exe(cvs, cvs):
            defines['__cvs'] = cvs
        #
        # Fix the mess iconv is on FreeBSD 10.0.
        #
        defines['iconv_includes'] = ('none', 'none',
                                     '-I/usr/local/include -L/usr/local/lib')
    else:
        for gv in ['49', '48', '47']:
            gcc = '%s-portbld-freebsd%s-gcc%s' % (cpu, version, gv)
            if check.check_exe(gcc, gcc):
                defines['__cc'] = gcc
                break
        for gv in ['49', '48', '47']:
            gxx = '%s-portbld-freebsd%s-g++%s' % (cpu, version, gv)
            if check.check_exe(gxx, gxx):
                defines['__cxx'] = gxx
                break

    return defines
Exemplo n.º 8
0
def load():
    uname = os.uname()
    sysctl = '/sbin/sysctl '
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
    if exit_code == 0:
        ncpus = output.split(' ')[1].strip()
    else:
        ncpus = '1'
    if uname[4] == 'amd64':
        cpu = 'x86_64'
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find('-') > 0:
        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_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')
        }

    defines['_build']        = defines['_host']
    defines['_build_vendor'] = defines['_host_vendor']
    defines['_build_os']     = defines['_host_os']
    defines['_build_cpu']    = defines['_host_cpu']
    defines['_build_alias']  = defines['_host_alias']
    defines['_build_arch']   = defines['_host_arch']

    # FreeBSD 10 and above no longer have /usr/bin/cvs, but it can (e.g.) be
    # installed to /usr/local/bin/cvs through the devel/cvs port
    if int(float(version)) >= 10:
        #
        # FreeBSD has switched to clang plus gcc. On 10.0 cc is gcc based and
        # clang is provided however it is not building binutils-2.24.
        #
        cc = '/usr/bin/cc'
        if check.check_exe(cc, cc):
            defines['__cc'] = cc
        else:
            cc = '/usr/bin/clang'
            if not check.check_exe(cc, cc):
                raise error.general('no valid cc not found')
        cxx = '/usr/bin/c++'
        if check.check_exe(cxx, cxx):
            defines['__cxx'] = cxx
        else:
            cxx = '/usr/bin/clang++'
            if check.check_exe(cxx, cxx):
                raise error.general('no valid c++ not found')
            defines['optflags_build'] = '-O2 -pipe -fbracket-depth=1024'
        cvs = 'cvs'
        if check.check_exe(cvs, cvs):
            defines['__cvs'] = cvs
        #
        # Fix the mess iconv is on FreeBSD 10.0.
        #
        defines['iconv_optincludes'] = ('none', 'none', '-I/usr/local/include -L/usr/local/lib')

    for gv in ['47', '48', '49']:
        gcc = '%s-portbld-freebsd%s-gcc%s' % (cpu, version, gv)
        if check.check_exe(gcc, gcc):
            defines['__cc'] = gcc
            break
    for gv in ['47', '48', '49']:
        gxx = '%s-portbld-freebsd%s-g++%s' % (cpu, version, gv)
        if check.check_exe(gxx, gxx):
            defines['__cxx'] = gxx
            break

    return defines
Exemplo n.º 9
0
def load():
    uname = os.uname()
    sysctl = "/sbin/sysctl "
    e = execute.capture_execution()
    exit_code, proc, output = e.shell(sysctl + "hw.ncpu")
    if exit_code == 0:
        ncpus = output.split(" ")[1].strip()
    else:
        ncpus = "1"
    if uname[4] == "amd64":
        cpu = "x86_64"
    else:
        cpu = uname[4]
    version = uname[2]
    if version.find("-") > 0:
        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_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"),
    }

    defines["_build"] = defines["_host"]
    defines["_build_vendor"] = defines["_host_vendor"]
    defines["_build_os"] = defines["_host_os"]
    defines["_build_cpu"] = defines["_host_cpu"]
    defines["_build_alias"] = defines["_host_alias"]
    defines["_build_arch"] = defines["_host_arch"]

    # FreeBSD 10 and above no longer have /usr/bin/cvs, but it can (e.g.) be
    # installed to /usr/local/bin/cvs through the devel/cvs port
    if int(float(version)) >= 10:
        #
        # FreeBSD has switched to clang plus gcc. On 10.0 cc is gcc based and
        # clang is provided however it is not building binutils-2.24.
        #
        cc = "/usr/bin/cc"
        if check.check_exe(cc, cc):
            defines["__cc"] = cc
        else:
            cc = "/usr/bin/clang"
            if not check.check_exe(cc, cc):
                raise error.general("no valid cc found")
        cxx = "/usr/bin/c++"
        if check.check_exe(cxx, cxx):
            defines["__cxx"] = cxx
        else:
            cxx = "/usr/bin/clang++"
            if check.check_exe(cxx, cxx):
                raise error.general("no valid c++ found")
        #
        # Assume the compiler is clang and so we need to increase
        # bracket depth build build the gcc ARM compiler.
        #
        defines["build_cflags"] = "-O2 -pipe -fbracket-depth=1024"
        defines["build_cxxflags"] = "-O2 -pipe -fbracket-depth=1024"
        cvs = "cvs"
        if check.check_exe(cvs, cvs):
            defines["__cvs"] = cvs
        #
        # Fix the mess iconv is on FreeBSD 10.0.
        #
        defines["iconv_includes"] = ("none", "none", "-I/usr/local/include -L/usr/local/lib")
    else:
        for gv in ["49", "48", "47"]:
            gcc = "%s-portbld-freebsd%s-gcc%s" % (cpu, version, gv)
            if check.check_exe(gcc, gcc):
                defines["__cc"] = gcc
                break
        for gv in ["49", "48", "47"]:
            gxx = "%s-portbld-freebsd%s-g++%s" % (cpu, version, gv)
            if check.check_exe(gxx, gxx):
                defines["__cxx"] = gxx
                break

    return defines