[Python-checkins] cpython: - Issue #18257: Fix readlink usage in python-config. Install the python

matthias.klose python-checkins at python.org
Thu Aug 1 15:33:00 CEST 2013


http://hg.python.org/cpython/rev/7b165c7ab7ef
changeset:   84947:7b165c7ab7ef
user:        doko at ubuntu.com
date:        Thu Aug 01 15:32:49 2013 +0200
summary:
  - Issue #18257: Fix readlink usage in python-config.  Install the python
  version again on Darwin.

files:
  Makefile.pre.in          |  7 +++++++
  Misc/NEWS                |  3 +++
  Misc/python-config.in    |  2 ++
  Misc/python-config.sh.in |  9 +++++++--
  4 files changed, 19 insertions(+), 2 deletions(-)


diff --git a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1201,6 +1201,13 @@
 	sed -e "s, at EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
 	# Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
 	sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
+	# On Darwin, always use the python version of the script, the shell
+	# version doesn't use the compiler customizations that are provided
+	# in python (_osx_support.py).
+	if test `uname -s` = Darwin; then \
+		cp python-config.py python-config; \
+	fi
+
 
 # Install the include files
 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -737,6 +737,9 @@
 Build
 -----
 
+- Issue #18257: Fix readlink usage in python-config.  Install the python
+  version again on Darwin.
+
 - Issue #18481: Add C coverage reporting with gcov and lcov. A new make target
   "coverage-report" creates an instrumented Python build, runs unit tests
   and creates a HTML. The report can be updated with "make coverage-lcov".
diff --git a/Misc/python-config.in b/Misc/python-config.in
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -1,6 +1,8 @@
 #!@EXENAME@
 # -*- python -*-
 
+# Keep this script in sync with python-config.sh.in
+
 import getopt
 import os
 import sys
diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
--- a/Misc/python-config.sh.in
+++ b/Misc/python-config.sh.in
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+# Keep this script in sync with python-config.in
+
 exit_with_usage ()
 {
     echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
@@ -15,7 +17,9 @@
 {
     RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
     if which readlink >/dev/null 2>&1 ; then
-        RESULT=$(readlink -f "$RESULT")
+        if readlink -f "$RESULT" >/dev/null 2>&1; then
+          RESULT=$(readlink -f "$RESULT")
+        fi
     fi
     echo $RESULT
 }
@@ -23,7 +27,8 @@
 prefix_build="@prefix@"
 prefix_real=$(installed_prefix "$0")
 
-# Use sed to fix paths from their built to locations to their installed to locations.
+# Use sed to fix paths from their built-to locations to their installed-to
+# locations.
 prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
 exec_prefix_build="@exec_prefix@"
 exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list