[Python-checkins] CVS: python/dist/src/Lib/distutils sysconfig.py,1.30,1.31

A.M. Kuchling akuchling@users.sourceforge.net
Wed, 17 Jan 2001 07:16:55 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv11220

Modified Files:
	sysconfig.py 
Log Message:
Patch #103279: sysconfig.py always looks for versions of files in
sys.prefix + 'config/Makefile'. When building Python for the first
time, these files aren't there, so the files from the build tree have
to be used instead; this file adds an entry point for specifying that
the build tree files should be used.  (Perhaps 'set_python_build' should
should be preceded with an underscore?)


Index: sysconfig.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** sysconfig.py	2001/01/16 16:33:28	1.30
--- sysconfig.py	2001/01/17 15:16:52	1.31
***************
*** 20,24 ****
--- 20,37 ----
  EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
  
+ # Boolean; if it's true, we're still building Python, so
+ # we use different (hard-wired) directories.
  
+ python_build = 0
+ 
+ def set_python_build():
+     """Set the python_build flag to true; this means that we're
+     building Python itself.  Only called from the setup.py script
+     shipped with Python.
+     """
+     
+     global python_build
+     python_build = 1
+ 
  def get_python_inc(plat_specific=0, prefix=None):
      """Return the directory containing installed Python header files.
***************
*** 35,38 ****
--- 48,53 ----
          prefix = (plat_specific and EXEC_PREFIX or PREFIX)
      if os.name == "posix":
+         if python_build:
+             return "Include/"
          return os.path.join(prefix, "include", "python" + sys.version[:3])
      elif os.name == "nt":
***************
*** 120,124 ****
  def get_config_h_filename():
      """Return full pathname of installed config.h file."""
!     inc_dir = get_python_inc(plat_specific=1)
      return os.path.join(inc_dir, "config.h")
  
--- 135,140 ----
  def get_config_h_filename():
      """Return full pathname of installed config.h file."""
!     if python_build: inc_dir = '.'
!     else:            inc_dir = get_python_inc(plat_specific=1)
      return os.path.join(inc_dir, "config.h")
  
***************
*** 126,129 ****
--- 142,147 ----
  def get_makefile_filename():
      """Return full pathname of installed Makefile from the Python build."""
+     if python_build:
+         return './Modules/Makefile'
      lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
      return os.path.join(lib_dir, "config", "Makefile")