Peter Eisentraut schrieb:
Reini Urban wrote:
I think that LDFLAGS overriding is in some situations bad for newer
libtool, as it is used with some postgresql contrib makefiles and
interfaces.

We're not using libtool.

sorry. it conflicts with gnu ld.

LIBS are added to LDFLAGS where they really should be added to
LIBS, not LDFLAGS.
This causes incorrect order in the linker command-line, which fails
in building shared libs. A similar problem as with building php.


Please point out where that happens so it can be corrected.

Something like this (against an older cvs snap), but I don't believe that this is the best way to solve it. It just solved building under cygwin.


(sorry for the linewrap's)

--- postgresql-8.0.0cvs/src/Makefile.shlib.orig 2004-07-13 01:06:46.000000000 +0100
+++ postgresql-8.0.0cvs/src/Makefile.shlib 2004-09-03 14:44:14.436032500 +0100
@@ -212,6 +212,7 @@


 ifeq ($(PORTNAME), cygwin)
   shlib                        = $(NAME)$(DLSUFFIX)
+  SHLIB_LINK           += $(LDFLAGS)
 endif

ifeq ($(PORTNAME), win32)
@@ -224,9 +225,13 @@
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
endif


-SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
+ifeq ($(PORTNAME), cygwin)
+  SHLIB_LINK := $(LDFLAGS) $(LIBS) $(SHLIB_LINK)
+else
+  SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
+endif
 ifeq ($(enable_rpath), yes)
-SHLIB_LINK += $(rpath)
+  SHLIB_LINK += $(rpath)
 endif

endif # enable_shared
--- postgresql-8.0.0cvs/src/makefiles/pgxs.mk.orig 2004-07-30 13:26:40.000000000 +0100
+++ postgresql-8.0.0cvs/src/makefiles/pgxs.mk 2004-09-03 14:53:00.569922900 +0100
@@ -63,7 +63,11 @@


 ifdef MODULES
 override CFLAGS += $(CFLAGS_SL)
-SHLIB_LINK += $(BE_DLLLIBS)
+ifeq ($(PORTNAME), cygwin)
+  SHLIB_LINK += $(BE_DLLLIBS) $(LDFLAGS) $(LIBS)
+else
+  SHLIB_LINK += $(BE_DLLLIBS)
+endif
 endif

 ifdef PG_CPPFLAGS

--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to