Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2544f510
Commit
2544f510
authored
Jan 31, 2002
by
Marc-André Lemburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OS/2 patches by Andrew I MacIntyre for distutils.
Closes patch #435381.
parent
c318260a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
4 deletions
+108
-4
Lib/distutils/ccompiler.py
Lib/distutils/ccompiler.py
+3
-0
Lib/distutils/command/bdist.py
Lib/distutils/command/bdist.py
+2
-1
Lib/distutils/command/bdist_dumb.py
Lib/distutils/command/bdist_dumb.py
+8
-1
Lib/distutils/command/build_ext.py
Lib/distutils/command/build_ext.py
+26
-1
Lib/distutils/command/install.py
Lib/distutils/command/install.py
+7
-0
Lib/distutils/spawn.py
Lib/distutils/spawn.py
+30
-1
Lib/distutils/sysconfig.py
Lib/distutils/sysconfig.py
+26
-0
Lib/distutils/util.py
Lib/distutils/util.py
+6
-0
No files found.
Lib/distutils/ccompiler.py
View file @
2544f510
...
@@ -846,6 +846,7 @@ _default_compilers = (
...
@@ -846,6 +846,7 @@ _default_compilers = (
# on a cygwin built python we can use gcc like an ordinary UNIXish
# on a cygwin built python we can use gcc like an ordinary UNIXish
# compiler
# compiler
(
'cygwin.*'
,
'unix'
),
(
'cygwin.*'
,
'unix'
),
(
'os2emx'
,
'emx'
),
# OS name mappings
# OS name mappings
(
'posix'
,
'unix'
),
(
'posix'
,
'unix'
),
...
@@ -892,6 +893,8 @@ compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
...
@@ -892,6 +893,8 @@ compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
"Borland C++ Compiler"
),
"Borland C++ Compiler"
),
'mwerks'
:
(
'mwerkscompiler'
,
'MWerksCompiler'
,
'mwerks'
:
(
'mwerkscompiler'
,
'MWerksCompiler'
,
"MetroWerks CodeWarrior"
),
"MetroWerks CodeWarrior"
),
'emx'
:
(
'emxccompiler'
,
'EMXCCompiler'
,
"EMX port of GNU C Compiler for OS/2"
),
}
}
def
show_compilers
():
def
show_compilers
():
...
...
Lib/distutils/command/bdist.py
View file @
2544f510
...
@@ -57,7 +57,8 @@ class bdist (Command):
...
@@ -57,7 +57,8 @@ class bdist (Command):
# This won't do in reality: will need to distinguish RPM-ish Linux,
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format
=
{
'posix'
:
'gztar'
,
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
}
'nt'
:
'zip'
,
'os2'
:
'zip'
,
}
# Establish the preferred order (for the --help-formats option).
# Establish the preferred order (for the --help-formats option).
format_commands
=
[
'rpm'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
format_commands
=
[
'rpm'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
...
...
Lib/distutils/command/bdist_dumb.py
View file @
2544f510
...
@@ -37,7 +37,8 @@ class bdist_dumb (Command):
...
@@ -37,7 +37,8 @@ class bdist_dumb (Command):
boolean_options
=
[
'keep-temp'
,
'skip-build'
]
boolean_options
=
[
'keep-temp'
,
'skip-build'
]
default_format
=
{
'posix'
:
'gztar'
,
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
}
'nt'
:
'zip'
,
'os2'
:
'zip'
}
def
initialize_options
(
self
):
def
initialize_options
(
self
):
...
@@ -88,6 +89,12 @@ class bdist_dumb (Command):
...
@@ -88,6 +89,12 @@ class bdist_dumb (Command):
# pseudo-installation tree.
# pseudo-installation tree.
archive_basename
=
"%s.%s"
%
(
self
.
distribution
.
get_fullname
(),
archive_basename
=
"%s.%s"
%
(
self
.
distribution
.
get_fullname
(),
self
.
plat_name
)
self
.
plat_name
)
# OS/2 objects to any ":" characters in a filename (such as when
# a timestamp is used in a version) so change them to hyphens.
if
os
.
name
==
"os2"
:
archive_basename
=
archive_basename
.
replace
(
":"
,
"-"
)
self
.
make_archive
(
os
.
path
.
join
(
self
.
dist_dir
,
archive_basename
),
self
.
make_archive
(
os
.
path
.
join
(
self
.
dist_dir
,
archive_basename
),
self
.
format
,
self
.
format
,
root_dir
=
self
.
bdist_dir
)
root_dir
=
self
.
bdist_dir
)
...
...
Lib/distutils/command/build_ext.py
View file @
2544f510
...
@@ -167,6 +167,11 @@ class build_ext (Command):
...
@@ -167,6 +167,11 @@ class build_ext (Command):
else
:
else
:
self
.
build_temp
=
os
.
path
.
join
(
self
.
build_temp
,
"Release"
)
self
.
build_temp
=
os
.
path
.
join
(
self
.
build_temp
,
"Release"
)
# OS/2 (EMX) doesn't support Debug vs Release builds, but has the
# import libraries in its "Config" subdirectory
if
os
.
name
==
'os2'
:
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'Config'
))
# for extensions under Cygwin Python's library directory must be
# for extensions under Cygwin Python's library directory must be
# appended to library_dirs
# appended to library_dirs
if
sys
.
platform
[:
6
]
==
'cygwin'
:
if
sys
.
platform
[:
6
]
==
'cygwin'
:
...
@@ -554,6 +559,10 @@ class build_ext (Command):
...
@@ -554,6 +559,10 @@ class build_ext (Command):
else
:
else
:
return
"swig.exe"
return
"swig.exe"
elif
os
.
name
==
"os2"
:
# assume swig available in the PATH.
return
"swig.exe"
else
:
else
:
raise
DistutilsPlatformError
,
\
raise
DistutilsPlatformError
,
\
(
"I don't know how to find (much less run) SWIG "
(
"I don't know how to find (much less run) SWIG "
...
@@ -578,6 +587,9 @@ class build_ext (Command):
...
@@ -578,6 +587,9 @@ class build_ext (Command):
from
distutils.sysconfig
import
get_config_var
from
distutils.sysconfig
import
get_config_var
ext_path
=
string
.
split
(
ext_name
,
'.'
)
ext_path
=
string
.
split
(
ext_name
,
'.'
)
# OS/2 has an 8 character module (extension) limit :-(
if
os
.
name
==
"os2"
:
ext_path
[
len
(
ext_path
)
-
1
]
=
ext_path
[
len
(
ext_path
)
-
1
][:
8
]
# extensions in debug_mode are named 'module_d.pyd' under windows
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext
=
get_config_var
(
'SO'
)
so_ext
=
get_config_var
(
'SO'
)
if
os
.
name
==
'nt'
and
self
.
debug
:
if
os
.
name
==
'nt'
and
self
.
debug
:
...
@@ -599,7 +611,7 @@ class build_ext (Command):
...
@@ -599,7 +611,7 @@ class build_ext (Command):
def
get_libraries
(
self
,
ext
):
def
get_libraries
(
self
,
ext
):
"""Return the list of libraries to link against when building a
"""Return the list of libraries to link against when building a
shared extension. On most platforms, this is just 'ext.libraries';
shared extension. On most platforms, this is just 'ext.libraries';
on Windows, we add the Python library (eg. python20.dll).
on Windows
and OS/2
, we add the Python library (eg. python20.dll).
"""
"""
# The python library is always needed on Windows. For MSVC, this
# The python library is always needed on Windows. For MSVC, this
# is redundant, since the library is mentioned in a pragma in
# is redundant, since the library is mentioned in a pragma in
...
@@ -617,6 +629,19 @@ class build_ext (Command):
...
@@ -617,6 +629,19 @@ class build_ext (Command):
# don't extend ext.libraries, it may be shared with other
# don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list
# extensions, it is a reference to the original list
return
ext
.
libraries
+
[
pythonlib
]
return
ext
.
libraries
+
[
pythonlib
]
elif
sys
.
platform
==
"os2emx"
:
# EMX/GCC requires the python library explicitly, and I
# believe VACPP does as well (though not confirmed) - AIM Apr01
template
=
"python%d%d"
# debug versions of the main DLL aren't supported, at least
# not at this time - AIM Apr01
#if self.debug:
# template = template + '_d'
pythonlib
=
(
template
%
(
sys
.
hexversion
>>
24
,
(
sys
.
hexversion
>>
16
)
&
0xff
))
# don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list
return
ext
.
libraries
+
[
pythonlib
]
elif
sys
.
platform
[:
6
]
==
"cygwin"
:
elif
sys
.
platform
[:
6
]
==
"cygwin"
:
template
=
"python%d.%d"
template
=
"python%d.%d"
pythonlib
=
(
template
%
pythonlib
=
(
template
%
...
...
Lib/distutils/command/install.py
View file @
2544f510
...
@@ -50,6 +50,13 @@ INSTALL_SCHEMES = {
...
@@ -50,6 +50,13 @@ INSTALL_SCHEMES = {
},
},
'nt'
:
WINDOWS_SCHEME
,
'nt'
:
WINDOWS_SCHEME
,
'mac'
:
{
'mac'
:
{
'purelib'
:
'$base/Lib/site-packages'
,
'platlib'
:
'$base/Lib/site-packages'
,
'headers'
:
'$base/Include/$dist_name'
,
'scripts'
:
'$base/Scripts'
,
'data'
:
'$base'
,
},
'os2'
:
{
'purelib'
:
'$base/Lib/site-packages'
,
'purelib'
:
'$base/Lib/site-packages'
,
'platlib'
:
'$base/Lib/site-packages'
,
'platlib'
:
'$base/Lib/site-packages'
,
'headers'
:
'$base/Include/$dist_name'
,
'headers'
:
'$base/Include/$dist_name'
,
...
...
Lib/distutils/spawn.py
View file @
2544f510
...
@@ -38,6 +38,8 @@ def spawn (cmd,
...
@@ -38,6 +38,8 @@ def spawn (cmd,
_spawn_posix
(
cmd
,
search_path
,
verbose
,
dry_run
)
_spawn_posix
(
cmd
,
search_path
,
verbose
,
dry_run
)
elif
os
.
name
==
'nt'
:
elif
os
.
name
==
'nt'
:
_spawn_nt
(
cmd
,
search_path
,
verbose
,
dry_run
)
_spawn_nt
(
cmd
,
search_path
,
verbose
,
dry_run
)
elif
os
.
name
==
'os2'
:
_spawn_os2
(
cmd
,
search_path
,
verbose
,
dry_run
)
else
:
else
:
raise
DistutilsPlatformError
,
\
raise
DistutilsPlatformError
,
\
"don't know how to spawn programs on platform '%s'"
%
os
.
name
"don't know how to spawn programs on platform '%s'"
%
os
.
name
...
@@ -88,6 +90,33 @@ def _spawn_nt (cmd,
...
@@ -88,6 +90,33 @@ def _spawn_nt (cmd,
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
)
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
)
def
_spawn_os2
(
cmd
,
search_path
=
1
,
verbose
=
0
,
dry_run
=
0
):
executable
=
cmd
[
0
]
#cmd = _nt_quote_args(cmd)
if
search_path
:
# either we find one or it stays the same
executable
=
find_executable
(
executable
)
or
executable
if
verbose
:
print
string
.
join
([
executable
]
+
cmd
[
1
:],
' '
)
if
not
dry_run
:
# spawnv for OS/2 EMX requires a full path to the .exe
try
:
rc
=
os
.
spawnv
(
os
.
P_WAIT
,
executable
,
cmd
)
except
OSError
,
exc
:
# this seems to happen when the command isn't found
raise
DistutilsExecError
,
\
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
[
-
1
])
if
rc
!=
0
:
# and this reflects the command running but failing
print
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
)
raise
DistutilsExecError
,
\
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
)
def
_spawn_posix
(
cmd
,
def
_spawn_posix
(
cmd
,
search_path
=
1
,
search_path
=
1
,
verbose
=
0
,
verbose
=
0
,
...
@@ -154,7 +183,7 @@ def find_executable(executable, path=None):
...
@@ -154,7 +183,7 @@ def find_executable(executable, path=None):
path
=
os
.
environ
[
'PATH'
]
path
=
os
.
environ
[
'PATH'
]
paths
=
string
.
split
(
path
,
os
.
pathsep
)
paths
=
string
.
split
(
path
,
os
.
pathsep
)
(
base
,
ext
)
=
os
.
path
.
splitext
(
executable
)
(
base
,
ext
)
=
os
.
path
.
splitext
(
executable
)
if
(
sys
.
platform
==
'win32'
)
and
(
ext
!=
'.exe'
):
if
(
sys
.
platform
==
'win32'
or
os
.
name
==
'os2'
)
and
(
ext
!=
'.exe'
):
executable
=
executable
+
'.exe'
executable
=
executable
+
'.exe'
if
not
os
.
path
.
isfile
(
executable
):
if
not
os
.
path
.
isfile
(
executable
):
for
p
in
paths
:
for
p
in
paths
:
...
...
Lib/distutils/sysconfig.py
View file @
2544f510
...
@@ -59,6 +59,8 @@ def get_python_inc(plat_specific=0, prefix=None):
...
@@ -59,6 +59,8 @@ def get_python_inc(plat_specific=0, prefix=None):
return
os
.
path
.
join
(
prefix
,
"include"
)
return
os
.
path
.
join
(
prefix
,
"include"
)
elif
os
.
name
==
"mac"
:
elif
os
.
name
==
"mac"
:
return
os
.
path
.
join
(
prefix
,
"Include"
)
return
os
.
path
.
join
(
prefix
,
"Include"
)
elif
os
.
name
==
"os2"
:
return
os
.
path
.
join
(
prefix
,
"Include"
)
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"I don't know where Python installs its C header files "
"I don't know where Python installs its C header files "
...
@@ -110,6 +112,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
...
@@ -110,6 +112,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
return
os
.
path
.
join
(
prefix
,
"Lib"
)
return
os
.
path
.
join
(
prefix
,
"Lib"
)
else
:
else
:
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
elif
os
.
name
==
"os2"
:
if
standard_lib
:
return
os
.
path
.
join
(
PREFIX
,
"Lib"
)
else
:
return
os
.
path
.
join
(
PREFIX
,
"Lib"
,
"site-packages"
)
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"I don't know where Python installs its library "
"I don't know where Python installs its library "
...
@@ -391,6 +400,23 @@ def _init_mac():
...
@@ -391,6 +400,23 @@ def _init_mac():
_config_vars = g
_config_vars = g
def _init_os2():
"""Initialize the module as appropriate for OS/2"""
g = {}
# set basic install directories
g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1)
# XXX hmmm.. a normal install puts include files here
g['INCLUDEPY'] = get_python_inc(plat_specific=0)
g['SO'] = '.pyd'
g['EXE'] = "
.
exe
"
global _config_vars
_config_vars = g
def get_config_vars(*args):
def get_config_vars(*args):
"""With no arguments, return a dictionary of all configuration
"""With no arguments, return a dictionary of all configuration
variables relevant for the current platform. Generally this includes
variables relevant for the current platform. Generally this includes
...
...
Lib/distutils/util.py
View file @
2544f510
...
@@ -117,6 +117,12 @@ def change_root (new_root, pathname):
...
@@ -117,6 +117,12 @@ def change_root (new_root, pathname):
path = path[1:]
path = path[1:]
return os.path.join(new_root, path)
return os.path.join(new_root, path)
elif os.name == '
os2
':
(drive, path) = os.path.splitdrive(pathname)
if path[0] == os.sep:
path = path[1:]
return os.path.join(new_root, path)
elif os.name == '
mac
':
elif os.name == '
mac
':
if not os.path.isabs(pathname):
if not os.path.isabs(pathname):
return os.path.join(new_root, pathname)
return os.path.join(new_root, pathname)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment