--- py/config/Make.rules.orig 2009-01-31 01:09:46.000000000 +0100 +++ py/config/Make.rules 2009-02-02 08:40:09.000000000 +0100 @@ -39,45 +39,20 @@ # # -# If you've built Python yourself then set PYTHON_HOME to contain -# the installation directory; the rest of the Python-related settings -# should be correct. -# -# If you've installed a distribution, or Python was included with -# your system, then you likely need to review the values of -# PYTHON_INCLUDE_DIR and PYTHON_LIB_DIR. -# - -ifneq ($(PYTHON_HOME),) - PYTHON_VERSION = $(notdir $(wildcard $(PYTHON_HOME)/include/python2*)) - - PYTHON_INCLUDE_DIR = $(PYTHON_HOME)/include/$(PYTHON_VERSION) - # - # The Python shared library is installed in $(PYTHON_HOME)/lib on HP-UX - # rather than $(PYTHON_HOME)/lib/$(PYTHON_VERSION)/config. - # - PYTHON_LIB_DIR = $(PYTHON_HOME)/lib -else - # - # If multiple versions of Python are installed and you want a specific - # version used for building the Ice extension, then set PYTHON_VERSION - # to "python2.3" or "python2.4". - # - PYTHON_VERSION ?= $(word 1,$(notdir $(wildcard /usr/include/python2.[345]*))) - ifeq ($(PYTHON_VERSION),) - python_darwin_home = /System/Library/Frameworks/Python.framework/Versions/Current - PYTHON_VERSION = $(word 1,$(notdir $(wildcard $(python_darwin_home)/include/python2.[345]*))) - endif - PYTHON_INCLUDE_DIR = /usr/include/$(PYTHON_VERSION) - PYTHON_LIB_DIR = /usr/lib/$(PYTHON_VERSION)/config -endif +# If multiple versions of Python are installed and you want a specific +# version used for building the Ice extension, then set PYTHON_VERSION +# to "python2.5" or "python2.6". +# +PYTHON_VERSION ?= python$(shell python -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_version())") +$(info $(PYTHON_VERSION)) + +PYTHON_INCLUDE_DIR = $(shell $(PYTHON_VERSION) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_inc())") + + +PYTHON_LIB_DIR = $(shell $(PYTHON_VERSION) -c "import os; import sys; import distutils.sysconfig as ds; sys.stdout.write(os.path.join(ds.get_python_lib(plat_specific=1,standard_lib=1), 'config'))") ifeq ($(PYTHON_VERSION),) - ifneq ($(PYTHON_HOME),) - $(error Unable to find a Python interpreter at PYTHON_HOME=$(PYTHON_HOME). See config/Make.rules) - else - $(error Unable to find Python 2.3, 2.4, or 2.5. See config/Make.rules) - endif + $(error Unable to find Python. See config/Make.rules) endif PYTHON_FLAGS ?= -I$(PYTHON_INCLUDE_DIR)