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
99f660af
Commit
99f660af
authored
May 07, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #5941: added ARFLAGS for the archiver command.
parent
ff748cd6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
11 deletions
+70
-11
Lib/distutils/sysconfig.py
Lib/distutils/sysconfig.py
+7
-3
Lib/distutils/tests/test_build_clib.py
Lib/distutils/tests/test_build_clib.py
+40
-0
Lib/distutils/tests/test_sysconfig.py
Lib/distutils/tests/test_sysconfig.py
+3
-2
Makefile.pre.in
Makefile.pre.in
+7
-6
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+5
-0
configure.in
configure.in
+7
-0
No files found.
Lib/distutils/sysconfig.py
View file @
99f660af
...
@@ -165,9 +165,9 @@ def customize_compiler(compiler):
...
@@ -165,9 +165,9 @@ def customize_compiler(compiler):
varies across Unices and is stored in Python's Makefile.
varies across Unices and is stored in Python's Makefile.
"""
"""
if
compiler
.
compiler_type
==
"unix"
:
if
compiler
.
compiler_type
==
"unix"
:
(
cc
,
cxx
,
opt
,
cflags
,
ccshared
,
ldshared
,
so_ext
,
ar
)
=
\
(
cc
,
cxx
,
opt
,
cflags
,
ccshared
,
ldshared
,
so_ext
,
ar
,
ar_flags
)
=
\
get_config_vars
(
'CC'
,
'CXX'
,
'OPT'
,
'CFLAGS'
,
get_config_vars
(
'CC'
,
'CXX'
,
'OPT'
,
'CFLAGS'
,
'CCSHARED'
,
'LDSHARED'
,
'SO'
,
'AR'
)
'CCSHARED'
,
'LDSHARED'
,
'SO'
,
'AR'
,
'ARFLAGS'
)
if
'CC'
in
os
.
environ
:
if
'CC'
in
os
.
environ
:
cc
=
os
.
environ
[
'CC'
]
cc
=
os
.
environ
[
'CC'
]
...
@@ -190,6 +190,10 @@ def customize_compiler(compiler):
...
@@ -190,6 +190,10 @@ def customize_compiler(compiler):
ldshared
=
ldshared
+
' '
+
os
.
environ
[
'CPPFLAGS'
]
ldshared
=
ldshared
+
' '
+
os
.
environ
[
'CPPFLAGS'
]
if
'AR'
in
os
.
environ
:
if
'AR'
in
os
.
environ
:
ar
=
os
.
environ
[
'AR'
]
ar
=
os
.
environ
[
'AR'
]
if
'ARFLAGS'
in
os
.
environ
:
archiver
=
ar
+
' '
+
os
.
environ
[
'ARFLAGS'
]
else
:
archiver
=
ar
+
' '
+
ar_flags
cc_cmd
=
cc
+
' '
+
cflags
cc_cmd
=
cc
+
' '
+
cflags
compiler
.
set_executables
(
compiler
.
set_executables
(
...
@@ -199,7 +203,7 @@ def customize_compiler(compiler):
...
@@ -199,7 +203,7 @@ def customize_compiler(compiler):
compiler_cxx
=
cxx
,
compiler_cxx
=
cxx
,
linker_so
=
ldshared
,
linker_so
=
ldshared
,
linker_exe
=
cc
,
linker_exe
=
cc
,
archiver
=
ar
)
archiver
=
ar
chiver
)
compiler
.
shared_lib_extension
=
so_ext
compiler
.
shared_lib_extension
=
so_ext
...
...
Lib/distutils/tests/test_build_clib.py
View file @
99f660af
"""Tests for distutils.command.build_clib."""
"""Tests for distutils.command.build_clib."""
import
unittest
import
unittest
import
os
import
sys
from
distutils.command.build_clib
import
build_clib
from
distutils.command.build_clib
import
build_clib
from
distutils.errors
import
DistutilsSetupError
from
distutils.errors
import
DistutilsSetupError
from
distutils.tests
import
support
from
distutils.tests
import
support
from
distutils.spawn
import
find_executable
class
BuildCLibTestCase
(
support
.
TempdirManager
,
class
BuildCLibTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
support
.
LoggingSilencer
,
...
@@ -97,6 +100,43 @@ class BuildCLibTestCase(support.TempdirManager,
...
@@ -97,6 +100,43 @@ class BuildCLibTestCase(support.TempdirManager,
cmd
.
distribution
.
libraries
=
'WONTWORK'
cmd
.
distribution
.
libraries
=
'WONTWORK'
self
.
assertRaises
(
DistutilsSetupError
,
cmd
.
finalize_options
)
self
.
assertRaises
(
DistutilsSetupError
,
cmd
.
finalize_options
)
def
test_run
(
self
):
# can't test on windows
if
sys
.
platform
==
'win32'
:
return
pkg_dir
,
dist
=
self
.
create_dist
()
cmd
=
build_clib
(
dist
)
foo_c
=
os
.
path
.
join
(
pkg_dir
,
'foo.c'
)
self
.
write_file
(
foo_c
,
'int main(void) { return 1;}'
)
cmd
.
libraries
=
[(
'foo'
,
{
'sources'
:
[
foo_c
]})]
build_temp
=
os
.
path
.
join
(
pkg_dir
,
'build'
)
os
.
mkdir
(
build_temp
)
cmd
.
build_temp
=
build_temp
cmd
.
build_clib
=
build_temp
# before we run the command, we want to make sure
# all commands are present on the system
# by creating a compiler and checking its executables
from
distutils.ccompiler
import
new_compiler
from
distutils.sysconfig
import
customize_compiler
compiler
=
new_compiler
()
customize_compiler
(
compiler
)
for
ccmd
in
compiler
.
executables
.
values
():
if
ccmd
is
None
:
continue
if
find_executable
(
ccmd
[
0
])
is
None
:
return
# can't test
# this should work
cmd
.
run
()
# let's check the result
self
.
assert_
(
'libfoo.a'
in
os
.
listdir
(
build_temp
))
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
BuildCLibTestCase
)
return
unittest
.
makeSuite
(
BuildCLibTestCase
)
...
...
Lib/distutils/tests/test_sysconfig.py
View file @
99f660af
...
@@ -49,7 +49,8 @@ class SysconfigTestCase(unittest.TestCase):
...
@@ -49,7 +49,8 @@ class SysconfigTestCase(unittest.TestCase):
if
get_default_compiler
()
!=
'unix'
:
if
get_default_compiler
()
!=
'unix'
:
return
return
os
.
environ
[
'AR'
]
=
'xxx'
os
.
environ
[
'AR'
]
=
'my_ar'
os
.
environ
[
'ARFLAGS'
]
=
'-arflags'
# make sure AR gets caught
# make sure AR gets caught
class
compiler
:
class
compiler
:
...
@@ -60,7 +61,7 @@ class SysconfigTestCase(unittest.TestCase):
...
@@ -60,7 +61,7 @@ class SysconfigTestCase(unittest.TestCase):
comp
=
compiler
()
comp
=
compiler
()
sysconfig
.
customize_compiler
(
comp
)
sysconfig
.
customize_compiler
(
comp
)
self
.
assertEquals
(
comp
.
exes
[
'archiver'
],
'
xxx
'
)
self
.
assertEquals
(
comp
.
exes
[
'archiver'
],
'
my_ar -arflags
'
)
def
test_suite
():
def
test_suite
():
...
...
Makefile.pre.in
View file @
99f660af
...
@@ -67,6 +67,7 @@ LDLAST= @LDLAST@
...
@@ -67,6 +67,7 @@ LDLAST= @LDLAST@
SGI_ABI
=
@SGI_ABI@
SGI_ABI
=
@SGI_ABI@
CCSHARED
=
@CCSHARED@
CCSHARED
=
@CCSHARED@
LINKFORSHARED
=
@LINKFORSHARED@
LINKFORSHARED
=
@LINKFORSHARED@
ARFLAGS
=
@ARFLAGS@
# Extra C flags added for building the interpreter object files.
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED
=
@CFLAGSFORSHARED@
CFLAGSFORSHARED
=
@CFLAGSFORSHARED@
# C flags used for building the interpreter object files
# C flags used for building the interpreter object files
...
@@ -403,12 +404,12 @@ sharedmods: $(BUILDPYTHON)
...
@@ -403,12 +404,12 @@ sharedmods: $(BUILDPYTHON)
# avoid long command lines, same as LIBRARY_OBJS
# avoid long command lines, same as LIBRARY_OBJS
$(LIBRARY)
:
$(LIBRARY_OBJS)
$(LIBRARY)
:
$(LIBRARY_OBJS)
-
rm
-f
$@
-
rm
-f
$@
$(AR)
cr
$@
Modules/getbuildinfo.o
$(AR)
$(ARFLAGS)
$@
Modules/getbuildinfo.o
$(AR)
cr
$@
$(PARSER_OBJS)
$(AR)
$(ARFLAGS)
$@
$(PARSER_OBJS)
$(AR)
cr
$@
$(OBJECT_OBJS)
$(AR)
$(ARFLAGS)
$@
$(OBJECT_OBJS)
$(AR)
cr
$@
$(PYTHON_OBJS)
$(AR)
$(ARFLAGS)
$@
$(PYTHON_OBJS)
$(AR)
cr
$@
$(MODULE_OBJS)
$(SIGNAL_OBJS)
$(AR)
$(ARFLAGS)
$@
$(MODULE_OBJS)
$(SIGNAL_OBJS)
$(AR)
cr
$@
$(MODOBJS)
$(AR)
$(ARFLAGS)
$@
$(MODOBJS)
$(RANLIB)
$@
$(RANLIB)
$@
libpython$(VERSION).so
:
$(LIBRARY_OBJS)
libpython$(VERSION).so
:
$(LIBRARY_OBJS)
...
...
Misc/ACKS
View file @
99f660af
...
@@ -145,6 +145,7 @@ Aldo Cortesi
...
@@ -145,6 +145,7 @@ Aldo Cortesi
David Costanzo
David Costanzo
Scott Cotton
Scott Cotton
Greg Couch
Greg Couch
David Cournapeau
Steve Cousins
Steve Cousins
Alex Coventry
Alex Coventry
Matthew Dixon Cowles
Matthew Dixon Cowles
...
...
Misc/NEWS
View file @
99f660af
...
@@ -285,6 +285,11 @@ Core and Builtins
...
@@ -285,6 +285,11 @@ Core and Builtins
Library
Library
-------
-------
- Issue #5941: Distutils build_clib command was not working anymore because
of an incomplete costumization of the archiver command. Added ARFLAGS in the
Makefile besides AR and make Distutils use it. Original patch by David
Cournapeau.
- Issue 5955: aifc's close method did not close the file it wrapped,
- Issue 5955: aifc's close method did not close the file it wrapped,
now it does. This also means getfp method now returns the real fp.
now it does. This also means getfp method now returns the real fp.
...
...
configure.in
View file @
99f660af
...
@@ -770,6 +770,13 @@ AC_PROG_RANLIB
...
@@ -770,6 +770,13 @@ AC_PROG_RANLIB
AC_SUBST(AR)
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)
AC_CHECK_PROGS(AR, ar aal, ar)
# tweak ARFLAGS only if the user didn't set it on the command line
AC_SUBST(ARFLAGS)
if test -z "$ARFLAGS"
then
ARFLAGS="rc"
fi
AC_SUBST(SVNVERSION)
AC_SUBST(SVNVERSION)
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
if test $SVNVERSION = found
if test $SVNVERSION = found
...
...
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