$NetBSD: patch-src_Makefile.shlib,v 1.1 2023/09/17 08:53:21 adam Exp $ Use correct linker flags. --- src/Makefile.shlib.orig 2023-09-11 20:25:06.000000000 +0000 +++ src/Makefile.shlib @@ -154,9 +154,6 @@ ifeq ($(PORTNAME), openbsd) endif ifeq ($(PORTNAME), freebsd) - ifdef SO_MAJOR_VERSION - shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) - endif LINK.shared = $(COMPILER) -shared ifdef soname LINK.shared += -Wl,-x,-soname,$(soname) @@ -219,6 +216,17 @@ ifeq ($(PORTNAME), win32) haslibarule = yes endif +ifeq ($(PORTNAME), dragonfly) + ifdef ELF_SYSTEM + LINK.shared = $(COMPILER) -shared + ifdef soname + LINK.shared += -Wl,-x,-soname,$(soname) + endif + else + LINK.shared = $(LD) -x -Bshareable -Bforcearchive + endif +endif + # If the shared library doesn't have an export file, mark all symbols not # explicitly exported using PGDLLEXPORT as hidden. We can't pass these flags @@ -399,8 +407,10 @@ ifdef soname # we don't install $(shlib) on AIX # (see http://archives.postgresql.org/message-id/52EF20B2E3209443BC37736D00C3C1380A6E79FE@EXADV1.host.magwien.gv.at) ifneq ($(PORTNAME), aix) +ifeq ($(PORTNAME), cygwin) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' +else $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)' -ifneq ($(PORTNAME), cygwin) ifneq ($(PORTNAME), win32) ifneq ($(shlib), $(shlib_major)) cd '$(DESTDIR)$(libdir)' && \ @@ -413,7 +423,7 @@ ifneq ($(shlib), $(shlib_bare)) $(LN_S) $(shlib) $(shlib_bare) endif endif # not win32 -endif # not cygwin +endif # cygwin endif # not aix ifneq (,$(findstring $(PORTNAME),win32 cygwin)) $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)'