Skip to content

Commit

Permalink
Correct the install name for non-framework macOS libPython builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Feb 21, 2024
1 parent 1235e84 commit 662c204
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
PYTHONFRAMEWORKINSTALLNAMEPREFIX= @PYTHONFRAMEWORKINSTALLNAMEPREFIX@
DYLIBINSTALLNAMEPREFIX= @DYLIBINSTALLNAMEPREFIX@
RESSRCDIR= @RESSRCDIR@
# Deployment target selected during configure, to be checked
# by distutils. The export statement is needed to ensure that the
Expand Down Expand Up @@ -869,7 +869,7 @@ libpython3.so: libpython$(LDVERSION).so
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^

libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
$(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); \
$(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(DYLIBINSTALLNAMEPREFIX)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \


libpython$(VERSION).sl: $(LIBRARY_OBJS)
Expand Down Expand Up @@ -900,7 +900,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
-all_load $(LIBRARY) \
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
-install_name $(DESTDIR)$(DYLIBINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
-compatibility_version $(VERSION) \
-current_version $(VERSION) \
-framework CoreFoundation $(LIBS);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The install name for libPython is now correctly set for non-framework macOS
builds.
8 changes: 4 additions & 4 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ AC_ARG_ENABLE([framework],
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
DYLIBINSTALLNAMEPREFIX=${prefix}
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
Expand Down Expand Up @@ -564,7 +564,7 @@ AC_ARG_ENABLE([framework],
esac
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
PYTHONFRAMEWORKINSTALLNAMEPREFIX=${prefix}
DYLIBINSTALLNAMEPREFIX=${prefix}
RESSRCDIR=Mac/Resources/framework
# Add files for Mac specific code to the list of output
Expand All @@ -584,7 +584,7 @@ AC_ARG_ENABLE([framework],
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
DYLIBINSTALLNAMEPREFIX=${prefix}
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
Expand All @@ -605,7 +605,7 @@ AC_SUBST([PYTHONFRAMEWORKIDENTIFIER])
AC_SUBST([PYTHONFRAMEWORKDIR])
AC_SUBST([PYTHONFRAMEWORKPREFIX])
AC_SUBST([PYTHONFRAMEWORKINSTALLDIR])
AC_SUBST([PYTHONFRAMEWORKINSTALLNAMEPREFIX])
AC_SUBST([DYLIBINSTALLNAMEPREFIX])
AC_SUBST([RESSRCDIR])
AC_SUBST([FRAMEWORKINSTALLFIRST])
AC_SUBST([FRAMEWORKINSTALLLAST])
Expand Down

0 comments on commit 662c204

Please sign in to comment.