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
1b046e43
Commit
1b046e43
authored
Jun 18, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add implementation of _compile() and use default compile() method.
parent
6e08d22b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
84 deletions
+33
-84
Lib/distutils/cygwinccompiler.py
Lib/distutils/cygwinccompiler.py
+14
-31
Lib/distutils/emxccompiler.py
Lib/distutils/emxccompiler.py
+13
-35
Lib/distutils/unixccompiler.py
Lib/distutils/unixccompiler.py
+6
-18
No files found.
Lib/distutils/cygwinccompiler.py
View file @
1b046e43
...
...
@@ -113,37 +113,20 @@ class CygwinCCompiler (UnixCCompiler):
# __init__ ()
# not much different of the compile method in UnixCCompiler,
# but we have to insert some lines in the middle of it, so
# we put here a adapted version of it.
# (If we would call compile() in the base class, it would do some
# initializations a second time, this is why all is done here.)
def
compile
(
self
,
sources
,
output_dir
=
None
,
macros
=
None
,
include_dirs
=
None
,
debug
=
0
,
extra_preargs
=
None
,
extra_postargs
=
None
,
depends
=
None
):
macros
,
objects
,
extra_postargs
,
pp_opts
,
build
=
\
self
.
_setup_compile
(
output_dir
,
macros
,
include_dirs
,
sources
,
depends
,
extra_postargs
)
cc_args
=
self
.
_get_cc_args
(
pp_opts
,
debug
,
extra_preargs
)
for
obj
,
(
src
,
ext
)
in
build
.
items
():
if
ext
==
'.rc'
or
ext
==
'.res'
:
# gcc needs '.res' and '.rc' compiled to object files !!!
try
:
self
.
spawn
([
"windres"
,
"-i"
,
src
,
"-o"
,
obj
])
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
else
:
# for other files use the C-compiler
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
# Return *all* object filenames, not just the ones we just built.
return
objects
def
_compile
(
self
,
obj
,
src
,
ext
,
cc_args
,
extra_postargs
,
pp_opts
):
if
ext
==
'.rc'
or
ext
==
'.res'
:
# gcc needs '.res' and '.rc' compiled to object files !!!
try
:
self
.
spawn
([
"windres"
,
"-i"
,
src
,
"-o"
,
obj
])
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
else
:
# for other files use the C-compiler
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
def
link
(
self
,
target_desc
,
...
...
Lib/distutils/emxccompiler.py
View file @
1b046e43
...
...
@@ -76,41 +76,19 @@ class EMXCCompiler (UnixCCompiler):
# __init__ ()
# not much different of the compile method in UnixCCompiler,
# but we have to insert some lines in the middle of it, so
# we put here a adapted version of it.
# (If we would call compile() in the base class, it would do some
# initializations a second time, this is why all is done here.)
def
compile
(
self
,
sources
,
output_dir
=
None
,
macros
=
None
,
include_dirs
=
None
,
debug
=
0
,
extra_preargs
=
None
,
extra_postargs
=
None
,
depends
=
None
):
macros
,
objects
,
extra_postargs
,
pp_opts
,
build
=
\
self
.
_setup_compile
(
output_dir
,
macros
,
include_dirs
,
sources
,
depends
,
extra_postargs
)
cc_args
=
self
.
_get_cc_args
(
pp_opts
,
debug
,
extra_preargs
)
for
obj
,
(
src
,
ext
)
in
build
.
items
():
if
ext
==
'.rc'
:
# gcc requires '.rc' compiled to binary ('.res') files !!!
try
:
self
.
spawn
([
"rc"
,
"-r"
,
src
])
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
else
:
# for other files use the C-compiler
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
# Return *all* object filenames, not just the ones we just built.
return
objects
# compile ()
def
_compile
(
self
,
obj
,
src
,
ext
,
cc_args
,
extra_postargs
):
if
ext
==
'.rc'
:
# gcc requires '.rc' compiled to binary ('.res') files !!!
try
:
self
.
spawn
([
"rc"
,
"-r"
,
src
])
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
else
:
# for other files use the C-compiler
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
def
link
(
self
,
target_desc
,
...
...
Lib/distutils/unixccompiler.py
View file @
1b046e43
...
...
@@ -105,24 +105,12 @@ class UnixCCompiler(CCompiler):
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
def
compile
(
self
,
sources
,
output_dir
=
None
,
macros
=
None
,
include_dirs
=
None
,
debug
=
0
,
extra_preargs
=
None
,
extra_postargs
=
None
,
depends
=
None
):
macros
,
objects
,
extra_postargs
,
pp_opts
,
build
=
\
self
.
_setup_compile
(
output_dir
,
macros
,
include_dirs
,
sources
,
depends
,
extra_postargs
)
cc_args
=
self
.
_get_cc_args
(
pp_opts
,
debug
,
extra_preargs
)
for
obj
,
(
src
,
ext
)
in
build
.
items
():
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
# Return *all* object filenames, not just the ones we just built.
return
objects
def
_compile
(
self
,
obj
,
src
,
ext
,
cc_args
,
extra_postargs
,
pp_opts
):
try
:
self
.
spawn
(
self
.
compiler_so
+
cc_args
+
[
src
,
'-o'
,
obj
]
+
extra_postargs
)
except
DistutilsExecError
,
msg
:
raise
CompileError
,
msg
def
create_static_lib
(
self
,
objects
,
output_libname
,
output_dir
=
None
,
debug
=
0
):
...
...
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