Fred Yankowski <fred@ontosys.com> writes:
> I don't understand the several uses of DLLLIBS as well as I'd like,
> but here's what I think is going on.
> In makefiles/Makefile.win, DLLLIBS lists the libraries needed to build
> the various DLLs associated with the interfaces/* and pl/plpgsql
> directories. As such it includes '-L$(top_builddir)/src/backend -lpostgres'
> as well as several Cygwin utility libraries.
Hmm. It seems a little bit weird (no, a lot weird) to be referencing
-lpostgres for the client-side interface library builds. I can see that
the PL-language DLLs might need to reference -lpostgres during their
links, but I've got severe doubts that this is a good idea anyplace
else.
My thought is that Makefile.win ought to have
DLLLIBS=-lcygipc -lcygwin -lcrypt -lkernel32
which is what will be used by Makefile.shlib to build the interfaces
libraries. Then in the makefiles for the PL directories we should write
DLLLIBS:= -L$(top_builddir)/src/backend -lpostgres $(DLLLIBS)
so that -lpostgres is added just for the links of those shlibs. And
finally backend/Makefile could use the Makefile.win definition as-is.
Comments? If this seems plausible, could you test it?
BTW, I see that the prior version of backend/Makefile actually defined
DLLLIBS as
DLLLIBS := -L/usr/local/lib -lcygipc -lcrypt -lcygwin -lkernel32
as compared to what Makefile.win offers (shorn of the backend):
DLLLIBS=-lcygipc -lcygwin -lcrypt -lkernel32
Any comments on whether -L/usr/local/lib is appropriate here or not?
What about the ordering of these libraries, does that matter?
regards, tom lane