Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(31925)

Side by Side Diff: Lib/distutils/sysconfig.py

Issue 16754: Incorrect shared library extension on linux
Patch Set: Created 6 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/distutils/command/build_ext.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Provide access to Python's configuration information. The specific 1 """Provide access to Python's configuration information. The specific
2 configuration variables available depend heavily on the platform and 2 configuration variables available depend heavily on the platform and
3 configuration. The values may be retrieved using 3 configuration. The values may be retrieved using
4 get_config_var(name), and the list of variables is available via 4 get_config_var(name), and the list of variables is available via
5 get_config_vars().keys(). Additional convenience functions are also 5 get_config_vars().keys(). Additional convenience functions are also
6 available. 6 available.
7 7
8 Written by: Fred L. Drake, Jr. 8 Written by: Fred L. Drake, Jr.
9 Email: <fdrake@acm.org> 9 Email: <fdrake@acm.org>
10 """ 10 """
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 # the user system may vary significantly from the system 177 # the user system may vary significantly from the system
178 # that Python itself was built on. Also the user OS 178 # that Python itself was built on. Also the user OS
179 # version and build tools may not support the same set 179 # version and build tools may not support the same set
180 # of CPU architectures for universal builds. 180 # of CPU architectures for universal builds.
181 global _config_vars 181 global _config_vars
182 if not _config_vars.get('CUSTOMIZED_OSX_COMPILER', ''): 182 if not _config_vars.get('CUSTOMIZED_OSX_COMPILER', ''):
183 import _osx_support 183 import _osx_support
184 _osx_support.customize_compiler(_config_vars) 184 _osx_support.customize_compiler(_config_vars)
185 _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' 185 _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
186 186
187 (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ 187 (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
188 get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', 188 get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
189 'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS') 189 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLA GS')
190 190
191 newcc = None 191 newcc = None
192 if 'CC' in os.environ: 192 if 'CC' in os.environ:
193 cc = os.environ['CC'] 193 cc = os.environ['CC']
194 if 'CXX' in os.environ: 194 if 'CXX' in os.environ:
195 cxx = os.environ['CXX'] 195 cxx = os.environ['CXX']
196 if 'LDSHARED' in os.environ: 196 if 'LDSHARED' in os.environ:
197 ldshared = os.environ['LDSHARED'] 197 ldshared = os.environ['LDSHARED']
198 if 'CPP' in os.environ: 198 if 'CPP' in os.environ:
199 cpp = os.environ['CPP'] 199 cpp = os.environ['CPP']
(...skipping 18 matching lines...) Expand all
218 cc_cmd = cc + ' ' + cflags 218 cc_cmd = cc + ' ' + cflags
219 compiler.set_executables( 219 compiler.set_executables(
220 preprocessor=cpp, 220 preprocessor=cpp,
221 compiler=cc_cmd, 221 compiler=cc_cmd,
222 compiler_so=cc_cmd + ' ' + ccshared, 222 compiler_so=cc_cmd + ' ' + ccshared,
223 compiler_cxx=cxx, 223 compiler_cxx=cxx,
224 linker_so=ldshared, 224 linker_so=ldshared,
225 linker_exe=cc, 225 linker_exe=cc,
226 archiver=archiver) 226 archiver=archiver)
227 227
228 compiler.shared_lib_extension = so_ext 228 compiler.shared_lib_extension = shlib_suffix
229 229
230 230
231 def get_config_h_filename(): 231 def get_config_h_filename():
232 """Return full pathname of installed pyconfig.h file.""" 232 """Return full pathname of installed pyconfig.h file."""
233 if python_build: 233 if python_build:
234 if os.name == "nt": 234 if os.name == "nt":
235 inc_dir = os.path.join(_sys_home or project_base, "PC") 235 inc_dir = os.path.join(_sys_home or project_base, "PC")
236 else: 236 else:
237 inc_dir = _sys_home or project_base 237 inc_dir = _sys_home or project_base
238 else: 238 else:
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 return vals 556 return vals
557 else: 557 else:
558 return _config_vars 558 return _config_vars
559 559
560 def get_config_var(name): 560 def get_config_var(name):
561 """Return the value of a single variable using the dictionary 561 """Return the value of a single variable using the dictionary
562 returned by 'get_config_vars()'. Equivalent to 562 returned by 'get_config_vars()'. Equivalent to
563 get_config_vars().get(name) 563 get_config_vars().get(name)
564 """ 564 """
565 return get_config_vars().get(name) 565 return get_config_vars().get(name)
OLDNEW
« no previous file with comments | « Lib/distutils/command/build_ext.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+