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

Commit 5071d31

Browse files
committed
Added support for shlib for BSD44_derived & i386_solaris.
1 parent 7bff4c5 commit 5071d31

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

src/interfaces/libpgtcl/Makefile

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.16 1997/09/27 19:35:04 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.17 1997/10/28 15:13:10 vadim Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -25,22 +25,32 @@ ifdef KRBVERS
2525
CFLAGS+= $(KRBFLAGS)
2626
endif
2727

28-
shlib :=
28+
# Shared library stuff
29+
2930
install-shlib-dep :=
31+
shlib :=
3032

3133
ifeq ($(PORTNAME), linux)
3234
ifdef LINUX_ELF
33-
ifeq ($(CC), gcc)
34-
CFLAGS += -fpic -fPIC
35-
endif
36-
shlib := libpgtcl.so.1
37-
install-shlib-dep := install-shlib
38-
LDFLAGS += -L $(SRCDIR)/interfaces/libpq -lpq
35+
install-shlib-dep := install-shlib
36+
shlib := libpgtcl.so.1
37+
CFLAGS += $(CFLAGS_SL)
38+
LDFLAGS_SL = -shared -L $(SRCDIR)/interfaces/libpq -lpq
3939
endif
4040
endif
4141

42+
ifeq ($(PORTNAME), BSD44_derived)
43+
install-shlib-dep := install-shlib
44+
shlib := libpgtcl.so.1.0
45+
LDFLAGS_SL = -x -Bshareable -Bforcearchive
46+
CFLAGS += $(CFLAGS_SL)
47+
endif
48+
4249
ifeq ($(PORTNAME), i386_solaris)
43-
CFLAGS+= -fPIC
50+
install-shlib-dep := install-shlib
51+
shlib := libpgtcl.so.1
52+
LDFLAGS_SL = -G -z text
53+
CFLAGS += $(CFLAGS_SL)
4454
endif
4555

4656
OBJS= pgtcl.o pgtclCmds.o pgtclId.o
@@ -56,10 +66,9 @@ else
5666
endif
5767
$(RANLIB) libpgtcl.a
5868

59-
libpgtcl.so.1: $(OBJS)
60-
$(CC) $(LDFLAGS) -shared $(OBJS) -o libpgtcl.so.1
61-
rm -f libpgtcl.so
62-
ln -s libpgtcl.so.1 libpgtcl.so
69+
$(shlib): $(OBJS)
70+
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS)
71+
ln -sf $@ libpgtcl.so
6372

6473
.PHONY: beforeinstall-headers install-headers
6574
.PHONY: install install-libpgtcl
@@ -75,12 +84,11 @@ beforeinstall-headers:
7584
install-libpgtcl: libpgtcl.a
7685
$(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.a $(DESTDIR)$(LIBDIR)/libpgtcl.a
7786

78-
install-shlib: libpgtcl.so.1
79-
$(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
80-
$(DESTDIR)$(LIBDIR)/libpgtcl.so.1
81-
rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
82-
ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so
87+
install-shlib: $(shlib)
88+
$(INSTALL) $(INSTL_LIB_OPTS) $(shlib) \
89+
$(DESTDIR)$(LIBDIR)/$(shlib)
90+
ln -sf $(shlib) $(DESTDIR)$(LIBDIR)/libpgtcl.so
8391

8492
.PHONY: clean
8593
clean:
86-
rm -f $(OBJS)
94+
rm -f $(OBJS) $(shlib) libpgtcl.a libpgtcl.so

0 commit comments

Comments
 (0)