Skip to content

Commit e5c22c1

Browse files
committed
Don't use deprecated dllwrap on Cygwin.
The preferred method is to use "cc -shared", and this allows binaries to be rebased if required, unlike dllwrap. Backpatch to 9.0 where we have buildfarm coverage. There are still some issues with Cygwin, especially modern Cygwin, but this helps us get closer to good support. Marco Atzeri.
1 parent dfb4a1a commit e5c22c1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/Makefile.shlib

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ ifeq ($(PORTNAME), unixware)
309309
endif
310310

311311
ifeq ($(PORTNAME), cygwin)
312+
LINK.shared = $(CC) -shared
312313
ifdef SO_MAJOR_VERSION
313314
shlib = cyg$(NAME)$(DLSUFFIX)
314315
endif
@@ -399,6 +400,16 @@ else # PORTNAME == cygwin || PORTNAME == win32
399400

400401
# If SHLIB_EXPORTS is set, the rules below will build a .def file from
401402
# that. Else we build a temporary one here.
403+
ifeq ($(PORTNAME), cygwin)
404+
$(shlib): $(OBJS) | $(SHLIB_PREREQS)
405+
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
406+
407+
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
408+
$(LINK.static) $@ $^
409+
$(RANLIB) $@
410+
411+
412+
else
402413
ifeq (,$(SHLIB_EXPORTS))
403414
DLL_DEFFILE = lib$(NAME)dll.def
404415
exports_file = $(DLL_DEFFILE)
@@ -415,6 +426,7 @@ $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
415426
$(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
416427
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
417428

429+
endif # PORTNAME == cygwin
418430
endif # PORTNAME == cygwin || PORTNAME == win32
419431

420432
endif # enable_shared

src/makefiles/Makefile.cygwin

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# src/makefiles/Makefile.cygwin
21
DLLTOOL= dlltool
3-
DLLWRAP= dllwrap
2+
# src/makefiles/Makefile.cygwin
43
ifdef PGXS
54
BE_DLLLIBS= -L$(libdir) -lpostgres
65
else
@@ -40,6 +39,4 @@ endif
4039

4140
# Rule for building a shared library from a single .o file
4241
%.dll: %.o
43-
$(DLLTOOL) --export-all --output-def $*.def $<
44-
$(DLLWRAP) -o $@ --def $*.def $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)
45-
rm -f $*.def
42+
$(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy