Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,7 @@ else ifneq (,$(findstring darwin,$(host_os)))
LINK_SHLIB_FLAGS += -compatibility_version $(LIBGAP_COMPAT_VER)
LINK_SHLIB_FLAGS += -current_version $(LIBGAP_CURRENT_VER)
LINK_SHLIB_FLAGS += -Wl,-single_module

# TODO: set install_name, at least for installed version of the lib?
#LINK_SHLIB_FLAGS += -install_name $(libdir)/$(LIBGAP_FULL)
LINK_SHLIB_FLAGS += -headerpad_max_install_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you forgotten -Wl, in front of -headerpad_max_install_names ? Because we have now sagemath/sage#40106 ...


GAP_CPPFLAGS += -DPIC
GAP_CFLAGS += -fno-common
Expand All @@ -467,6 +465,12 @@ else
GAP_LDFLAGS += -Wl,--export-dynamic
endif

ifneq (,$(findstring darwin,$(host_os)))
INSTALL_NAME_TOOL = @install_name_tool
else
INSTALL_NAME_TOOL = @echo > /dev/null
endif

libgap: libgap$(SHLIB_EXT) $(LIBGAP_FULL)
.PHONY: libgap

Expand Down Expand Up @@ -516,6 +520,7 @@ build/main.c: src/main.c
# build rule for the gap executable used by the `install-bin` target
build/gap-install: libgap$(SHLIB_EXT) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS build/obj/build/main.c.o
$(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) build/obj/build/main.c.o $(GAP_LIBS) -L${abs_builddir} -lgap -o $@
$(INSTALL_NAME_TOOL) -change $(LIBGAP_FULL) $(libdir)/$(LIBGAP_FULL) $@

endif

Expand Down Expand Up @@ -687,6 +692,7 @@ install-libgap: $(LIBGAP_FULL) libgap.pc
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
$(INSTALL) -m 0644 $(LIBGAP_FULL) $(DESTDIR)$(libdir)
ln -sf $(LIBGAP_FULL) $(DESTDIR)$(libdir)/libgap$(SHLIB_EXT)
$(INSTALL_NAME_TOOL) -id $(libdir)/$(LIBGAP_FULL) $(DESTDIR)$(libdir)/$(LIBGAP_FULL)
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 0644 libgap.pc $(DESTDIR)$(libdir)/pkgconfig

Expand Down