]> granicus.if.org Git - python/commitdiff
- Issue #18257: Fix readlink usage in python-config. Install the python
authordoko@ubuntu.com <doko@ubuntu.com>
Thu, 1 Aug 2013 13:32:49 +0000 (15:32 +0200)
committerdoko@ubuntu.com <doko@ubuntu.com>
Thu, 1 Aug 2013 13:32:49 +0000 (15:32 +0200)
  version again on Darwin.

Makefile.pre.in
Misc/NEWS
Misc/python-config.in
Misc/python-config.sh.in

index ad4eb308249ac37e8aa3a20997700d56d180453e..8103124f4fca5538c798920750387083d77f9318 100644 (file)
@@ -1201,6 +1201,13 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
        sed -e "s,@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)
index 088ad429e07de4f0283d4bf4eeafa9763f679a5c..41ba1a8318589319181af59ac02f0011a51fc65d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -737,6 +737,9 @@ IDLE
 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".
index ac3a2c763b6e94549cad86f5523b4c1cc67d0c13..0b9b5dc4413f628d88e93fc71d08ab20b29e4355 100644 (file)
@@ -1,6 +1,8 @@
 #!@EXENAME@
 # -*- python -*-
 
+# Keep this script in sync with python-config.sh.in
+
 import getopt
 import os
 import sys
index 6790bf62ff144bd6f0c649ad6eb03bd80030553e..f5a3dbebeaa22be20d4951aae5d07a3464826ef1 100644 (file)
@@ -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 @@ installed_prefix ()
 {
     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 @@ installed_prefix ()
 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#")