mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
get_config_h_filename(): Support NT as well as Posix systems.
_init_nt(): Use get_config_h_filename() instead of figuring out the
name directly.
g['SO'] should be set to '.pyd'.
Adjust some minor coding nits.
This commit is contained in:
parent
1b9c6f7788
commit
69e2c6efbb
1 changed files with 14 additions and 10 deletions
|
|
@ -19,6 +19,9 @@ exec_prefix = os.path.normpath (sys.exec_prefix)
|
||||||
|
|
||||||
def get_config_h_filename():
|
def get_config_h_filename():
|
||||||
"""Return full pathname of installed config.h file."""
|
"""Return full pathname of installed config.h file."""
|
||||||
|
if os.name == "nt":
|
||||||
|
return os.path.join(exec_prefix, "include", "config.h")
|
||||||
|
else:
|
||||||
return os.path.join(exec_prefix,
|
return os.path.join(exec_prefix,
|
||||||
"include", "python" + sys.version[:3],
|
"include", "python" + sys.version[:3],
|
||||||
"config.h")
|
"config.h")
|
||||||
|
|
@ -136,20 +139,20 @@ def _init_posix():
|
||||||
|
|
||||||
def _init_nt():
|
def _init_nt():
|
||||||
"""Initialize the module as appropriate for NT"""
|
"""Initialize the module as appropriate for NT"""
|
||||||
g=globals()
|
g = globals()
|
||||||
# load config.h, though I don't know how useful this is
|
# load config.h, though I don't know how useful this is
|
||||||
parse_config_h(open(
|
parse_config_h(open(get_config_h_filename()), g)
|
||||||
os.path.join(exec_prefix, "include", "config.h")), g)
|
|
||||||
# set basic install directories
|
# set basic install directories
|
||||||
g['LIBDEST']=os.path.join(exec_prefix, "Lib")
|
g['LIBDEST'] = os.path.join(exec_prefix, "Lib")
|
||||||
g['BINLIBDEST']= os.path.join(exec_prefix, "Lib")
|
g['BINLIBDEST'] = os.path.join(exec_prefix, "Lib")
|
||||||
|
|
||||||
# XXX hmmm.. a normal install puts include files here
|
# XXX hmmm.. a normal install puts include files here
|
||||||
g['INCLUDEPY'] = os.path.join (prefix, 'include' )
|
g['INCLUDEPY'] = os.path.join(prefix, 'include')
|
||||||
|
|
||||||
g['SO'] = '.dll'
|
g['SO'] = '.pyd'
|
||||||
g['exec_prefix'] = exec_prefix
|
g['exec_prefix'] = exec_prefix
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exec "_init_" + os.name
|
exec "_init_" + os.name
|
||||||
except NameError:
|
except NameError:
|
||||||
|
|
@ -158,5 +161,6 @@ except NameError:
|
||||||
else:
|
else:
|
||||||
exec "_init_%s()" % os.name
|
exec "_init_%s()" % os.name
|
||||||
|
|
||||||
|
|
||||||
del _init_posix
|
del _init_posix
|
||||||
del _init_nt
|
del _init_nt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue