]> granicus.if.org Git - postgresql/blobdiff - src/Makefile.shlib
Turn the rangetable used by the executor into a flat list, and avoid storing
[postgresql] / src / Makefile.shlib
index 132d465a8589b02f46c4ca35211e0eb6b992b6b4..4f897f4eff41a6f22ee3e73ee425d2818af9cc19 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.97 2005/08/08 03:35:13 tgl Exp $
+#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.109 2007/02/20 22:45:57 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -76,6 +76,9 @@ 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
 shlib          = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
 shlib_major    = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
@@ -93,22 +96,22 @@ override CFLAGS += $(CFLAGS_SL)
 soname = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
 
 ifeq ($(PORTNAME), aix)
-  shlib                        = lib$(NAME)$(DLSUFFIX)
-#   SHLIB_LINK         += -lc
+  shlib                        = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+  haslibarule   = yes
 endif
 
 ifeq ($(PORTNAME), darwin)
   ifneq ($(SO_MAJOR_VERSION), 0)
-    version_link       := -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    version_link       = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   endif
   ifeq ($(DLTYPE), library)
     # linkable library
-    DLSUFFIX           := .dylib
-    LINK.shared                = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
+    DLSUFFIX           = .dylib
+    LINK.shared                = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) $(exported_symbols_list) -multiply_defined suppress
   else
     # loadable module (default case)
-    DLSUFFIX           := .so
-    LINK.shared                = $(COMPILER) -bundle
+    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)
@@ -154,12 +157,12 @@ endif
 ifeq ($(PORTNAME), hpux)
   shlib                        = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
   ifeq ($(with_gnu_ld), yes)
-    LINK.shared                = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
+    LINK.shared                = $(CC) $(LDFLAGS_NO_L) -shared -Wl,-h -Wl,$(soname)
   else
     # can't use the CC-syntax rpath pattern here
     rpath =
     ifeq ($(enable_rpath), yes)
-      LINK.shared      = $(LD) +h $(soname) -b +b $(rpathdir)
+      LINK.shared      = $(LD) +h $(soname) -b +b '$(rpathdir)'
     else
       LINK.shared      = $(LD) +h $(soname) -b
     endif
@@ -183,14 +186,15 @@ ifeq ($(PORTNAME), irix)
 endif
 
 ifeq ($(PORTNAME), linux)
-  LINK.shared          = $(COMPILER) -shared -Wl,-soname,$(soname)
+  LINK.shared          = $(COMPILER) -shared -Wl,-soname,$(soname) $(exported_symbols_list)
 endif
 
 ifeq ($(PORTNAME), solaris)
   ifeq ($(GCC), yes)
-    LINK.shared                = $(CC) -shared
+    LINK.shared                = $(COMPILER) -shared # $(COMPILER) needed for -m64
   else
-    LINK.shared                = $(CC) -G
+# CFLAGS added for X86_64
+    LINK.shared                = $(CC) -G $(CFLAGS)
   endif
   ifeq ($(with_gnu_ld), yes)
     LINK.shared                += -Wl,-soname,$(soname)
@@ -243,12 +247,6 @@ ifeq ($(PORTNAME), win32)
   haslibarule   = yes
 endif
 
-ifeq ($(PORTNAME), beos)
-  shlib                        = lib$(NAME)$(DLSUFFIX)
-  LINK.shared          = $(LD) -nostart
-  SHLIB_LINK           += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
-endif
-
 ifeq ($(enable_rpath), yes)
 SHLIB_LINK += $(rpath)
 endif
@@ -269,17 +267,9 @@ all-static-lib: lib$(NAME).a
 
 all-shared-lib: $(shlib)
 
-ifndef LORDER
-MK_NO_LORDER := true
-endif
-
 ifndef haslibarule
 lib$(NAME).a: $(OBJS)
-ifdef MK_NO_LORDER
        $(LINK.static) $@ $^
-else
-       $(LINK.static) $@ `$(LORDER) $^ | tsort`
-endif
        $(RANLIB) $@
 endif #haslibarule
 
@@ -287,7 +277,6 @@ ifeq ($(enable_shared), yes)
 
 ifneq ($(PORTNAME), win32)
 ifneq ($(PORTNAME), cygwin)
-ifneq ($(PORTNAME), beos)
 ifneq ($(PORTNAME), aix)
 
 # Normal case
@@ -307,21 +296,16 @@ endif
 else # PORTNAME == aix
 
 # AIX case
-$(shlib): lib$(NAME).a
+$(shlib) lib$(NAME).a: $(OBJS)
+       $(LINK.static) lib$(NAME).a $^
+       $(RANLIB) lib$(NAME).a
        $(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
-       $(COMPILER) $(LDFLAGS_SL) -o $@ $< $(LDFLAGS) $(SHLIB_LINK) -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:lib$(NAME)$(EXPSUFF)
+       $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(shlib) lib$(NAME).a -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
+       rm -f lib$(NAME).a
+       $(AR) $(AROPT) lib$(NAME).a $(shlib)
        
 endif # PORTNAME == aix
 
-else # PORTNAME == beos
-
-# BEOS case
-$(shlib): $(OBJS)
-       ln -fs $(top_srcdir)/src/backend/postgres _APP_
-       $(CC) -Xlinker -soname=$@ $(LDFLAGS_SL) -o $@ _APP_ $(OBJS) $(SHLIB_LINK)
-
-endif # PORTNAME == beos
-
 else # PORTNAME == cygwin
 
 # Cygwin case
@@ -363,29 +347,32 @@ endif # enable_shared
 install-lib: install-lib-static install-lib-shared
 
 install-lib-static: lib$(NAME).a
-       $(INSTALL_STLIB) $< $(DESTDIR)$(libdir)/lib$(NAME).a
+       $(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).a'
 ifeq ($(PORTNAME), darwin)
-       cd $(DESTDIR)$(libdir) && \
+       cd '$(DESTDIR)$(libdir)' && \
        ranlib lib$(NAME).a
 endif
 
 ifeq ($(enable_shared), yes)
 install-lib-shared: $(shlib)
-       $(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
+# we don't install $(shlib) on AIX
+ifneq ($(PORTNAME), aix)
+       $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
 ifneq ($(PORTNAME), cygwin)
 ifneq ($(PORTNAME), win32)
 ifneq ($(shlib), $(shlib_major))
-       cd $(DESTDIR)$(libdir) && \
+       cd '$(DESTDIR)$(libdir)' && \
        rm -f $(shlib_major) && \
        $(LN_S) $(shlib) $(shlib_major)
 endif
 ifneq ($(shlib), $(shlib_bare))
-       cd $(DESTDIR)$(libdir) && \
+       cd '$(DESTDIR)$(libdir)' && \
        rm -f $(shlib_bare) && \
        $(LN_S) $(shlib) $(shlib_bare)
 endif
 endif # not win32
 endif # not cygwin
+endif # not aix
 endif # enable_shared
 
 
@@ -395,11 +382,11 @@ endif # enable_shared
 
 .PHONY: uninstall-lib
 uninstall-lib:
-       rm -f $(DESTDIR)$(libdir)/lib$(NAME).a
+       rm -f '$(DESTDIR)$(libdir)/lib$(NAME).a'
 ifeq ($(enable_shared), yes)
-       rm -f $(DESTDIR)$(libdir)/$(shlib_bare) \
-         $(DESTDIR)$(libdir)/$(shlib_major) \
-         $(DESTDIR)$(libdir)/$(shlib)
+       rm -f '$(DESTDIR)$(libdir)/$(shlib_bare)' \
+         '$(DESTDIR)$(libdir)/$(shlib_major)' \
+         '$(DESTDIR)$(libdir)/$(shlib)'
 endif # enable_shared