Index: contrib/cube/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/cube/Makefile,v
retrieving revision 1.12
diff -c -r1.12 Makefile
*** contrib/cube/Makefile	20 Aug 2004 20:13:02 -0000	1.12
--- contrib/cube/Makefile	20 Jul 2005 22:36:52 -0000
***************
*** 9,14 ****
--- 9,16 ----
  
  EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
  
+ SHLIB_LINK += $(filter -lm, $(LIBS))
+ 
  
  ifdef USE_PGXS
  PGXS = $(shell pg_config --pgxs)
Index: contrib/earthdistance/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/earthdistance/Makefile,v
retrieving revision 1.14
diff -c -r1.14 Makefile
*** contrib/earthdistance/Makefile	20 Aug 2004 20:13:03 -0000	1.14
--- contrib/earthdistance/Makefile	20 Jul 2005 22:36:52 -0000
***************
*** 5,10 ****
--- 5,12 ----
  DOCS = README.earthdistance
  REGRESS = earthdistance
  
+ SHLIB_LINK += $(filter -lm, $(LIBS))
+ 
  ifdef USE_PGXS
  PGXS = $(shell pg_config --pgxs)
  include $(PGXS)
Index: contrib/ltree/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/ltree/Makefile,v
retrieving revision 1.3
diff -c -r1.3 Makefile
*** contrib/ltree/Makefile	20 Aug 2004 20:13:05 -0000	1.3
--- contrib/ltree/Makefile	20 Jul 2005 22:36:53 -0000
***************
*** 6,11 ****
--- 6,13 ----
  DOCS = README.ltree
  REGRESS = ltree
  
+ SHLIB_LINK += $(filter -lpgport, $(LIBS))
+ 
  ifdef USE_PGXS
  PGXS = $(shell pg_config --pgxs)
  include $(PGXS)
Index: contrib/pgcrypto/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pgcrypto/Makefile,v
retrieving revision 1.21
diff -c -r1.21 Makefile
*** contrib/pgcrypto/Makefile	10 Jul 2005 18:32:55 -0000	1.21
--- contrib/pgcrypto/Makefile	20 Jul 2005 22:36:53 -0000
***************
*** 56,62 ****
  # Add libraries that pgcrypto depends (or might depend) on into the
  # shared library link.  (The order in which you list them here doesn't
  # matter.)
! SHLIB_LINK += $(filter -lcrypt -ldes -lcrypto -lssl -lz, $(LIBS))
  ifeq ($(PORTNAME), win32)
  SHLIB_LINK += $(filter -leay32 -lssleay32 -lz, $(LIBS))
  endif
--- 56,62 ----
  # Add libraries that pgcrypto depends (or might depend) on into the
  # shared library link.  (The order in which you list them here doesn't
  # matter.)
! SHLIB_LINK += $(filter -lpgport -lcrypt -ldes -lcrypto -lssl -lz, $(LIBS))
  ifeq ($(PORTNAME), win32)
  SHLIB_LINK += $(filter -leay32 -lssleay32 -lz, $(LIBS))
  endif
Index: contrib/tablefunc/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tablefunc/Makefile,v
retrieving revision 1.3
diff -c -r1.3 Makefile
*** contrib/tablefunc/Makefile	20 Aug 2004 20:13:08 -0000	1.3
--- contrib/tablefunc/Makefile	20 Jul 2005 22:36:53 -0000
***************
*** 3,8 ****
--- 3,10 ----
  DOCS = README.tablefunc
  REGRESS = tablefunc
  
+ SHLIB_LINK += $(filter -lm, $(LIBS))
+ 
  ifdef USE_PGXS
  PGXS = $(shell pg_config --pgxs)
  include $(PGXS)
Index: contrib/tsearch2/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch2/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** contrib/tsearch2/Makefile	17 Oct 2004 23:09:31 -0000	1.8
--- contrib/tsearch2/Makefile	20 Jul 2005 22:36:53 -0000
***************
*** 19,25 ****
  DOCS = README.tsearch2
  REGRESS = tsearch2
  
! SHLIB_LINK := -lm
  
  
  ifdef USE_PGXS
--- 19,25 ----
  DOCS = README.tsearch2
  REGRESS = tsearch2
  
! SHLIB_LINK += $(filter -lm -lpgport, $(LIBS))
  
  
  ifdef USE_PGXS
Index: src/makefiles/Makefile.aix
===================================================================
RCS file: /projects/cvsroot/pgsql/src/makefiles/Makefile.aix,v
retrieving revision 1.21
diff -c -r1.21 Makefile.aix
*** src/makefiles/Makefile.aix	9 Oct 2002 16:21:54 -0000	1.21
--- src/makefiles/Makefile.aix	20 Jul 2005 22:36:54 -0000
***************
*** 28,33 ****
  
  %$(DLSUFFIX): %.o %$(EXPSUFF)
  	@echo Making shared library $@ from $*.o, $*$(EXPSUFF) and postgres.imp
! 	$(CC) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) $(LIBS)
  
  sqlmansect = 7
--- 28,33 ----
  
  %$(DLSUFFIX): %.o %$(EXPSUFF)
  	@echo Making shared library $@ from $*.o, $*$(EXPSUFF) and postgres.imp
! 	$(CC) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) $(SHLIB_LINK)
  
  sqlmansect = 7
