Skip to content

Commit 8105195

Browse files
committed
Refactor configure and Makefile to accomodate non-macOS frameworks.
1 parent 11ac6f5 commit 8105195

File tree

5 files changed

+607
-432
lines changed

5 files changed

+607
-432
lines changed

Makefile.pre.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
184184
PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
185185
PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
186186
PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
187+
PYTHONFRAMEWORKINSTALLNAMEPREFIX= @PYTHONFRAMEWORKINSTALLNAMEPREFIX@
188+
RESSRCDIR= @RESSRCDIR@
187189
# Deployment target selected during configure, to be checked
188190
# by distutils. The export statement is needed to ensure that the
189191
# deployment target is active during build.
@@ -865,7 +867,7 @@ libpython3.so: libpython$(LDVERSION).so
865867
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
866868

867869
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
868-
$(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
870+
$(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
869871

870872

871873
libpython$(VERSION).sl: $(LIBRARY_OBJS)
@@ -890,14 +892,13 @@ $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
890892
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
891893
# minimal framework (not including the Lib directory and such) in the current
892894
# directory.
893-
RESSRCDIR=Mac/Resources/framework
894895
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
895896
$(LIBRARY) \
896897
$(RESSRCDIR)/Info.plist
897898
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
898899
$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
899-
-all_load $(LIBRARY) -Wl,-single_module \
900-
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
900+
-all_load $(LIBRARY) \
901+
-install_name $(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
901902
-compatibility_version $(VERSION) \
902903
-current_version $(VERSION) \
903904
-framework CoreFoundation $(LIBS);
@@ -1983,7 +1984,7 @@ multissltest: all
19831984
# which can lead to two parallel `./python setup.py build` processes that
19841985
# step on each others toes.
19851986
.PHONY: install
1986-
install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKINSTALLLAST@
1987+
install: @FRAMEWORKINSTALLFIRST@ @INSTALLTARGETS@ @FRAMEWORKINSTALLLAST@
19871988
if test "x$(ENSUREPIP)" != "xno" ; then \
19881989
case $(ENSUREPIP) in \
19891990
upgrade) ensurepip="--upgrade" ;; \
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configure and Makefile were refactored to accomodate framework builds on
2+
Apple platforms other than macOS.

0 commit comments

Comments
 (0)