Ignore:
Timestamp:
Sep 3, 2010, 5:33:06 PM (15 years ago)
Author:
Yuri Dario
Message:

python: merged offline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Lib/distutils/sysconfig.py

    r2 r10  
    9191            return os.path.join(prefix, "Include")
    9292    elif os.name == "os2":
    93         return os.path.join(prefix, "Include")
     93        if python_build:
     94            base = os.path.dirname(os.path.abspath(sys.executable))
     95            if plat_specific:
     96                inc_dir = base
     97            else:
     98                inc_dir = os.path.join(base, "Include")
     99                if not os.path.exists(inc_dir):
     100                    inc_dir = os.path.join(os.path.dirname(base), "Include")
     101            return inc_dir
     102        return os.path.join(prefix, "include", "python" + get_python_version())
    94103    else:
    95104        raise DistutilsPlatformError(
     
    145154
    146155    elif os.name == "os2":
     156        libpython = os.path.join(prefix,
     157                                 "lib", "python" + get_python_version())
    147158        if standard_lib:
    148             return os.path.join(prefix, "Lib")
    149         else:
    150             return os.path.join(prefix, "Lib", "site-packages")
     159            return libpython
     160        else:
     161            return os.path.join(libpython, "site-packages")
    151162
    152163    else:
     
    491502    """Initialize the module as appropriate for OS/2"""
    492503    g = {}
     504    # load the installed Makefile:
     505    try:
     506        filename = get_makefile_filename()
     507        parse_makefile(filename, g)
     508    except IOError, msg:
     509        my_msg = "invalid Python installation: unable to open %s" % filename
     510        if hasattr(msg, "strerror"):
     511            my_msg = my_msg + " (%s)" % msg.strerror
     512
     513        raise DistutilsPlatformError(my_msg)
     514
     515    # load the installed pyconfig.h:
     516    try:
     517        filename = get_config_h_filename()
     518        parse_config_h(file(filename), g)
     519    except IOError, msg:
     520        my_msg = "invalid Python installation: unable to open %s" % filename
     521        if hasattr(msg, "strerror"):
     522            my_msg = my_msg + " (%s)" % msg.strerror
     523
     524        raise DistutilsPlatformError(my_msg)
     525
     526    # On AIX, there are wrong paths to the linker scripts in the Makefile
     527    # -- these paths are relative to the Python source, but when installed
     528    # the scripts are in another directory.
     529    if python_build:
     530        g['LDSHARED'] = g['BLDSHARED']
     531
     532    # OS/2 module
     533
    493534    # set basic install directories
    494535    g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
Note: See TracChangeset for help on using the changeset viewer.