summaryrefslogtreecommitdiff
path: root/databases/postgresql93/patches/patch-src_Makefile.shlib
blob: a7b5982acb1b0ad47013e86e040db16079882ed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
$NetBSD: patch-src_Makefile.shlib,v 1.2 2013/10/04 18:23:40 joerg Exp $

--- src/Makefile.shlib.orig	2013-09-02 20:53:17.000000000 +0000
+++ src/Makefile.shlib
@@ -156,17 +156,11 @@ endif
 
 ifeq ($(PORTNAME), freebsd)
   ifdef ELF_SYSTEM
-    ifdef SO_MAJOR_VERSION
-      shlib		= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
-    endif
     LINK.shared		= $(COMPILER) -shared
     ifdef soname
       LINK.shared	+= -Wl,-x,-soname,$(soname)
     endif
   else
-    ifdef SO_MAJOR_VERSION
-      shlib		= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
-    endif
     LINK.shared		= $(LD) -x -Bshareable -Bforcearchive
   endif
 endif
@@ -182,6 +176,17 @@ ifeq ($(PORTNAME), netbsd)
   endif
 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
+
 ifeq ($(PORTNAME), hpux)
   ifdef SO_MAJOR_VERSION
     shlib			= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
@@ -281,8 +286,9 @@ ifeq ($(PORTNAME), unixware)
 endif
 
 ifeq ($(PORTNAME), cygwin)
+  LINK.shared		= $(CC) -shared
   ifdef SO_MAJOR_VERSION
-    shlib		= cyg$(NAME)$(DLSUFFIX)
+    shlib		= cyg$(NAME)-$(SO_MAJOR_VERSION)$(DLSUFFIX)
   endif
   haslibarule   = yes
 endif
@@ -371,6 +377,12 @@ else # PORTNAME == cygwin || PORTNAME ==
 
 # 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) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+	$(CC) $(CFLAGS)  -shared -o $(shlib)  -Wl,--out-implib=$(stlib) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
+
+
+else
 ifeq (,$(SHLIB_EXPORTS))
 DLL_DEFFILE = lib$(NAME)dll.def
 exports_file = $(DLL_DEFFILE)
@@ -387,6 +399,7 @@ $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHL
 $(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
 	$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
 
+endif # PORTNAME == cygwin 
 endif # PORTNAME == cygwin || PORTNAME == win32
 
 
@@ -467,8 +480,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)' && \
@@ -481,7 +496,7 @@ ifneq ($(shlib), $(shlib_bare))
 	$(LN_S) $(shlib) $(shlib_bare)
 endif
 endif # not win32
-endif # not cygwin
+endif # cygwin
 endif # not aix
 else # no soname
 	$(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)'