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
e8c6ce46
Commit
e8c6ce46
authored
Feb 09, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'debug' option, and changed compile/link calls to use it.
parent
32462001
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
Lib/distutils/command/build_clib.py
Lib/distutils/command/build_clib.py
+9
-3
Lib/distutils/command/build_ext.py
Lib/distutils/command/build_ext.py
+12
-4
Lib/distutils/command/build_lib.py
Lib/distutils/command/build_lib.py
+9
-3
No files found.
Lib/distutils/command/build_clib.py
View file @
e8c6ce46
...
@@ -28,7 +28,9 @@ from distutils.ccompiler import new_compiler
...
@@ -28,7 +28,9 @@ from distutils.ccompiler import new_compiler
class
BuildLib
(
Command
):
class
BuildLib
(
Command
):
options
=
[]
options
=
[(
'debug'
,
'g'
,
"compile with debugging information"
),
]
def
set_default_options
(
self
):
def
set_default_options
(
self
):
# List of libraries to build
# List of libraries to build
...
@@ -38,10 +40,13 @@ class BuildLib (Command):
...
@@ -38,10 +40,13 @@ class BuildLib (Command):
self
.
include_dirs
=
None
self
.
include_dirs
=
None
self
.
define
=
None
self
.
define
=
None
self
.
undef
=
None
self
.
undef
=
None
self
.
debug
=
None
# set_default_options()
# set_default_options()
def
set_final_options
(
self
):
def
set_final_options
(
self
):
self
.
set_undefined_options
(
'build'
,
(
'debug'
,
'debug'
))
self
.
libraries
=
self
.
distribution
.
libraries
self
.
libraries
=
self
.
distribution
.
libraries
if
self
.
include_dirs
is
None
:
if
self
.
include_dirs
is
None
:
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
...
@@ -146,12 +151,13 @@ class BuildLib (Command):
...
@@ -146,12 +151,13 @@ class BuildLib (Command):
objects
=
self
.
compiler
.
compile
(
sources
,
objects
=
self
.
compiler
.
compile
(
sources
,
macros
=
macros
,
macros
=
macros
,
include_dirs
=
include_dirs
,
include_dirs
=
include_dirs
,
output_dir
=
lib_dir
)
output_dir
=
lib_dir
,
debug
=
self
.
debug
)
# Now "link" the object files together into a static library.
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
# builds an archive. Whatever.)
self
.
compiler
.
link_static_lib
(
objects
,
lib_name
)
self
.
compiler
.
link_static_lib
(
objects
,
lib_name
,
debug
=
self
.
debug
)
# for libraries
# for libraries
...
...
Lib/distutils/command/build_ext.py
View file @
e8c6ce46
...
@@ -58,6 +58,8 @@ class BuildExt (Command):
...
@@ -58,6 +58,8 @@ class BuildExt (Command):
"directories to search for shared C libraries at runtime"
),
"directories to search for shared C libraries at runtime"
),
(
'link-objects='
,
'O'
,
(
'link-objects='
,
'O'
,
"extra explicit link objects to include in the link"
),
"extra explicit link objects to include in the link"
),
(
'debug'
,
'g'
,
"compile/link with debugging information"
),
]
]
...
@@ -73,12 +75,15 @@ class BuildExt (Command):
...
@@ -73,12 +75,15 @@ class BuildExt (Command):
self
.
library_dirs
=
None
self
.
library_dirs
=
None
self
.
rpath
=
None
self
.
rpath
=
None
self
.
link_objects
=
None
self
.
link_objects
=
None
self
.
debug
=
None
def
set_final_options
(
self
):
def
set_final_options
(
self
):
from
distutils
import
sysconfig
from
distutils
import
sysconfig
self
.
set_undefined_options
(
'build'
,
(
'build_platlib'
,
'build_dir'
))
self
.
set_undefined_options
(
'build'
,
(
'build_platlib'
,
'build_dir'
),
(
'debug'
,
'debug'
))
if
self
.
package
is
None
:
if
self
.
package
is
None
:
self
.
package
=
self
.
distribution
.
ext_package
self
.
package
=
self
.
distribution
.
ext_package
...
@@ -223,7 +228,8 @@ class BuildExt (Command):
...
@@ -223,7 +228,8 @@ class BuildExt (Command):
include_dirs
=
build_info
.
get
(
'include_dirs'
)
include_dirs
=
build_info
.
get
(
'include_dirs'
)
self
.
compiler
.
compile
(
sources
,
self
.
compiler
.
compile
(
sources
,
macros
=
macros
,
macros
=
macros
,
include_dirs
=
include_dirs
)
include_dirs
=
include_dirs
,
debug
=
self
.
debug
)
# Now link the object files together into a "shared object" --
# Now link the object files together into a "shared object" --
# of course, first we have to figure out all the other things
# of course, first we have to figure out all the other things
...
@@ -236,7 +242,8 @@ class BuildExt (Command):
...
@@ -236,7 +242,8 @@ class BuildExt (Command):
library_dirs
=
build_info
.
get
(
'library_dirs'
)
library_dirs
=
build_info
.
get
(
'library_dirs'
)
extra_args
=
build_info
.
get
(
'extra_link_args'
)
or
[]
extra_args
=
build_info
.
get
(
'extra_link_args'
)
or
[]
if
self
.
compiler
.
compiler_type
==
'msvc'
:
if
self
.
compiler
.
compiler_type
==
'msvc'
:
extra_args
.
append
(
'/export:init%s'
%
extension_name
)
mod_name
=
string
.
split
(
extension_name
,
'.'
)[
-
1
]
extra_args
.
append
(
'/export:init%s'
%
mod_name
)
ext_filename
=
self
.
extension_filename
\
ext_filename
=
self
.
extension_filename
\
(
extension_name
,
self
.
package
)
(
extension_name
,
self
.
package
)
...
@@ -246,7 +253,8 @@ class BuildExt (Command):
...
@@ -246,7 +253,8 @@ class BuildExt (Command):
self
.
compiler
.
link_shared_object
(
objects
,
ext_filename
,
self
.
compiler
.
link_shared_object
(
objects
,
ext_filename
,
libraries
=
libraries
,
libraries
=
libraries
,
library_dirs
=
library_dirs
,
library_dirs
=
library_dirs
,
extra_postargs
=
extra_args
)
extra_postargs
=
extra_args
,
debug
=
self
.
debug
)
# build_extensions ()
# build_extensions ()
...
...
Lib/distutils/command/build_lib.py
View file @
e8c6ce46
...
@@ -28,7 +28,9 @@ from distutils.ccompiler import new_compiler
...
@@ -28,7 +28,9 @@ from distutils.ccompiler import new_compiler
class
BuildLib
(
Command
):
class
BuildLib
(
Command
):
options
=
[]
options
=
[(
'debug'
,
'g'
,
"compile with debugging information"
),
]
def
set_default_options
(
self
):
def
set_default_options
(
self
):
# List of libraries to build
# List of libraries to build
...
@@ -38,10 +40,13 @@ class BuildLib (Command):
...
@@ -38,10 +40,13 @@ class BuildLib (Command):
self
.
include_dirs
=
None
self
.
include_dirs
=
None
self
.
define
=
None
self
.
define
=
None
self
.
undef
=
None
self
.
undef
=
None
self
.
debug
=
None
# set_default_options()
# set_default_options()
def
set_final_options
(
self
):
def
set_final_options
(
self
):
self
.
set_undefined_options
(
'build'
,
(
'debug'
,
'debug'
))
self
.
libraries
=
self
.
distribution
.
libraries
self
.
libraries
=
self
.
distribution
.
libraries
if
self
.
include_dirs
is
None
:
if
self
.
include_dirs
is
None
:
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
...
@@ -146,12 +151,13 @@ class BuildLib (Command):
...
@@ -146,12 +151,13 @@ class BuildLib (Command):
objects
=
self
.
compiler
.
compile
(
sources
,
objects
=
self
.
compiler
.
compile
(
sources
,
macros
=
macros
,
macros
=
macros
,
include_dirs
=
include_dirs
,
include_dirs
=
include_dirs
,
output_dir
=
lib_dir
)
output_dir
=
lib_dir
,
debug
=
self
.
debug
)
# Now "link" the object files together into a static library.
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
# builds an archive. Whatever.)
self
.
compiler
.
link_static_lib
(
objects
,
lib_name
)
self
.
compiler
.
link_static_lib
(
objects
,
lib_name
,
debug
=
self
.
debug
)
# for libraries
# for libraries
...
...
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