summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-02-08 15:55:42 (GMT)
committerFred Drake <fdrake@acm.org>2000-02-08 15:55:42 (GMT)
commit69e2c6efbbeff44285f071d011e5e56f5fc26bad (patch)
tree220302a63468f2f8d0e0c416f08b345bd2f7ba1a /Lib/distutils/sysconfig.py
parent1b9c6f77885fc4a600f35c717591f055553e666b (diff)
downloadcpython-69e2c6efbbeff44285f071d011e5e56f5fc26bad.zip
cpython-69e2c6efbbeff44285f071d011e5e56f5fc26bad.tar.gz
cpython-69e2c6efbbeff44285f071d011e5e56f5fc26bad.tar.bz2
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.
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 0e40cbc..e291aec 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -19,9 +19,12 @@ exec_prefix = os.path.normpath (sys.exec_prefix)
def get_config_h_filename():
"""Return full pathname of installed config.h file."""
- return os.path.join(exec_prefix,
- "include", "python" + sys.version[:3],
- "config.h")
+ if os.name == "nt":
+ return os.path.join(exec_prefix, "include", "config.h")
+ else:
+ return os.path.join(exec_prefix,
+ "include", "python" + sys.version[:3],
+ "config.h")
def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build."""
@@ -136,20 +139,20 @@ def _init_posix():
def _init_nt():
"""Initialize the module as appropriate for NT"""
- g=globals()
+ g = globals()
# load config.h, though I don't know how useful this is
- parse_config_h(open(
- os.path.join(exec_prefix, "include", "config.h")), g)
+ parse_config_h(open(get_config_h_filename()), g)
# set basic install directories
- g['LIBDEST']=os.path.join(exec_prefix, "Lib")
- g['BINLIBDEST']= os.path.join(exec_prefix, "Lib")
+ g['LIBDEST'] = os.path.join(exec_prefix, "Lib")
+ g['BINLIBDEST'] = os.path.join(exec_prefix, "Lib")
# 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
+
try:
exec "_init_" + os.name
except NameError:
@@ -158,5 +161,6 @@ except NameError:
else:
exec "_init_%s()" % os.name
+
del _init_posix
del _init_nt