Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c217b36

Browse files
committed
Win32 patch for Makefile.shlib
Claudio Natoli
1 parent 9be15f4 commit c217b36

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/Makefile.shlib

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.73 2003/11/29 19:51:39 pgsql Exp $
9+
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.74 2003/12/01 22:23:06 momjian Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -201,6 +201,10 @@ ifeq ($(PORTNAME), cygwin)
201201
shlib := $(NAME)$(DLSUFFIX)
202202
endif
203203

204+
ifeq ($(PORTNAME), win32)
205+
shlib := lib$(NAME)$(DLSUFFIX)
206+
endif
207+
204208
ifeq ($(PORTNAME), beos)
205209
shlib := lib$(NAME)$(DLSUFFIX)
206210
LINK.shared = $(LD) -nostart
@@ -229,6 +233,7 @@ all-static-lib: lib$(NAME).a
229233
all-shared-lib: $(shlib)
230234

231235
ifneq ($(PORTNAME), cygwin)
236+
ifneq ($(PORTNAME), win32)
232237

233238
ifndef LORDER
234239
MK_NO_LORDER := true
@@ -242,12 +247,14 @@ else
242247
endif
243248
$(RANLIB) $@
244249

250+
endif # not win32
245251
endif # not cygwin
246252

247253
ifeq ($(enable_shared), yes)
248254

249255
ifneq ($(PORTNAME), beos)
250256
ifneq ($(PORTNAME), cygwin)
257+
ifneq ($(PORTNAME), win32)
251258
ifneq ($(PORTNAME), aix)
252259

253260
# Normal case
@@ -273,6 +280,16 @@ $(shlib): lib$(NAME).a
273280

274281
endif # PORTNAME == aix
275282

283+
else # PORTNAME == win32
284+
285+
# win32 case
286+
$(shlib) lib$(NAME).a: $(OBJS)
287+
$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
288+
$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
289+
$(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
290+
291+
endif # PORTNAME == win32
292+
276293
else # PORTNAME == cygwin
277294

278295
# Cygwin case
@@ -316,6 +333,7 @@ ifeq ($(enable_shared), yes)
316333
install-lib-shared: $(shlib)
317334
$(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
318335
ifneq ($(PORTNAME), cygwin)
336+
ifneq ($(PORTNAME), win32)
319337
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
320338
cd $(DESTDIR)$(libdir) && \
321339
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
@@ -327,6 +345,7 @@ ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
327345
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
328346
endif
329347

348+
endif # not win32
330349
endif # not cygwin
331350
endif # enable_shared
332351

@@ -361,3 +380,7 @@ endif
361380
ifeq ($(PORTNAME), cygwin)
362381
rm -f $(NAME).dll $(NAME).def
363382
endif
383+
384+
ifeq ($(PORTNAME), win32)
385+
rm -f $(NAME).dll $(NAME).def
386+
endif

0 commit comments

Comments
 (0)