]> granicus.if.org Git - postgresql/commitdiff
Implement a few changes to how shared libraries and dynamically loadable
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 7 Apr 2008 14:15:58 +0000 (14:15 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 7 Apr 2008 14:15:58 +0000 (14:15 +0000)
modules are built.  Foremost, it creates a solid distinction between these two
types of targets based on what had already been implemented and duplicated in
ad hoc ways before.  Specifically,

- Dynamically loadable modules no longer get a soname.  The numbers previously
set in the makefiles were dummy numbers anyway, and the presence of a soname
upset a few packaging tools, so it is nicer not to have one.

- The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and
then override the rule to install foo.so instead) is removed.

- Lots of duplicated code simplified.

14 files changed:
src/Makefile.shlib
src/backend/snowball/Makefile
src/backend/utils/mb/conversion_procs/proc.mk
src/interfaces/ecpg/compatlib/Makefile
src/interfaces/ecpg/ecpglib/Makefile
src/interfaces/ecpg/pgtypeslib/Makefile
src/interfaces/libpq/Makefile
src/makefiles/pgxs.mk
src/pl/plperl/GNUmakefile
src/pl/plpgsql/src/Makefile
src/pl/plpython/Makefile
src/pl/tcl/Makefile
src/test/regress/GNUmakefile
src/tutorial/Makefile

index 7d219d8cfc3b5ad368f48d03b2ae4ad9ed3c33e3..316b9d1642348481df8144bd235c323a1213afd0 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.113 2008/02/26 14:26:16 petere Exp $
+#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.114 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 # 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
 # SHLIB_EXPORTS         (optional) Name of file containing list of symbols to
 #                       export
+#
+# When building a shared library, the following version information
+# must also be set.  It should be omitted when building a dynamically
+# loadable module.
+#
+# SO_MAJOR_VERSION      Major version number to use for shared library
+# SO_MINOR_VERSION      Minor version number to use for shared library
 # (If you want a patchlevel, include it in SO_MINOR_VERSION, e.g., "6.2".)
 #
 # Optional flags when building DLL's (only applicable to win32 and cygwin
@@ -42,6 +47,7 @@
 #
 # all-lib               build the static and shared (if applicable) libraries
 # install-lib           install the libraries into $(libdir)
+# installdirs-lib       create installation directory $(libdir)
 # uninstall-lib         remove the libraries from $(libdir)
 # clean-lib             delete the static and shared libraries from the build dir
 # maintainer-clean-lib  delete .def files built for win32
@@ -72,18 +78,34 @@ LINK.static = $(AR) $(AROPT)
 
 
 
-ifeq ($(enable_shared), yes)
-
 # Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
 SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
 
 # Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
 LDFLAGS_NO_L = $(filter-out -L%, $(LDFLAGS))
 
-# Default shlib naming convention used by the majority of platforms
+ifdef SO_MAJOR_VERSION
+# Default library naming convention used by the majority of platforms
+ifeq ($(enable_shared), yes)
 shlib          = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
 shlib_major    = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
 shlib_bare     = lib$(NAME)$(DLSUFFIX)
+endif
+# Testing the soname variable is a reliable way to determine whether a
+# linkable library is being built.
+soname         = $(shlib_major)
+stlib          = lib$(NAME).a
+else
+# Naming convention for dynamically loadable modules
+ifeq ($(enable_shared), yes)
+shlib          = $(NAME)$(DLSUFFIX)
+endif
+endif
+
+ifndef soname
+# additional flags for backend modules
+SHLIB_LINK := $(BE_DLLLIBS) $(SHLIB_LINK)
+endif
 
 # For each platform we support shared libraries on, set shlib to the
 # name of the library (if default above is not right), set
@@ -94,29 +116,29 @@ shlib_bare = lib$(NAME)$(DLSUFFIX)
 
 override CFLAGS += $(CFLAGS_SL)
 
-soname = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
-
 ifeq ($(PORTNAME), aix)
-  shlib                        = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  ifdef SO_MAJOR_VERSION
+    shlib              = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  endif
   haslibarule   = yes
   exports_file         = lib$(NAME).exp
 endif
 
 ifeq ($(PORTNAME), darwin)
-  ifneq ($(SO_MAJOR_VERSION), 0)
-    version_link       = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
-  endif
-  ifeq ($(DLTYPE), library)
+  ifdef soname
     # linkable library
     DLSUFFIX           = .dylib
+    ifneq ($(SO_MAJOR_VERSION), 0)
+      version_link     = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    endif
     LINK.shared                = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) $(exported_symbols_list) -multiply_defined suppress
+    shlib              = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
+    shlib_major                = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
   else
-    # loadable module (default case)
+    # loadable module
     DLSUFFIX           = .so
     LINK.shared                = $(COMPILER) -bundle -multiply_defined suppress
   endif
-  shlib                        = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
-  shlib_major          = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
   BUILD.exports                = $(AWK) '/^[^\#]/ {printf "_%s\n",$$1}' $< >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
@@ -126,7 +148,10 @@ endif
 
 ifeq ($(PORTNAME), openbsd)
   ifdef ELF_SYSTEM
-    LINK.shared                = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
+    LINK.shared                = $(COMPILER) -shared
+    ifdef soname
+      LINK.shared      += -Wl,-x,-soname,$(soname)
+    endif
     SHLIB_LINK         += -lc
   else
     LINK.shared                = $(LD) -x -Bshareable -Bforcearchive
@@ -135,7 +160,10 @@ endif
 
 ifeq ($(PORTNAME), bsdi)
   ifeq ($(DLSUFFIX), .so)
-    LINK.shared                = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
+    LINK.shared                = $(COMPILER) -shared
+    ifdef soname
+      LINK.shared      += -Wl,-x,-soname,$(soname)
+    endif
     SHLIB_LINK         += -lc
   endif
   ifeq ($(DLSUFFIX), .o)
@@ -145,33 +173,50 @@ endif
 
 ifeq ($(PORTNAME), freebsd)
   ifdef ELF_SYSTEM
-    shlib              = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
-    LINK.shared                = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
+    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
-    shlib              = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    ifdef SO_MAJOR_VERSION
+      shlib            = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    endif
     LINK.shared                = $(LD) -x -Bshareable -Bforcearchive
   endif
 endif
 
 ifeq ($(PORTNAME), netbsd)
   ifdef ELF_SYSTEM
-    LINK.shared                = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
+    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)
-  shlib                        = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  ifdef SO_MAJOR_VERSION
+    shlib                      = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  endif
   ifeq ($(with_gnu_ld), yes)
-    LINK.shared                = $(CC) $(LDFLAGS_NO_L) -shared -Wl,-h -Wl,$(soname)
+    LINK.shared                = $(CC) $(LDFLAGS_NO_L) -shared
+    ifdef soname
+      LINK.shared      += -Wl,-h -Wl,$(soname)
+    endif
   else
     # can't use the CC-syntax rpath pattern here
     rpath =
+    LINK.shared                = $(LD) -b
+    ifdef soname
+      LINK.shared      += +h $(soname)
+    endif
     ifeq ($(enable_rpath), yes)
-      LINK.shared      = $(LD) +h $(soname) -b +b '$(rpathdir)'
-    else
-      LINK.shared      = $(LD) +h $(soname) -b
+      LINK.shared      += +b '$(rpathdir)'
     endif
     # On HPUX platforms, gcc is usually configured to search for libraries
     # in /usr/local/lib, but ld won't do so.  Add an explicit -L switch so
@@ -188,12 +233,20 @@ ifeq ($(PORTNAME), hpux)
 endif
 
 ifeq ($(PORTNAME), irix)
-  shlib                        = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
-  LINK.shared          = $(COMPILER) -shared -Wl,-set_version,sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  ifdef SO_MAJOR_VERSION
+    shlib              = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  endif
+  LINK.shared          = $(COMPILER) -shared
+  ifdef soname
+    LINK.shared                += -Wl,-set_version,sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  endif
 endif
 
 ifeq ($(PORTNAME), linux)
-  LINK.shared          = $(COMPILER) -shared -Wl,-soname,$(soname)
+  LINK.shared          = $(COMPILER) -shared
+  ifdef soname
+    LINK.shared                += -Wl,-soname,$(soname)
+  endif
   BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
@@ -208,10 +261,12 @@ ifeq ($(PORTNAME), solaris)
 # CFLAGS added for X86_64
     LINK.shared                = $(CC) -G $(CFLAGS)
   endif
-  ifeq ($(with_gnu_ld), yes)
-    LINK.shared                += -Wl,-soname,$(soname)
-  else
-    LINK.shared                += -h $(soname)
+  ifdef soname
+    ifeq ($(with_gnu_ld), yes)
+      LINK.shared      += -Wl,-soname,$(soname)
+    else
+      LINK.shared      += -h $(soname)
+    endif
   endif
 endif
 
@@ -229,7 +284,10 @@ ifeq ($(PORTNAME), sco)
   else
     LINK.shared                = $(CC) -G
     endif
-  LINK.shared          += -Wl,-z,text -Wl,-h,$(soname)
+  LINK.shared          += -Wl,-z,text
+  ifdef soname
+    LINK.shared                += -Wl,-h,$(soname)
+  endif
 endif
 
 ifeq ($(PORTNAME), svr4)
@@ -246,7 +304,10 @@ ifeq ($(PORTNAME), unixware)
   else
     LINK.shared                = $(CC) -G
   endif
-  LINK.shared          += -Wl,-z,text -Wl,-h,$(soname) 
+  LINK.shared          += -Wl,-z,text
+  ifdef soname
+    LINK.shared                += -Wl,-h,$(soname)
+  endif
 endif
 
 ifeq ($(PORTNAME), cygwin)
@@ -263,8 +324,6 @@ ifeq ($(enable_rpath), yes)
 SHLIB_LINK += $(rpath)
 endif
 
-endif # enable_shared
-
 
 
 ##
@@ -273,14 +332,18 @@ endif # enable_shared
 
 .PHONY: all-lib all-static-lib all-shared-lib
 
-all-lib: all-static-lib all-shared-lib
+all-lib: all-shared-lib
+ifdef soname
+# no static library when building a dynamically loadable module
+all-lib: all-static-lib
+endif
 
-all-static-lib: lib$(NAME).a
+all-static-lib: $(stlib)
 
 all-shared-lib: $(shlib)
 
 ifndef haslibarule
-lib$(NAME).a: $(OBJS)
+$(stlib): $(OBJS)
        $(LINK.static) $@ $^
        $(RANLIB) $@
 endif #haslibarule
@@ -293,6 +356,7 @@ ifneq ($(PORTNAME), aix)
 # Normal case
 $(shlib): $(OBJS)
        $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
+ifdef shlib_major
 # If we're using major and minor versions, then make a symlink to major-version-only.
 ifneq ($(shlib), $(shlib_major))
        rm -f $(shlib_major)
@@ -303,6 +367,7 @@ ifneq ($(shlib), $(shlib_bare))
        rm -f $(shlib_bare)
        $(LN_S) $(shlib) $(shlib_bare)
 endif
+endif # shlib_major
 
 # Where possible, restrict the symbols exported by the library to just the
 # official list, so as to avoid unintentional ABI changes.  On recent Darwin
@@ -320,13 +385,13 @@ endif
 else # PORTNAME == aix
 
 # AIX case
-$(shlib) lib$(NAME).a: $(OBJS)
-       $(LINK.static) lib$(NAME).a $^
-       $(RANLIB) lib$(NAME).a
-       $(MKLDEXPORT) lib$(NAME).a >$(exports_file)
-       $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(shlib) lib$(NAME).a -Wl,-bE:$(exports_file) $(SHLIB_LINK)
-       rm -f lib$(NAME).a
-       $(AR) $(AROPT) lib$(NAME).a $(shlib)
+$(shlib) $(stlib): $(OBJS)
+       $(LINK.static) $(stlib) $^
+       $(RANLIB) $(stlib)
+       $(MKLDEXPORT) $(stlib) >$(exports_file)
+       $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(SHLIB_LINK)
+       rm -f $(stlib)
+       $(AR) $(AROPT) $(stlib) $(shlib)
 
 endif # PORTNAME == aix
 
@@ -348,7 +413,7 @@ endif
 $(shlib): $(OBJS) $(DLL_DEFFILE)
        $(DLLWRAP) $(LDFLAGS_SL) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK)
 
-lib$(NAME).a: $(shlib) $(DLL_DEFFILE)
+$(stlib): $(shlib) $(DLL_DEFFILE)
        $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
 
 endif # PORTNAME == cygwin || PORTNAME == win32
@@ -394,18 +459,22 @@ endif # SHLIB_EXPORTS
 ## INSTALL
 ##
 
-.PHONY: install-lib install-lib-static install-lib-shared
-install-lib: install-lib-static install-lib-shared
+.PHONY: install-lib install-lib-static install-lib-shared installdirs-lib
+install-lib: install-lib-shared
+ifdef soname
+install-lib: install-lib-static
+endif
 
-install-lib-static: lib$(NAME).a
-       $(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).a'
+install-lib-static: $(stlib) installdirs-lib
+       $(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/$(stlib)'
 ifeq ($(PORTNAME), darwin)
        cd '$(DESTDIR)$(libdir)' && \
-       ranlib lib$(NAME).a
+       ranlib $(stlib)
 endif
 
 ifeq ($(enable_shared), yes)
-install-lib-shared: $(shlib)
+install-lib-shared: $(shlib) installdirs-lib
+ifdef soname
 # we don't install $(shlib) on AIX
 ifneq ($(PORTNAME), aix)
        $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
@@ -424,21 +493,43 @@ endif
 endif # not win32
 endif # not cygwin
 endif # not aix
+else # no soname
+       $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)'
+endif
+else # not enable_shared
+ifndef soname
+install-lib-shared:
+       @echo "*****"; \
+        echo "* Module $(NAME) was not installed due to lack of shared library support."; \
+        echo "*****"
+endif
 endif # enable_shared
 
 
+installdirs-lib:
+ifdef soname
+       $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+else
+       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+endif
+
+
 ##
 ## UNINSTALL
 ##
 
 .PHONY: uninstall-lib
 uninstall-lib:
-       rm -f '$(DESTDIR)$(libdir)/lib$(NAME).a'
+ifdef soname
+       rm -f '$(DESTDIR)$(libdir)/$(stlib)'
 ifeq ($(enable_shared), yes)
        rm -f '$(DESTDIR)$(libdir)/$(shlib_bare)' \
          '$(DESTDIR)$(libdir)/$(shlib_major)' \
          '$(DESTDIR)$(libdir)/$(shlib)'
 endif # enable_shared
+else # no soname
+       rm -f '$(DESTDIR)$(pkglibdir)/$(shlib)'
+endif # no soname
 
 
 ##
@@ -447,10 +538,7 @@ endif # enable_shared
 
 .PHONY: clean-lib
 clean-lib:
-       rm -f lib$(NAME).a
-ifeq ($(enable_shared), yes)
-       rm -f $(shlib_bare) $(shlib_major) $(shlib) $(exports_file)
-endif
+       rm -f $(shlib) $(shlib_bare) $(shlib_major) $(stlib) $(exports_file)
 
 ifneq (,$(SHLIB_EXPORTS))
 maintainer-clean-lib:
index 466a507c0896ac4d983b3c45587bc09641efd135..a1d22f24c687ba50f773bbe737c6c577eaa06960 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Makefile for src/backend/snowball
 #
-# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.5 2008/03/18 16:24:50 petere Exp $
+# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.6 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -77,11 +77,7 @@ else
 VPATH = $(srcdir)/libstemmer
 endif
 
-SHLIB_LINK     := $(BE_DLLLIBS)
-
 NAME := dict_snowball
-SO_MAJOR_VERSION := 0
-SO_MINOR_VERSION := 0
 rpath =
 
 all: all-shared-lib $(SQLSCRIPT)
@@ -116,10 +112,7 @@ else
        echo "-- No language-specific snowball dictionaries, for lack of shared library support" > $@
 endif
 
-install: all installdirs
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
-endif
+install: all installdirs install-lib
        $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
        @set -e; \
        set $(LANGUAGES) ; \
@@ -131,11 +124,10 @@ endif
                fi \
        done
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)' '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
+installdirs: installdirs-lib
+       $(mkinstalldirs) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
+uninstall: uninstall-lib
        rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
        @set -e; \
        set $(LANGUAGES) ; \
index 05bc2a4a09b8636938e02ff9d15eca01e65aa3ca..77322a452ef2e809617338c1a1468d390022d9c9 100644 (file)
@@ -1,26 +1,17 @@
 SRCS           += $(NAME).c
 OBJS           += $(NAME).o
 
-SHLIB_LINK     := $(BE_DLLLIBS)
-
-SO_MAJOR_VERSION := 0
-SO_MINOR_VERSION := 0
 rpath =
 
 all: all-shared-lib
 
 include $(top_srcdir)/src/Makefile.shlib
 
-install: all installdirs
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
-endif
+install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+installdirs: installdirs-lib
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
+uninstall: uninstall-lib
 
 clean distclean maintainer-clean: clean-lib
        rm -f $(OBJS)
index b8c17f0706160ef6ffbd9339148e5bab58617cc2..29f27ea35c468af8c66478c9192b11a4ae1594dd 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.39 2008/02/26 06:41:23 petere Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.40 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -16,7 +16,6 @@ include $(top_builddir)/src/Makefile.global
 NAME= ecpg_compat
 SO_MAJOR_VERSION= 3
 SO_MINOR_VERSION= 1
-DLTYPE= library
 
 override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
        -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
@@ -42,8 +41,7 @@ snprintf.c: % : $(top_srcdir)/src/port/%
 
 install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+installdirs: installdirs-lib
 
 uninstall: uninstall-lib
 
index a6f8221ae79f6955d1514e167459fcb5af1ff940..d93be73b870bf062dedbaa3847de8899d04a9efc 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.58 2008/03/21 16:10:23 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.59 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -16,7 +16,6 @@ include $(top_builddir)/src/Makefile.global
 NAME= ecpg
 SO_MAJOR_VERSION= 6
 SO_MINOR_VERSION= 1
-DLTYPE= library
 
 override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
        -I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
@@ -63,8 +62,7 @@ $(top_builddir)/src/port/pg_config_paths.h:
 
 install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+installdirs: installdirs-lib
 
 uninstall: uninstall-lib
 
index 1397167bde11b0fa81efe16bf282d12485e6127e..c255c013c18815027a3a3e31d3b2a9160615fff8 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.41 2008/02/26 06:41:24 petere Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.42 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -16,7 +16,6 @@ include $(top_builddir)/src/Makefile.global
 NAME= pgtypes
 SO_MAJOR_VERSION= 3
 SO_MINOR_VERSION= 1
-DLTYPE= library
 
 override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
        -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS)
@@ -48,8 +47,7 @@ pgstrcasecmp.c rint.c snprintf.c: % : $(top_srcdir)/src/port/%
 
 install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(libdir)'
+installdirs: installdirs-lib
 
 uninstall: uninstall-lib
 
index 63a4a1827e11817d7d2312e44c075272514b8086..fced907efacb69dc7676e553f60c6217ee23ce7d 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.164 2008/03/05 05:39:11 tgl Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.165 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -18,7 +18,6 @@ include $(top_builddir)/src/Makefile.global
 NAME= pq
 SO_MAJOR_VERSION= 5
 SO_MINOR_VERSION= 2
-DLTYPE= library
 
 override CPPFLAGS :=  -DFRONTEND -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port
 ifneq ($(PORTNAME), win32)
@@ -111,8 +110,8 @@ install: all installdirs install-lib
        $(INSTALL_DATA) $(srcdir)/pqexpbuffer.h '$(DESTDIR)$(includedir_internal)'
        $(INSTALL_DATA) $(srcdir)/pg_service.conf.sample '$(DESTDIR)$(datadir)/pg_service.conf.sample'
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(libdir)' '$(DESTDIR)$(includedir)' '$(DESTDIR)$(includedir_internal)'
+installdirs: installdirs-lib
+       $(mkinstalldirs) '$(DESTDIR)$(includedir)' '$(DESTDIR)$(includedir_internal)'
 
 uninstall: uninstall-lib
        rm -f '$(DESTDIR)$(includedir)/libpq-fe.h' '$(DESTDIR)$(includedir_internal)/libpq-int.h' '$(DESTDIR)$(includedir_internal)/pqexpbuffer.h' '$(DESTDIR)$(datadir)/pg_service.conf.sample'
index 67eef5dd7147d99d45cf7214d6b58a112009fc2e..71bc7dce548391abbe8dd49d6b82728b6c56e3f9 100644 (file)
@@ -1,6 +1,6 @@
 # PGXS: PostgreSQL extensions makefile
 
-# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.11 2007/10/16 15:59:59 tgl Exp $ 
+# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.12 2008/04/07 14:15:58 petere Exp $ 
 
 # This file contains generic rules to build many kinds of simple
 # extension modules.  You only need to set a few variables and include
@@ -80,10 +80,6 @@ all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULE
 ifdef MODULE_big
 # shared library parameters
 NAME = $(MODULE_big)
-SO_MAJOR_VERSION= 0
-SO_MINOR_VERSION= 0
-
-SHLIB_LINK += $(BE_DLLLIBS)
 
 include $(top_srcdir)/src/Makefile.shlib
 
@@ -121,9 +117,6 @@ endif # DOCS
 ifdef PROGRAM
        $(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
 endif # PROGRAM
-ifdef MODULE_big
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(MODULE_big)$(DLSUFFIX)'
-endif # MODULE_big
 ifdef SCRIPTS
        @for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \
          echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
@@ -137,6 +130,10 @@ ifdef SCRIPTS_built
        done
 endif # SCRIPTS_built
 
+ifdef MODULE_big
+install: install-lib
+endif # MODULE_big
+
 
 installdirs:
 ifneq (,$(DATA)$(DATA_built))
@@ -145,7 +142,7 @@ endif
 ifneq (,$(DATA_TSEARCH))
        $(mkinstalldirs) '$(DESTDIR)$(datadir)/tsearch_data'
 endif
-ifneq (,$(MODULES)$(MODULE_big))
+ifneq (,$(MODULES))
        $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
 endif
 ifdef DOCS
@@ -157,6 +154,10 @@ ifneq (,$(PROGRAM)$(SCRIPTS)$(SCRIPTS_built))
        $(mkinstalldirs) '$(DESTDIR)$(bindir)'
 endif
 
+ifdef MODULE_big
+installdirs: installdirs-lib
+endif # MODULE_big
+
 
 uninstall:
 ifneq (,$(DATA)$(DATA_built))
@@ -174,9 +175,6 @@ endif
 ifdef PROGRAM
        rm -f '$(DESTDIR)$(bindir)/$(PROGRAM)$(X)'
 endif
-ifdef MODULE_big
-       rm -f '$(DESTDIR)$(pkglibdir)/$(MODULE_big)$(DLSUFFIX)'
-endif
 ifdef SCRIPTS
        rm -f $(addprefix '$(DESTDIR)$(bindir)'/, $(SCRIPTS))
 endif
@@ -184,6 +182,10 @@ ifdef SCRIPTS_built
        rm -f $(addprefix '$(DESTDIR)$(bindir)'/, $(SCRIPTS_built))
 endif
 
+ifdef MODULE_big
+uninstall: uninstall-lib
+endif # MODULE_big
+
 
 clean:
 ifdef MODULES
index fbebe77b7355762123a1e538fd0d3368c15136e6..314b3b64c2f87676da43eb672e81aeb483108efc 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile for PL/Perl
-# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.33 2007/12/01 15:30:09 adunstan Exp $
+# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.34 2008/04/07 14:15:58 petere Exp $
 
 subdir = src/pl/plperl
 top_builddir = ../../..
@@ -32,12 +32,10 @@ rpathdir = $(perl_archlibexp)/CORE
 
 
 NAME = plperl
-SO_MAJOR_VERSION = 0
-SO_MINOR_VERSION = 0
 
 OBJS = plperl.o spi_internal.o SPI.o
 
-SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
+SHLIB_LINK = $(perl_embed_ldflags)
 
 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
 REGRESS = plperl plperl_trigger plperl_shared plperl_elog
@@ -73,20 +71,11 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
 
 endif
 
-install: all installdirs
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
-else
-       @echo "*****"; \
-        echo "* PL/Perl was not installed due to lack of shared library support."; \
-        echo "*****"
-endif
+install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+installdirs: installdirs-lib
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
+uninstall: uninstall-lib
 
 installcheck: submake
        $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
index d6454a239b39e4ccedbc52995ff3f24d0ec82e0e..e3c4f7b8135912fb69ba47c603b4c0813aa26653 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Makefile for the plpgsql shared object
 #
-# $PostgreSQL: pgsql/src/pl/plpgsql/src/Makefile,v 1.31 2007/07/15 22:18:24 tgl Exp $
+# $PostgreSQL: pgsql/src/pl/plpgsql/src/Makefile,v 1.32 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -12,11 +12,9 @@ include $(top_builddir)/src/Makefile.global
 
 # Shared library parameters
 NAME= plpgsql
-SO_MAJOR_VERSION= 1
-SO_MINOR_VERSION= 0
 
 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
-SHLIB_LINK = $(filter -lintl, $(LIBS)) $(BE_DLLLIBS)
+SHLIB_LINK = $(filter -lintl, $(LIBS))
 rpath =
 
 OBJS = pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
@@ -27,26 +25,12 @@ all: all-lib
 include $(top_srcdir)/src/Makefile.shlib
 
 
-# In order to use Makefile.shlib, we allow it to build a static
-# library 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: installdirs all install-lib
 
-install: installdirs all
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX)'
-else
-       @echo "*****"; \
-        echo "* PL/pgSQL was not installed due to lack of shared library support."; \
-        echo "*****"
-endif
+installdirs: installdirs-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+uninstall: uninstall-lib
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX)'
 
 # Force these dependencies to be known even without dependency info built:
 pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
index 0b52c3d238c69894ac55c89cd5bf8de3868bb12d..295a60e6884884277fbe1969f024624107f6e659 100644 (file)
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.28 2007/02/10 04:26:24 tgl Exp $
+# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.29 2008/04/07 14:15:58 petere Exp $
 
 subdir = src/pl/plpython
 top_builddir = ../../..
@@ -37,8 +37,6 @@ override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
 rpathdir = $(python_libdir)
 
 NAME = plpython
-SO_MAJOR_VERSION = 0
-SO_MINOR_VERSION = 0
 OBJS = plpython.o
 
 
@@ -56,7 +54,7 @@ python${pytverstr}.def: $(WD)/system32/python${pytverstr}.dll
 endif
 
 
-SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)
+SHLIB_LINK = $(python_libspec) $(python_additional_libs)
 
 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonu
 REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
@@ -89,20 +87,11 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
 
 endif
 
-install: all installdirs
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)'
-else
-       @echo "*****"; \
-        echo "* PL/Python was not installed due to lack of shared library support."; \
-        echo "*****"
-endif
+install: all installdirs install-lib
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+installdirs: installdirs-lib
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)'
+uninstall: uninstall-lib
 
 installcheck: submake
        $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
index 6fc6cc272ffa8c26dbe9465dddb5c654adb1a15a..84a103655fff54f9a85903b60d614e12979f732c 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Makefile for the pltcl shared object
 #
-# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.50 2006/07/21 00:24:04 tgl Exp $
+# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.51 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -29,15 +29,12 @@ endif
 endif
 
 
+SHLIB_LINK = $(TCL_LIB_SPEC)
 ifneq ($(PORTNAME), win32)
-SHLIB_LINK = $(BE_DLLLIBS) $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
-else
-SHLIB_LINK = $(TCL_LIB_SPEC) $(BE_DLLLIBS)
+SHLIB_LINK += $(TCL_LIBS) -lc
 endif
 
 NAME = pltcl
-SO_MAJOR_VERSION = 2
-SO_MINOR_VERSION = 0
 OBJS = pltcl.o
 
 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=pltcl
@@ -73,22 +70,13 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
 
 endif
 
-install: all installdirs
-ifeq ($(enable_shared), yes)
-       $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
-else
-       @echo "*****"; \
-        echo "* PL/Tcl was not installed due to lack of shared library support."; \
-        echo "*****"
-endif
+install: all installdirs install-lib
        $(MAKE) -C modules $@
 
-installdirs:
-       $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
+installdirs: installdirs-lib
        $(MAKE) -C modules $@
 
-uninstall:
-       rm -f '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
+uninstall: uninstall-lib
        $(MAKE) -C modules $@
 
 installcheck: submake
index 3920e3da21039a7e402b8c24fe326f3f82fa3ff4..f8eb07e8b7adc7a427128f0b448052b0f80a80ef 100644 (file)
@@ -6,7 +6,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.72 2008/03/18 16:24:50 petere Exp $
+# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.73 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -77,18 +77,11 @@ uninstall:
 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
 
 NAME = regress
-SO_MAJOR_VERSION= 0
-SO_MINOR_VERSION= 0
 OBJS = regress.o
-SHLIB_LINK = $(BE_DLLLIBS)
 
 include $(top_srcdir)/src/Makefile.shlib
 
-all: $(NAME)$(DLSUFFIX)
-
-$(NAME)$(DLSUFFIX): $(shlib)
-       rm -f $(NAME)$(DLSUFFIX)
-       $(LN_S) $(shlib) $(NAME)$(DLSUFFIX)
+all: all-lib
 
 # Test input and expected files.  These are created by pg_regress itself, so we
 # don't have a rule to create them.  We do need rules to clean them however.
@@ -169,7 +162,7 @@ bigcheck: all
 
 clean distclean maintainer-clean: clean-lib
 # things built by `all' target
-       rm -f $(NAME)$(DLSUFFIX) $(OBJS)
+       rm -f $(OBJS)
        $(MAKE) -C $(contribdir)/spi clean
        rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X)
 # things created by various check targets
index 19647df6929f5342a0e63b41203e0befd2b7355a..cbd721103ca8c283c53d7349b5514e5967ce6827 100644 (file)
@@ -9,15 +9,13 @@
 # to build using the surrounding source tree.
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.20 2007/06/26 22:05:04 tgl Exp $
+#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.21 2008/04/07 14:15:58 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 MODULES = complex funcs
 DATA_built = advanced.sql basics.sql complex.sql funcs.sql syscat.sql
 
-SHLIB_LINK = $(BE_DLLLIBS)
-
 ifdef NO_PGXS
 subdir = src/tutorial
 top_builddir = ../..