Commit 8753b23c authored by Tom Lane's avatar Tom Lane

Fix 'SO__MINOR_VERSION' typo for irix5; add AIX shlib support

from Andreas Z.; minor cosmetic cleanups.
parent 36ce6d43
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.13 1999/07/15 02:03:00 tgl Exp $ # $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.14 1999/07/16 22:56:01 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -56,25 +56,12 @@ install-shlib-dep := ...@@ -56,25 +56,12 @@ install-shlib-dep :=
# Makefile.global (or really Makefile.port) to supply DLSUFFIX and other # Makefile.global (or really Makefile.port) to supply DLSUFFIX and other
# symbols. # symbols.
ifeq ($(PORTNAME), irix5) # Try to keep the sections in some kind of order, folks...
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO__MINOR_VERSION)
LDFLAGS_SL := -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), freebsd) ifeq ($(PORTNAME), aix)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib install-shlib-dep := install-shlib
ifdef ELF_SYSTEM shlib := lib$(NAME)$(DLSUFFIX)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) SHLIB_LINK += -lc
LDFLAGS_SL := -x -shared -soname $(shlib)
else
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -x -Bshareable -Bforcearchive
endif
CFLAGS += $(CFLAGS_SL)
endif
endif endif
ifeq ($(PORTNAME), bsd) ifeq ($(PORTNAME), bsd)
...@@ -108,6 +95,20 @@ ifeq ($(PORTNAME), bsdi) ...@@ -108,6 +95,20 @@ ifeq ($(PORTNAME), bsdi)
endif endif
endif endif
ifeq ($(PORTNAME), freebsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
ifdef ELF_SYSTEM
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
LDFLAGS_SL := -x -shared -soname $(shlib)
else
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -x -Bshareable -Bforcearchive
endif
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), hpux) ifeq ($(PORTNAME), hpux)
install-shlib-dep := install-shlib install-shlib-dep := install-shlib
# HPUX doesn't believe in version numbers for shlibs # HPUX doesn't believe in version numbers for shlibs
...@@ -116,6 +117,13 @@ ifeq ($(PORTNAME), hpux) ...@@ -116,6 +117,13 @@ ifeq ($(PORTNAME), hpux)
CFLAGS += $(CFLAGS_SL) CFLAGS += $(CFLAGS_SL)
endif endif
ifeq ($(PORTNAME), irix5)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), linux) ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
...@@ -188,6 +196,7 @@ all: lib$(NAME).a $(shlib) ...@@ -188,6 +196,7 @@ all: lib$(NAME).a $(shlib)
# Rules to build regular and shared libraries # Rules to build regular and shared libraries
ifneq ($(PORTNAME), win) ifneq ($(PORTNAME), win)
lib$(NAME).a: $(OBJS) lib$(NAME).a: $(OBJS)
ifdef MK_NO_LORDER ifdef MK_NO_LORDER
$(AR) $(AROPT) $@ $(OBJS) $(AR) $(AROPT) $@ $(OBJS)
...@@ -195,11 +204,14 @@ else ...@@ -195,11 +204,14 @@ else
$(AR) $(AROPT) $@ `lorder $(OBJS) | tsort` $(AR) $(AROPT) $@ `lorder $(OBJS) | tsort`
endif endif
$(RANLIB) $@ $(RANLIB) $@
endif endif
ifneq ($(shlib),) ifneq ($(shlib),)
ifneq ($(PORTNAME), win) ifneq ($(PORTNAME), win)
ifneq ($(PORTNAME), aix)
# Normal case
$(shlib): $(OBJS) $(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK) $(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \ if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
...@@ -213,6 +225,16 @@ $(shlib): $(OBJS) ...@@ -213,6 +225,16 @@ $(shlib): $(OBJS)
else else
# AIX case
$(shlib): lib$(NAME).a
$(MKLDEXPORT) lib$(NAME).a $(LIBDIR) > lib$(NAME)$(EXPSUFF)
$(LD) -H512 -bM:SRE -bI:$(SRCDIR)/backend/$(POSTGRES_IMP) -bE:lib$(NAME)$(EXPSUFF) -o $@ $< $(LDFLAGS) $(SHLIB_LINK)
endif
else
# WIN case
$(shlib) lib$(NAME).a: $(OBJS) $(SRCDIR)/utils/dllinit.o $(shlib) lib$(NAME).a: $(OBJS) $(SRCDIR)/utils/dllinit.o
$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS) $(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(SRCDIR)/utils/dllinit.o $(DLLINIT) $(SHLIB_LINK) $(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(SRCDIR)/utils/dllinit.o $(DLLINIT) $(SHLIB_LINK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment