Commit 6d98d373 authored by Tom Lane's avatar Tom Lane

Centralized shared-library build knowledge in a new file,

src/Makefile.shlib.  Updated all the makefiles that try to build shlibs
to include that file instead of having duplicate (and mostly incomplete)
copies of shared-library options.  It works on HPUX, a lot better than it
did before in fact, but there's a chance I broke some other platforms.
At least now you only have to fix one place not six...
parent 6e13e0c6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.51 1998/10/15 15:58:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.52 1998/10/19 00:00:40 tgl Exp $
# #
# NOTES # NOTES
# Essentially all Postgres make files include this file and use the # Essentially all Postgres make files include this file and use the
...@@ -206,6 +206,13 @@ LDFLAGS= @LDFLAGS@ @LIBS@ ...@@ -206,6 +206,13 @@ LDFLAGS= @LDFLAGS@ @LIBS@
DLSUFFIX= @DLSUFFIX@ DLSUFFIX= @DLSUFFIX@
LN_S= @LN_S@ LN_S= @LN_S@
##############################################################################
#
# Additional platform-specific settings
#
PORTNAME= @PORTNAME@
include $(SRCDIR)/Makefile.port include $(SRCDIR)/Makefile.port
############################################################################## ##############################################################################
......
#-------------------------------------------------------------------------
#
# Makefile.shlib
# Common rules for building shared libraries
#
# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.1 1998/10/19 00:00:40 tgl Exp $
#
#-------------------------------------------------------------------------
# This file should be included by any Postgres module Makefile that wants
# to build a shared library (if possible for the current platform).
# A static library is also built from the same object files.
# RESTRICTION: only one library can be built per makefile...
# Before including this file, the module Makefile must define these variables:
# NAME Name of library to build (no suffix nor "lib" prefix)
# SO_MAJOR_VERSION Major version number to use for shared library
# SO_MINOR_VERSION Minor version number to use for shared library
# OBJS List of object files to include in library
# SHLIB_LINK If shared library relies on other libraries, additional
# stuff to put in its link command
# (If you want a patchlevel, include it in SO_MINOR_VERSION, eg, "6.2".)
#
# The module Makefile must also include $(SRCDIR)/Makefile.global before
# including this file (Makefile.global sets PORTNAME and other needed symbols).
#
# The first rule in this file is a rule for "all", which causes both the
# static and shared libraries to be built (as well as all the object files).
# If you have other files that need to be made before building object files
# and libraries, put another rule for "all" before you include this file.
#
# Your install rule should look like
#
# install: install-headers install-lib $(install-shlib-dep)
#
# where install-headers is only needed if you have header files to install
# (and, of course, it has to be provided by your makefile). The rules
# install-lib and install-shlib are provided by this makefile --- they
# automatically install the plain and shared libraries into $(LIBDIR).
# install-shlib-dep is a variable that expands to install-shlib if the
# shared library needs to be installed, empty if not.
#
# Got that? Look at src/interfaces/libpq/Makefile.in for an example.
# shlib and install-shlib-dep default to empty, and stay that way if we're
# on a platform where we don't know how to build a shared library.
shlib :=
install-shlib-dep :=
# For each platform we support shlibs on, set shlib and install-shlib-dep,
# and update flags as needed to build a shared lib. Note we depend on
# Makefile.global (or really Makefile.port) to supply DLSUFFIX and other
# symbols.
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsdi)
ifdef BSD_SHLIB
ifeq ($(DLSUFFIX), .so)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(DLSUFFIX), .o)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LD := shlicc
LDFLAGS_SL += -O -r
CFLAGS += $(CFLAGS_SL)
endif
endif
endif
ifeq ($(PORTNAME), hpux)
install-shlib-dep := install-shlib
# HPUX doesn't believe in version numbers for shlibs
shlib := lib$(NAME)$(DLSUFFIX)
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -shared -soname $(shlib)
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
ifeq ($(CXX), CC)
CXXFLAGS += -Xw
COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
endif
endif
ifeq ($(PORTNAME), unixware)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
ifeq ($(CXX), CC)
CXXFLAGS += -Xw
COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
endif
endif
# Default target definition. Note shlib is empty if not building a shlib.
all: lib$(NAME).a $(shlib)
# Rules to build regular and shared libraries
lib$(NAME).a: $(OBJS)
ifdef MK_NO_LORDER
$(AR) $(AROPT) $@ $(OBJS)
else
$(AR) $(AROPT) $@ `lorder $(OBJS) | tsort`
endif
$(RANLIB) $@
$(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK)
# Rules to install regular and shared libraries
.PHONY: all install-lib install-shlib
install-lib: lib$(NAME).a
$(INSTALL) $(INSTL_LIB_OPTS) lib$(NAME).a $(LIBDIR)/lib$(NAME).a
install-shlib: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for ecpg library
#
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.38 1998/10/19 00:00:40 tgl Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg NAME= ecpg
SO_MAJOR_VERSION= 2 SO_MAJOR_VERSION= 2
SO_MINOR_VERSION= 6 SO_MINOR_VERSION= 6.2
SO_PATCHLEVEL= 2
SRCDIR= @top_srcdir@ SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq CFLAGS+= -I../include -I$(SRCDIR)/interfaces/libpq
PORTNAME=@PORTNAME@
ifdef KRBVERS ifdef KRBVERS
CFLAGS+= $(KRBFLAGS) CFLAGS+= $(KRBFLAGS)
endif endif
# Shared library stuff OBJS= ecpglib.o typename.o
shlib :=
install-shlib-dep :=
ifeq ($(PORTNAME), linux) SHLIB_LINK= -L../../libpq -lpq
LINUX_ELF=@LINUX_ELF@
ifdef LINUX_ELF
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
LDFLAGS_SL = -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
endif
endif
ifeq ($(PORTNAME), bsd) # Shared library stuff, also default 'all' target
ifdef BSD_SHLIB include $(SRCDIR)/Makefile.shlib
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
LDFLAGS_SL = -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
LDFLAGS_SL = -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386) .PHONY: install
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
LDFLAGS_SL = -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
LDFLAGS_SL = -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).1
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), unixware)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).1
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), hpux) install: install-lib $(install-shlib-dep)
install-shlib-dep := install-shlib
shlib := lib$(NAME).sl
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
all: lib$(NAME).a $(shlib) # Handmade dependencies in case make depend not done
ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
typename.o : typename.c ../include/ecpgtype.h
$(shlib): ecpglib.o typename.o
$(LD) $(LDFLAGS_SL) -o $@ ecpglib.o typename.o
.PHONY: clean
clean: clean:
rm -f *.o *.a core a.out *~ $(shlib) lib$(NAME)$(DLSUFFIX) rm -f lib$(NAME).a $(shlib) $(OBJS)
dep depend:
.PHONY: install install-libecpg install-shlib
install: install-libecpg $(install-shlib-dep)
install-libecpg: lib$(NAME).a
$(INSTALL) $(INSTL_LIB_OPTS) lib$(NAME).a $(LIBDIR)/lib$(NAME).a
install-shlib: $(shlib) depend dep:
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib) $(CC) -MM $(CFLAGS) *.c >depend
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
ifeq (depend,$(wildcard depend))
uninstall:: include depend
rm -f $(LIBDIR)/lib$(NAME).a $(LIBDIR)/$(shlib) endif
rm -f $(LIBDIR)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
rm -f $(LIBDIR)/lib$(NAME)$(DLSUFFIX)
# Rules that do something
lib$(NAME).a : lib$(NAME).a(ecpglib.o) lib$(NAME).a(typename.o)
ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c $< -o $@
typename.o : typename.c ../include/ecpgtype.h
$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c $< -o $@
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
#
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.32 1998/10/18 19:40:54 tgl Exp $ # $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.33 1998/10/19 00:00:41 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -18,121 +17,25 @@ SO_MINOR_VERSION= 0 ...@@ -18,121 +17,25 @@ SO_MINOR_VERSION= 0
SRCDIR= @top_srcdir@ SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
INCLUDE_OPT= \ CFLAGS+= -I$(SRCDIR)/backend \
-I$(SRCDIR)/backend \ -I$(SRCDIR)/include \
-I$(SRCDIR)/include \ -I$(LIBPQDIR)
-I$(LIBPQDIR)
PORTNAME=@PORTNAME@
CFLAGS+= $(INCLUDE_OPT)
ifdef KRBVERS ifdef KRBVERS
CFLAGS+= $(KRBFLAGS) CFLAGS+= $(KRBFLAGS)
endif endif
# Shared library stuff
install-shlib-dep :=
shlib :=
LIBPQ= -L$(SRCDIR)/interfaces/libpq -lpq
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
CFLAGS += $(CFLAGS_SL)
LDFLAGS_SL = -shared
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL = -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsdi)
ifdef BSD_SHLIB
ifeq ($(DLSUFFIX), .so)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(DLSUFFIX), .o)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LD := shlicc
LDFLAGS_SL += -O -r
CFLAGS += $(CFLAGS_SL)
endif
endif
endif
ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), unixware)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), hpux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX)
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
OBJS= pgtcl.o pgtclCmds.o pgtclId.o OBJS= pgtcl.o pgtclCmds.o pgtclId.o
SHLIB_LINK= -L../libpq -lpq
all: lib$(NAME).a $(shlib) # Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
lib$(NAME).a: $(OBJS)
ifdef MK_NO_LORDER
$(AR) $(AROPT) lib$(NAME).a $(OBJS)
else
$(AR) $(AROPT) lib$(NAME).a `lorder $(OBJS) | tsort`
endif
$(RANLIB) lib$(NAME).a
$(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(LIBPQ)
.PHONY: beforeinstall-headers install-headers .PHONY: install beforeinstall-headers install-headers
.PHONY: install install-libpgtcl install-shlib
install: install-headers install-libpgtcl $(install-shlib-dep) install: install-headers install-lib $(install-shlib-dep)
install-headers: beforeinstall-headers libpgtcl.h install-headers: beforeinstall-headers libpgtcl.h
$(INSTALL) $(INSTLOPTS) libpgtcl.h $(HEADERDIR)/libpgtcl.h $(INSTALL) $(INSTLOPTS) libpgtcl.h $(HEADERDIR)/libpgtcl.h
...@@ -140,24 +43,14 @@ install-headers: beforeinstall-headers libpgtcl.h ...@@ -140,24 +43,14 @@ install-headers: beforeinstall-headers libpgtcl.h
beforeinstall-headers: beforeinstall-headers:
@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi @if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
install-libpgtcl: lib$(NAME).a
$(INSTALL) $(INSTL_LIB_OPTS) lib$(NAME).a $(LIBDIR)/lib$(NAME).a
install-shlib: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
.PHONY: clean .PHONY: clean
clean: clean:
rm -f $(OBJS) $(shlib) lib$(NAME).a rm -f $(OBJS) $(shlib) lib$(NAME).a
dep depend: depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
ifeq (depend,$(wildcard depend))
include depend
endif
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
#
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.9 1998/10/18 19:40:55 tgl Exp $ # $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.10 1998/10/19 00:00:46 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -18,148 +17,50 @@ SO_MINOR_VERSION= 0 ...@@ -18,148 +17,50 @@ SO_MINOR_VERSION= 0
SRCDIR= @top_srcdir@ SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
PORTNAME=@PORTNAME@
CXX=@CXX@ CXX=@CXX@
SRCHEADERDIR = $(SRCDIR)/include SRCHEADERDIR = $(SRCDIR)/include
LIBPQHEADERDIR = $(SRCHEADERDIR)/libpq LIBPQHEADERDIR = $(SRCHEADERDIR)/libpq
# We have to override -Werror, which makes warnings, fatal, because we # We have to override -Werror, which makes warnings fatal, because we
# inevitably get the warning, "abstract declarator used as declaration" # inevitably get the warning, "abstract declarator used as declaration"
# because of our inclusion of c.h and we don't know how to stop that. # because of our inclusion of c.h and we don't know how to stop that.
ifeq ($(CXX), g++) ifeq ($(CXX), g++)
CXXFLAGS= $(CFLAGS) -Wno-error CXXFLAGS= -Wno-error
else else
CXXFLAGS= $(CFLAGS) CXXFLAGS=
endif endif
INCLUDE_OPT= \ CXXFLAGS+= -I$(SRCDIR)/backend \
-I$(SRCDIR)/backend \
-I$(SRCHEADERDIR) \ -I$(SRCHEADERDIR) \
-I$(LIBPQDIR) -I$(LIBPQDIR)
CXXFLAGS+= $(INCLUDE_OPT)
#CXXFLAGS+= -DDEBUG #CXXFLAGS+= -DDEBUG
ifdef KRBVERS ifdef KRBVERS
CXXFLAGS+= $(KRBFLAGS) CXXFLAGS+= $(KRBFLAGS)
endif endif
OBJS = pgenv.o pgconnection.o pgtransdb.o pgcursordb.o pglobject.o OBJS = pgenv.o pgconnection.o pgtransdb.o pgcursordb.o pglobject.o
# Shared library stuff SHLIB_LINK= -L../libpq -lpq
shlib :=
install-shlib-dep :=
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsdi)
ifdef BSD_SHLIB
ifeq ($(DLSUFFIX), .so)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(DLSUFFIX), .o)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LD := shlicc
LDFLAGS_SL += -O -r
CFLAGS += $(CFLAGS_SL)
endif
endif
endif
ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), unixware)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
ifeq ($(CXX), CC)
CXXFLAGS += -Xw
COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
endif
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
ifeq ($(CXX), CC)
CXXFLAGS += -Xw
COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
endif
endif
ifeq ($(PORTNAME), hpux)
install-shlib-dep := install-shlib
shlib := lib$(NAME).sl
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
all: libpq++.a $(shlib)
libpq++.a: $(OBJS) # Pull shared-lib CFLAGS into CXXFLAGS
ifdef MK_NO_LORDER CXXFLAGS+= $(CFLAGS)
$(AR) $(AROPT) libpq++.a $(OBJS)
else
$(AR) $(AROPT) libpq++.a `lorder $(OBJS) | tsort`
endif
$(RANLIB) libpq++.a
$(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS)
.PHONY: examples .PHONY: examples
examples: examples:
$(MAKE) -C examples all $(MAKE) -C examples all
.PHONY: beforeinstall-headers install-headers .PHONY: install beforeinstall-headers install-headers
.PHONY: install beforeinstall-lib install-libpq++ install-shlib
install: install-headers install-libpq++ $(install-shlib-dep) install: install-headers install-lib $(install-shlib-dep)
LIBPGXXDIR = libpq++ LIBPGXXDIR = libpq++
LIBPGXXHEADERDIR = $(HEADERDIR)/$(LIBPGXXDIR) LIBPGXXHEADERDIR = $(HEADERDIR)/$(LIBPGXXDIR)
...@@ -182,32 +83,13 @@ beforeinstall-headers: ...@@ -182,32 +83,13 @@ beforeinstall-headers:
@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi @if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
@if [ ! -d $(LIBPGXXHEADERDIR) ]; then mkdir $(LIBPGXXHEADERDIR); fi @if [ ! -d $(LIBPGXXHEADERDIR) ]; then mkdir $(LIBPGXXHEADERDIR); fi
beforeinstall-lib:
@if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR); fi
install-libpq++: libpq++.a beforeinstall-lib
$(INSTALL) $(INSTL_LIB_OPTS) libpq++.a $(LIBDIR)/libpq++.a
install-shlib: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
.PHONY: clean .PHONY: clean
clean: clean:
rm -f libpq++.a $(shlib) $(OBJS) rm -f libpq++.a $(shlib) $(OBJS)
$(MAKE) -C examples clean $(MAKE) -C examples clean
dep depend: dep depend:
$(CXX) -MM $(CXXFLAGS) *.cc > depend $(CXX) -MM $(CXXFLAGS) *.cc >depend
ifeq (depend,$(wildcard depend)) ifeq (depend,$(wildcard depend))
include depend include depend
......
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
#
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.39 1998/10/18 19:40:55 tgl Exp $ # $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.40 1998/10/19 00:00:43 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -18,8 +17,6 @@ SO_MINOR_VERSION= 0 ...@@ -18,8 +17,6 @@ SO_MINOR_VERSION= 0
SRCDIR= @top_srcdir@ SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
PORTNAME= @PORTNAME@
CFLAGS+= -DFRONTEND CFLAGS+= -DFRONTEND
ifdef KRBVERS ifdef KRBVERS
...@@ -37,96 +34,9 @@ ifdef MULTIBYTE ...@@ -37,96 +34,9 @@ ifdef MULTIBYTE
OBJS+= common.o wchar.o conv.o OBJS+= common.o wchar.o conv.o
endif endif
# Shared library stuff # Shared library stuff, also default 'all' target
shlib := include $(SRCDIR)/Makefile.shlib
install-shlib-dep :=
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsdi)
ifdef BSD_SHLIB
ifeq ($(DLSUFFIX), .so)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(DLSUFFIX), .o)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LD := shlicc
LDFLAGS_SL += -O -r
CFLAGS += $(CFLAGS_SL)
endif
endif
endif
ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), unixware)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), hpux)
install-shlib-dep := install-shlib
shlib := lib$(NAME).sl
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
all: libpq.a $(shlib)
libpq.a: $(OBJS)
ifdef MK_NO_LORDER
$(AR) $(AROPT) libpq.a $(OBJS)
else
$(AR) $(AROPT) libpq.a `lorder $(OBJS) | tsort`
endif
$(RANLIB) libpq.a
# We need to compile this with special options for shared libs, # We need to compile this with special options for shared libs,
# so we can't use the object in $(SRCDIR)/backend # so we can't use the object in $(SRCDIR)/backend
...@@ -154,14 +64,10 @@ fe-lobj.o: $(SRCDIR)/backend/fmgr.h ...@@ -154,14 +64,10 @@ fe-lobj.o: $(SRCDIR)/backend/fmgr.h
$(SRCDIR)/backend/fmgr.h: $(SRCDIR)/backend/fmgr.h:
$(MAKE) -C $(SRCDIR)/backend fmgr.h $(MAKE) -C $(SRCDIR)/backend fmgr.h
$(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS)
.PHONY: beforeinstall-headers install-headers .PHONY: install beforeinstall-headers install-headers
.PHONY: install install-libpq install-shlib
install: install-headers install-libpq $(install-shlib-dep) install: install-headers install-lib $(install-shlib-dep)
# Many of the headers we install below have nothing to do with libpq, # Many of the headers we install below have nothing to do with libpq,
# so should be installed by someone else. # so should be installed by someone else.
...@@ -224,22 +130,6 @@ beforeinstall-headers: ...@@ -224,22 +130,6 @@ beforeinstall-headers:
@if [ ! -d $(HEADERDIR)/commands ]; \ @if [ ! -d $(HEADERDIR)/commands ]; \
then mkdir $(HEADERDIR)/commands; fi then mkdir $(HEADERDIR)/commands; fi
install-libpq: libpq.a
$(INSTALL) $(INSTL_LIB_OPTS) libpq.a $(LIBDIR)/libpq.a
install-shlib: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
.PHONY: clean .PHONY: clean
clean: clean:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.6 1998/10/18 19:40:56 tgl Exp $ # $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.7 1998/10/19 00:00:49 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@SET_MAKE@ @SET_MAKE@
...@@ -18,33 +18,13 @@ ODBCSRCDIR= @srcdir@ ...@@ -18,33 +18,13 @@ ODBCSRCDIR= @srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
include Version.mk include Version.mk
PORTNAME= @PORTNAME@
FIND= @find@ FIND= @find@
# assuming gnu tar and split here # assuming gnu tar and split here
TAR= @tar@ TAR= @tar@
SPLIT= @split@ SPLIT= @split@
# Shared library stuff CFLAGS += -I. @DEFS@
shlib :=
install-shlib-dep :=
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL = -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -Bsymbolic $(LDFLAGS) -lc -lm
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL = -x -Bshareable -Bforcearchive $(LDFLAGS)
CFLAGS += $(CFLAGS_SL)
endif
endif
SOURCES = *.c *.h *.in Config.mk \ SOURCES = *.c *.h *.in Config.mk \
TODO.txt Version.mk config.guess config.sub configure \ TODO.txt Version.mk config.guess config.sub configure \
...@@ -52,28 +32,21 @@ SOURCES = *.c *.h *.in Config.mk \ ...@@ -52,28 +32,21 @@ SOURCES = *.c *.h *.in Config.mk \
psqlodbc.def \ psqlodbc.def \
psqlodbc.rc readme.txt psqlodbc.rc readme.txt
OBJECTS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \ OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
environ.o execute.o lobj.o misc.o options.o \ environ.o execute.o lobj.o misc.o options.o \
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \ pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX) gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX)
CFLAGS += -I. @DEFS@ SHLIB_LINK= $(LIBS)
all: libpsqlodbc.a $(shlib)
libpsqlodbc.a: $(OBJECTS) # Shared library stuff, also default 'all' target
$(AR) $(AROPT) libpsqlodbc.a $(OBJECTS) include $(SRCDIR)/Makefile.shlib
$(RANLIB) libpsqlodbc.a
$(shlib): $(OBJECTS)
$(LD) $(LDFLAGS_SL) $(OBJECTS) \
-o $(shlib) $(LIBS)
.PHONY: beforeinstall-headers install-headers .PHONY: install install-ini beforeinstall-headers install-headers
.PHONY: install install-libpsqlodbc install-ini install-shlib
install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \ install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \
install-libpsqlodbc install-ini $(install-shlib-dep) install-ini install-lib $(install-shlib-dep)
$(HEADERDIR) $(LIBDIR) $(ODBCINST): $(HEADERDIR) $(LIBDIR) $(ODBCINST):
mkdir -p $@ mkdir -p $@
...@@ -86,32 +59,13 @@ install-headers: beforeinstall-headers isql.h isqlext.h iodbc.h ...@@ -86,32 +59,13 @@ install-headers: beforeinstall-headers isql.h isqlext.h iodbc.h
beforeinstall-headers: beforeinstall-headers:
@if [ ! -d $(HEADERDIR)/iodbc ]; then mkdir -p $(HEADERDIR)/iodbc; fi @if [ ! -d $(HEADERDIR)/iodbc ]; then mkdir -p $(HEADERDIR)/iodbc; fi
install-libpsqlodbc: libpsqlodbc.a
$(INSTALL) $(INSTL_LIB_OPTS) libpsqlodbc.a $(LIBDIR)/lib$(NAME).a
install-shlib: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
fi
if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
cd $(LIBDIR); \
rm -f lib$(NAME)$(DLSUFFIX); \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
fi
install-ini: odbcinst.ini install-ini: odbcinst.ini
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST) $(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
depend dep:
$(CC) -MM *.c >depend
.PHONY: clean .PHONY: clean
clean: clean:
-rm -f lib$(NAME).a $(shlib) $(OBJECTS) lib$(NAME)$(DLSUFFIX) -rm -f lib$(NAME).a $(shlib) $(OBJS)
.PHONY: distclean .PHONY: distclean
...@@ -141,3 +95,10 @@ integrated: ...@@ -141,3 +95,10 @@ integrated:
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz -rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
$(TAR) -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES) $(TAR) -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
ifeq (depend,$(wildcard depend))
include depend
endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.3 1998/10/18 19:40:56 tgl Exp $ # $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.4 1998/10/19 00:00:49 tgl Exp $
# #
# NOTES # NOTES
# This is derived from the main Postgres makefile. # This is derived from the main Postgres makefile.
...@@ -131,6 +131,13 @@ LDFLAGS= @LDFLAGS@ @LIBS@ ...@@ -131,6 +131,13 @@ LDFLAGS= @LDFLAGS@ @LIBS@
DLSUFFIX= @DLSUFFIX@ DLSUFFIX= @DLSUFFIX@
LN_S = @LN_S@ LN_S = @LN_S@
##############################################################################
#
# Additional platform-specific settings
#
PORTNAME= @PORTNAME@
ifneq ($(wildcard $(SRCDIR)/Makefile.port), ) ifneq ($(wildcard $(SRCDIR)/Makefile.port), )
include $(SRCDIR)/Makefile.port include $(SRCDIR)/Makefile.port
endif endif
......
...@@ -4,120 +4,40 @@ ...@@ -4,120 +4,40 @@
# Makefile for the plpgsql shared object # Makefile for the plpgsql shared object
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.9 1998/10/18 19:40:58 tgl Exp $ # $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.10 1998/10/19 00:00:51 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# NAME= plpgsql
# Tell make where the postgresql sources live SO_MAJOR_VERSION= 1
# SO_MINOR_VERSION= 0
SRCDIR= ../../..
# SRCDIR= @top_srcdir@
# Include the global and port specific Makefiles
#
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
PORTNAME=@PORTNAME@
CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include
LFLAGS+= -i -l
# For fmgr.h # For fmgr.h
CFLAGS+= -I$(SRCDIR)/backend CFLAGS+= -I$(SRCDIR)/backend
LDADD+= -L$(LIBPQDIR) -lpq LFLAGS+= -i -l
ifeq ($(PORTNAME), linux)
CFLAGS += $(CFLAGS_SL)
LDFLAGS_SL = -shared
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
LDFLAGS_SL = -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsdi)
ifdef BSD_SHLIB
ifeq ($(DLSUFFIX), .so)
LDFLAGS_SL += -shared
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(DLSUFFIX), .o)
LD := shlicc
LDFLAGS_SL += -O -r
CFLAGS += $(CFLAGS_SL)
endif
endif
endif
ifeq ($(PORTNAME), solaris_sparc)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), svr4)
LDFLAGS_SL := -G
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), unixware)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
LDFLAGS_SL := -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), hpux)
LDFLAGS_SL := -b
CFLAGS += $(CFLAGS_SL)
endif
#
# DLOBJ is the dynamically-loaded object file.
#
DLOBJ= plpgsql$(DLSUFFIX)
OBJS= plpgsql.o
PLOBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
ALL= $(DLOBJ)
#
# Build the shared object
#
all: $(ALL)
$(OBJS): $(PLOBJS) OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
$(LD) -r -o $(OBJS) $(PLOBJS)
$(DLOBJ): $(OBJS) SHLIB_LINK= -L$(LIBPQDIR) -lpq
# # Shared library stuff, also default 'all' target
# Clean include $(SRCDIR)/Makefile.shlib
#
clean:
rm -f $(ALL)
rm -f *.o y.tab.h pl.tab.h pl_gram.c gram.c pl_scan.c scan.c
install: all
$(INSTALL) $(INSTL_SHLIB_OPTS) $(DLOBJ) $(DESTDIR)$(LIBDIR)/$(DLOBJ)
$(DLOBJ): $(OBJS) # In order to use Makefile.shlib, we allow it to build a static library
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) # libplpgsql.a, which we just ignore, as well as a shared library that
# it will insist on naming $(shlib). We don't want to call it that when
# installed, however, so we ignore the install-shlib rule and do this
# instead:
install: $(shlib)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/plpgsql$(DLSUFFIX)
pl_handler.o: pl_handler.c plpgsql.h pl.tab.h pl_handler.o: pl_handler.c plpgsql.h pl.tab.h
...@@ -143,3 +63,10 @@ gram.c: gram.y ...@@ -143,3 +63,10 @@ gram.c: gram.y
scan.c: scan.l scan.c: scan.l
pl.tab.h: pl_gram.c pl.tab.h: pl_gram.c
.PHONY: clean
clean:
rm -f lib$(NAME).a $(shlib)
rm -f *.o y.tab.h pl.tab.h pl_gram.c gram.c pl_scan.c scan.c
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