Skip to content

Commit 0df35b0

Browse files
committed
- Issue #18257: Fix readlink usage in python-config. Install the python
version again on Darwin.
1 parent b2fcebb commit 0df35b0

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

Makefile.pre.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,13 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
12011201
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
12021202
# Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
12031203
sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
1204+
# On Darwin, always use the python version of the script, the shell
1205+
# version doesn't use the compiler customizations that are provided
1206+
# in python (_osx_support.py).
1207+
if test `uname -s` = Darwin; then \
1208+
cp python-config.py python-config; \
1209+
fi
1210+
12041211

12051212
# Install the include files
12061213
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,9 @@ IDLE
737737
Build
738738
-----
739739

740+
- Issue #18257: Fix readlink usage in python-config. Install the python
741+
version again on Darwin.
742+
740743
- Issue #18481: Add C coverage reporting with gcov and lcov. A new make target
741744
"coverage-report" creates an instrumented Python build, runs unit tests
742745
and creates a HTML. The report can be updated with "make coverage-lcov".

Misc/python-config.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!@EXENAME@
22
# -*- python -*-
33

4+
# Keep this script in sync with python-config.sh.in
5+
46
import getopt
57
import os
68
import sys

Misc/python-config.sh.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# Keep this script in sync with python-config.in
4+
35
exit_with_usage ()
46
{
57
echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
@@ -15,15 +17,18 @@ installed_prefix ()
1517
{
1618
RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
1719
if which readlink >/dev/null 2>&1 ; then
18-
RESULT=$(readlink -f "$RESULT")
20+
if readlink -f "$RESULT" >/dev/null 2>&1; then
21+
RESULT=$(readlink -f "$RESULT")
22+
fi
1923
fi
2024
echo $RESULT
2125
}
2226

2327
prefix_build="@prefix@"
2428
prefix_real=$(installed_prefix "$0")
2529

26-
# Use sed to fix paths from their built to locations to their installed to locations.
30+
# Use sed to fix paths from their built-to locations to their installed-to
31+
# locations.
2732
prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
2833
exec_prefix_build="@exec_prefix@"
2934
exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")

0 commit comments

Comments
 (0)