Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 511036 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/engine/SCons/Action.py (+1 lines)
Lines 685-690 Link Here
685
            class f(object):
685
            class f(object):
686
                def read(self): return ''
686
                def read(self): return ''
687
                def readline(self): return ''
687
                def readline(self): return ''
688
                def __iter__(self): return iter(())
688
            stdout = stderr = f()
689
            stdout = stderr = f()
689
        return dummyPopen(e)
690
        return dummyPopen(e)
690
691
(-)a/src/engine/SCons/Platform/aix.py (-12 / +28 lines)
Lines 33-42 Link Here
33
__revision__ = "src/engine/SCons/Platform/aix.py  2014/03/02 14:18:15 garyo"
33
__revision__ = "src/engine/SCons/Platform/aix.py  2014/03/02 14:18:15 garyo"
34
34
35
import os
35
import os
36
import subprocess
36
37
37
import posix
38
import posix
38
39
39
def get_xlc(env, xlc=None, xlc_r=None, packages=[]):
40
import SCons.Util
41
import SCons.Action
42
43
def get_xlc(env, xlc=None, packages=[]):
40
    # Use the AIX package installer tool lslpp to figure out where a
44
    # Use the AIX package installer tool lslpp to figure out where a
41
    # given xl* compiler is installed and what version it is.
45
    # given xl* compiler is installed and what version it is.
42
    xlcPath = None
46
    xlcPath = None
Lines 44-61 Link Here
44
48
45
    if xlc is None:
49
    if xlc is None:
46
        xlc = env.get('CC', 'xlc')
50
        xlc = env.get('CC', 'xlc')
47
    if xlc_r is None:
51
    if SCons.Util.is_List(xlc):
48
        xlc_r = xlc + '_r'
52
        xlc = xlc[0]
49
    for package in packages:
53
    for package in packages:
50
        cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a-zA-Z0-9].*)?$'"
54
        # find the installed filename, which may be a symlink as well
51
        line = os.popen(cmd).readline()
55
        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],
52
        if line:
56
                stdin = 'devnull',
53
            v, p = line.split(':')[1:3]
57
                stderr = 'devnull',
54
            xlcVersion = v.split()[1]
58
                stdout = subprocess.PIPE)
55
            xlcPath = p.split()[0]
59
        # output of lslpp is something like this:
56
            xlcPath = xlcPath[:xlcPath.rindex('/')]
60
        #     #Path:Fileset:File
57
            break
61
        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp
58
    return (xlcPath, xlc, xlc_r, xlcVersion)
62
        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc
63
        for line in pipe.stdout:
64
            if xlcPath:
65
                continue # read everything to let lslpp terminate
66
            fileset, filename = line.split(':')[1:3]
67
            filename = filename.split()[0]
68
            if ('/' in xlc and filename == xlc) \
69
            or ('/' not in xlc and filename.endswith('/' + xlc)):
70
                xlcVersion = fileset.split()[1]
71
                xlcPath, sep, xlc = filename.rpartition('/')
72
            pass
73
        pass
74
    return (xlcPath, xlc, xlcVersion)
59
75
60
def generate(env):
76
def generate(env):
61
    posix.generate(env)
77
    posix.generate(env)
(-)a/src/engine/SCons/Tool/aixc++.py (-10 / +9 lines)
Lines 43-50 Link Here
43
43
44
def get_xlc(env):
44
def get_xlc(env):
45
    xlc = env.get('CXX', 'xlC')
45
    xlc = env.get('CXX', 'xlC')
46
    xlc_r = env.get('SHCXX', 'xlC_r')
46
    return SCons.Platform.aix.get_xlc(env, xlc, packages)
47
    return SCons.Platform.aix.get_xlc(env, xlc, xlc_r, packages)
48
47
49
def smart_cxxflags(source, target, env, for_signature):
48
def smart_cxxflags(source, target, env, for_signature):
50
    build_dir = env.GetBuildPath()
49
    build_dir = env.GetBuildPath()
Lines 55-74 Link Here
55
def generate(env):
54
def generate(env):
56
    """Add Builders and construction variables for xlC / Visual Age
55
    """Add Builders and construction variables for xlC / Visual Age
57
    suite to an Environment."""
56
    suite to an Environment."""
58
    path, _cxx, _shcxx, version = get_xlc(env)
57
    path, _cxx, version = get_xlc(env)
59
    if path:
58
    if path and _cxx:
60
        _cxx = os.path.join(path, _cxx)
59
        _cxx = os.path.join(path, _cxx)
61
        _shcxx = os.path.join(path, _shcxx)
60
61
    if 'CXX' not in env:
62
        env['CXX'] = _cxx
62
63
63
    cplusplus.generate(env)
64
    cplusplus.generate(env)
64
65
65
    env['CXX'] = _cxx
66
    if version:
66
    env['SHCXX'] = _shcxx
67
        env['CXXVERSION'] = version
67
    env['CXXVERSION'] = version
68
    env['SHOBJSUFFIX'] = '.pic.o'
69
    
68
    
70
def exists(env):
69
def exists(env):
71
    path, _cxx, _shcxx, version = get_xlc(env)
70
    path, _cxx, version = get_xlc(env)
72
    if path and _cxx:
71
    if path and _cxx:
73
        xlc = os.path.join(path, _cxx)
72
        xlc = os.path.join(path, _cxx)
74
        if os.path.exists(xlc):
73
        if os.path.exists(xlc):
(-)a/src/engine/SCons/Tool/aixcc.py (-9 / +9 lines)
Lines 42-66 Link Here
42
42
43
def get_xlc(env):
43
def get_xlc(env):
44
    xlc = env.get('CC', 'xlc')
44
    xlc = env.get('CC', 'xlc')
45
    xlc_r = env.get('SHCC', 'xlc_r')
45
    return SCons.Platform.aix.get_xlc(env, xlc, packages)
46
    return SCons.Platform.aix.get_xlc(env, xlc, xlc_r, packages)
47
46
48
def generate(env):
47
def generate(env):
49
    """Add Builders and construction variables for xlc / Visual Age
48
    """Add Builders and construction variables for xlc / Visual Age
50
    suite to an Environment."""
49
    suite to an Environment."""
51
    path, _cc, _shcc, version = get_xlc(env)
50
    path, _cc, version = get_xlc(env)
52
    if path:
51
    if path and _cc:
53
        _cc = os.path.join(path, _cc)
52
        _cc = os.path.join(path, _cc)
54
        _shcc = os.path.join(path, _shcc)
53
54
    if 'CC' not in env:
55
        env['CC'] = _cc
55
56
56
    cc.generate(env)
57
    cc.generate(env)
57
58
58
    env['CC'] = _cc
59
    if version:
59
    env['SHCC'] = _shcc
60
        env['CCVERSION'] = version
60
    env['CCVERSION'] = version
61
61
62
def exists(env):
62
def exists(env):
63
    path, _cc, _shcc, version = get_xlc(env)
63
    path, _cc, version = get_xlc(env)
64
    if path and _cc:
64
    if path and _cc:
65
        xlc = os.path.join(path, _cc)
65
        xlc = os.path.join(path, _cc)
66
        if os.path.exists(xlc):
66
        if os.path.exists(xlc):

Return to bug 511036