endif
ifeq ($(PORTNAME), cygwin)
+ LINK.shared = $(CC) -shared
ifdef SO_MAJOR_VERSION
shlib = cyg$(NAME)$(DLSUFFIX)
endif
# If SHLIB_EXPORTS is set, the rules below will build a .def file from
# that. Else we build a temporary one here.
+ifeq ($(PORTNAME), cygwin)
+$(shlib): $(OBJS) | $(SHLIB_PREREQS)
+ $(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
+
+$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ $(LINK.static) $@ $^
+ $(RANLIB) $@
+
+
+else
ifeq (,$(SHLIB_EXPORTS))
DLL_DEFFILE = lib$(NAME)dll.def
exports_file = $(DLL_DEFFILE)
$(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
+endif # PORTNAME == cygwin
endif # PORTNAME == cygwin || PORTNAME == win32
endif # enable_shared
-# src/makefiles/Makefile.cygwin
DLLTOOL= dlltool
-DLLWRAP= dllwrap
+# src/makefiles/Makefile.cygwin
ifdef PGXS
BE_DLLLIBS= -L$(libdir) -lpostgres
else
# Rule for building a shared library from a single .o file
%.dll: %.o
- $(DLLTOOL) --export-all --output-def $*.def $<
- $(DLLWRAP) -o $@ --def $*.def $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)
- rm -f $*.def
+ $(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)