summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-02-09 02:17:00 (GMT)
committerGreg Ward <gward@python.net>2000-02-09 02:17:00 (GMT)
commitba233fbe92582abf1c779aa392b36130e1b3a7da (patch)
treeaeb4d8d93e299e00300654afa22b109dd1adcc08 /Lib/distutils
parent3c045a576649ddf28eb6f9b33c749e8db0dd2255 (diff)
downloadcpython-ba233fbe92582abf1c779aa392b36130e1b3a7da.zip
cpython-ba233fbe92582abf1c779aa392b36130e1b3a7da.tar.gz
cpython-ba233fbe92582abf1c779aa392b36130e1b3a7da.tar.bz2
Added 'debug' flags to compile and link methods, and modified code to add
'-g' flag to compiler/linker command lines when it's true.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/unixccompiler.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 9ace986..cc0d772 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -102,6 +102,7 @@ class UnixCCompiler (CCompiler):
output_dir=None,
macros=None,
include_dirs=None,
+ debug=0,
extra_preargs=None,
extra_postargs=None):
@@ -149,6 +150,8 @@ class UnixCCompiler (CCompiler):
# (will have to fix this when I add the ability to build a
# new Python)
cc_args = ['-c'] + pp_opts + self.ccflags + self.ccflags_shared
+ if debug:
+ cc_args[:0] = ['-g']
if extra_preargs:
cc_args[:0] = extra_preargs
if extra_postargs is None:
@@ -194,7 +197,8 @@ class UnixCCompiler (CCompiler):
def link_static_lib (self,
objects,
output_libname,
- output_dir=None):
+ output_dir=None,
+ debug=0):
if type (objects) not in (ListType, TupleType):
raise TypeError, \
@@ -234,6 +238,7 @@ class UnixCCompiler (CCompiler):
output_dir=None,
libraries=None,
library_dirs=None,
+ debug=0,
extra_preargs=None,
extra_postargs=None):
# XXX should we sanity check the library name? (eg. no
@@ -244,6 +249,7 @@ class UnixCCompiler (CCompiler):
output_dir,
libraries,
library_dirs,
+ debug,
extra_preargs,
extra_postargs)
@@ -254,6 +260,7 @@ class UnixCCompiler (CCompiler):
output_dir=None,
libraries=None,
library_dirs=None,
+ debug=0,
extra_preargs=None,
extra_postargs=None):
@@ -279,6 +286,8 @@ class UnixCCompiler (CCompiler):
if self.force or newer:
ld_args = self.ldflags_shared + objects + \
lib_opts + ['-o', output_filename]
+ if debug:
+ ld_args[:0] = ['-g']
if extra_preargs:
ld_args[:0] = extra_preargs
if extra_postargs:
@@ -296,6 +305,7 @@ class UnixCCompiler (CCompiler):
output_dir=None,
libraries=None,
library_dirs=None,
+ debug=0,
extra_preargs=None,
extra_postargs=None):
@@ -318,6 +328,8 @@ class UnixCCompiler (CCompiler):
if self.force or newer:
ld_args = objects + lib_opts + ['-o', output_filename]
+ if debug:
+ ld_args[:0] = ['-g']
if extra_preargs:
ld_args[:0] = extra_preargs
if extra_postargs: