Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8f944f

Browse files
committed
Issue #19649: On OS X, the same set of file names are now installed
in bin directories for all configurations: non-framework vs framework, and single arch vs universal builds. pythonx.y-32 is now always installed for 64-bit/32-bit universal builds. The obsolete and undocumented pythonw* symlinks are no longer installed anywhere.
1 parent c06d6fd commit b8f944f

5 files changed

Lines changed: 116 additions & 41 deletions

File tree

Mac/Makefile.in

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# commandline in that case.
44

55
VERSION=@VERSION@
6+
ABIFLAGS=@ABIFLAGS@
7+
LDVERSION=@LDVERSION@
68
builddir = ..
79
srcdir=@srcdir@
810
prefix=@prefix@
11+
exec_prefix=@exec_prefix@
912
LIBDEST=$(prefix)/lib/python$(VERSION)
1013
RUNSHARED=@RUNSHARED@
1114
BUILDEXE=@BUILDEXEEXT@
@@ -23,7 +26,7 @@ export MACOSX_DEPLOYMENT_TARGET
2326

2427

2528
# These are normally glimpsed from the previous set
26-
bindir=$(prefix)/bin
29+
BINDIR= @bindir@
2730
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
2831
APPINSTALLDIR=$(prefix)/Resources/Python.app
2932

@@ -46,19 +49,7 @@ APPTEMPLATE=$(srcdir)/Resources/app
4649
APPSUBDIRS=MacOS Resources
4750
compileall=$(srcdir)/../Lib/compileall.py
4851

49-
installapps: install_Python install_pythonw install_PythonLauncher install_IDLE
50-
51-
install_pythonw: pythonw
52-
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
53-
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
54-
ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python3"
55-
ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw3"
56-
ifneq ($(LIPO_32BIT_FLAGS),)
57-
lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw
58-
lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw
59-
ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3-32"
60-
ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3-32"
61-
endif
52+
installapps: install_Python install_PythonLauncher install_IDLE
6253

6354
#
6455
# Install unix tools in /usr/local/bin. These are just aliases for the
@@ -68,21 +59,39 @@ installunixtools:
6859
if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
6960
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
7061
fi
71-
for fn in python3 pythonw3 idle3 pydoc3 python3-config \
72-
python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
73-
pydoc$(VERSION) python$(VERSION)-config 2to3 \
74-
2to3-$(VERSION) pyvenv pyvenv-$(VERSION) ;\
75-
do \
76-
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
77-
done
78-
ifneq ($(LIPO_32BIT_FLAGS),)
79-
for fn in python3-32 pythonw3-32 \
80-
python$(VERSION)-32 pythonw$(VERSION)-32 ;\
62+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
63+
for fn in \
64+
2to3 \
65+
idle3 \
66+
pydoc3 \
67+
python3 \
68+
python3-config \
69+
pyvenv \
70+
; \
8171
do \
82-
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
72+
rm -f $${fn} ; \
73+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
8374
done
84-
endif
85-
75+
-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
76+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
77+
for fn in \
78+
python$(VERSION)-config \
79+
; \
80+
do \
81+
rm -f $${fn} ;\
82+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
83+
done ;\
84+
fi
85+
-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
86+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
87+
for fn in \
88+
python3-32 \
89+
; \
90+
do \
91+
rm -f $${fn} ;\
92+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
93+
done ;\
94+
fi
8695

8796
#
8897
# Like installunixtools, but only install links to the versioned binaries.
@@ -91,20 +100,44 @@ altinstallunixtools:
91100
if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
92101
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
93102
fi
94-
for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
95-
pydoc$(VERSION) python$(VERSION)-config 2to3-$(VERSION) pyvenv-$(VERSION) ;\
96-
do \
97-
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
98-
done
99-
ifneq ($(LIPO_32BIT_FLAGS),)
100-
for fn in python$(VERSION)-32 pythonw$(VERSION)-32 ;\
103+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
104+
for fn in \
105+
2to3-$(VERSION) \
106+
idle$(VERSION) \
107+
pydoc$(VERSION) \
108+
python$(VERSION) \
109+
python$(LDVERSION)-config \
110+
pyvenv-$(VERSION) \
111+
; \
101112
do \
102-
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
113+
rm -f $${fn} ;\
114+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
103115
done
104-
endif
116+
-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
117+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
118+
for fn in \
119+
python$(LDVERSION) \
120+
; \
121+
do \
122+
rm -f $${fn} ;\
123+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
124+
done ;\
125+
fi
126+
-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
127+
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
128+
for fn in \
129+
python$(VERSION)-32 \
130+
; \
131+
do \
132+
rm -f $${fn} ;\
133+
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
134+
done ;\
135+
fi
105136

106137
pythonw: $(srcdir)/Tools/pythonw.c Makefile
107-
$(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
138+
$(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ \
139+
$(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include \
140+
../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
108141

109142
install_PythonLauncher:
110143
cd PythonLauncher && make install DESTDIR=$(DESTDIR)

Makefile.pre.in

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
148148
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
149149
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
150150

151+
# Option to install to strip binaries
152+
STRIPFLAG=-s
153+
154+
# Flags to lipo to produce a 32-bit-only universal executable
155+
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
156+
151157
# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
152158
OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
153159

@@ -955,7 +961,7 @@ quicktest: all platform
955961
$(TESTRUNNER) $(QUICKTESTOPTS)
956962

957963

958-
install: altinstall bininstall maninstall
964+
install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
959965

960966
altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
961967
sharedinstall oldsharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@
@@ -983,7 +989,7 @@ $(DESTSHARED):
983989

984990
# Install the interpreter with $(VERSION) affixed
985991
# This goes into $(exec_prefix)
986-
altbininstall: $(BUILDPYTHON)
992+
altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
987993
@for i in $(BINDIR) $(LIBDIR); \
988994
do \
989995
if test ! -d $(DESTDIR)$$i; then \
@@ -992,7 +998,11 @@ altbininstall: $(BUILDPYTHON)
992998
else true; \
993999
fi; \
9941000
done
995-
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE)
1001+
if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
1002+
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
1003+
else \
1004+
$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
1005+
fi
9961006
-if test "$(VERSION)" != "$(LDVERSION)"; then \
9971007
if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
9981008
then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
@@ -1013,6 +1023,12 @@ altbininstall: $(BUILDPYTHON)
10131023
fi; \
10141024
else true; \
10151025
fi
1026+
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
1027+
rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \
1028+
lipo $(LIPO_32BIT_FLAGS) \
1029+
-output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
1030+
$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
1031+
fi
10161032

10171033
bininstall: altbininstall
10181034
-if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
@@ -1038,6 +1054,10 @@ bininstall: altbininstall
10381054
(cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
10391055
-rm -f $(DESTDIR)$(BINDIR)/pyvenv
10401056
(cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv)
1057+
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
1058+
rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
1059+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
1060+
fi
10411061

10421062
# Install the versioned manual page
10431063
altmaninstall:
@@ -1364,7 +1384,14 @@ frameworkinstallmaclib:
13641384
frameworkinstallapps:
13651385
cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
13661386

1367-
# This install the unix python and pythonw tools in /usr/local/bin
1387+
# Build the bootstrap executable that will spawn the interpreter inside
1388+
# an app bundle within the framework. This allows the interpreter to
1389+
# run OS X GUI APIs.
1390+
frameworkpythonw:
1391+
cd Mac && $(MAKE) pythonw
1392+
1393+
# This installs the python* and other bin symlinks in $prefix/bin or in
1394+
# a bin directory relative to the framework root
13681395
frameworkinstallunixtools:
13691396
cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
13701397

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ Build
357357
- Issue #19373: Apply upstream change to Tk 8.5.15 fixing OS X 10.9
358358
screen refresh problem for OS X installer build.
359359

360+
- Issue #19649: On OS X, the same set of file names are now installed
361+
in bin directories for all configurations: non-framework vs framework,
362+
and single arch vs universal builds. pythonx.y-32 is now always
363+
installed for 64-bit/32-bit universal builds. The obsolete and
364+
undocumented pythonw* symlinks are no longer installed anywhere.
365+
360366
Tools/Demos
361367
-----------
362368

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ _PYTHON_HOST_PLATFORM
712712
MACHDEP
713713
FRAMEWORKINSTALLAPPSPREFIX
714714
FRAMEWORKUNIXTOOLSPREFIX
715+
FRAMEWORKPYTHONW
715716
FRAMEWORKALTINSTALLLAST
716717
FRAMEWORKALTINSTALLFIRST
717718
FRAMEWORKINSTALLLAST
@@ -3152,6 +3153,7 @@ if test "${enable_framework+set}" = set; then :
31523153
FRAMEWORKINSTALLLAST=
31533154
FRAMEWORKALTINSTALLFIRST=
31543155
FRAMEWORKALTINSTALLLAST=
3156+
FRAMEWORKPYTHONW=
31553157
if test "x${prefix}" = "xNONE"; then
31563158
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
31573159
else
@@ -3166,6 +3168,7 @@ if test "${enable_framework+set}" = set; then :
31663168
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
31673169
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
31683170
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
3171+
FRAMEWORKPYTHONW="frameworkpythonw"
31693172
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
31703173

31713174
if test "x${prefix}" = "xNONE" ; then
@@ -3233,6 +3236,7 @@ else
32333236
FRAMEWORKINSTALLLAST=
32343237
FRAMEWORKALTINSTALLFIRST=
32353238
FRAMEWORKALTINSTALLLAST=
3239+
FRAMEWORKPYTHONW=
32363240
if test "x${prefix}" = "xNONE" ; then
32373241
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
32383242
else
@@ -3255,6 +3259,7 @@ fi
32553259

32563260

32573261

3262+
32583263
##AC_ARG_WITH(dyld,
32593264
## AS_HELP_STRING([--with-dyld],
32603265
## [Use (OpenStep|Rhapsody) dynamic linker]))

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ AC_ARG_ENABLE(framework,
250250
FRAMEWORKINSTALLLAST=
251251
FRAMEWORKALTINSTALLFIRST=
252252
FRAMEWORKALTINSTALLLAST=
253+
FRAMEWORKPYTHONW=
253254
if test "x${prefix}" = "xNONE"; then
254255
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
255256
else
@@ -264,6 +265,7 @@ AC_ARG_ENABLE(framework,
264265
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
265266
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
266267
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
268+
FRAMEWORKPYTHONW="frameworkpythonw"
267269
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
268270
269271
if test "x${prefix}" = "xNONE" ; then
@@ -325,6 +327,7 @@ AC_ARG_ENABLE(framework,
325327
FRAMEWORKINSTALLLAST=
326328
FRAMEWORKALTINSTALLFIRST=
327329
FRAMEWORKALTINSTALLLAST=
330+
FRAMEWORKPYTHONW=
328331
if test "x${prefix}" = "xNONE" ; then
329332
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
330333
else
@@ -342,6 +345,7 @@ AC_SUBST(FRAMEWORKINSTALLFIRST)
342345
AC_SUBST(FRAMEWORKINSTALLLAST)
343346
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
344347
AC_SUBST(FRAMEWORKALTINSTALLLAST)
348+
AC_SUBST(FRAMEWORKPYTHONW)
345349
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
346350
AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
347351

0 commit comments

Comments
 (0)