mirror of
https://github.com/postgres/postgres.git
synced 2026-06-02 22:08:41 -04:00
02566f14f4
> Can someone research this and figure out what the proper solution for
> this is? Seems we are going around in circles if we keep
> adding/removing DLLIMPORT.
I believe that the attached patch is the correct solution -- I apologize
for the gyrations. With the attached patch, Cygwin libpq++ builds
cleanly again. The root cause was that DLLIMPORT was defaulting to
__declspec(dllimport) since BUILDING_DLL was *not* defined when building
the libpq++ DLL.
Unfortunately, to test my patch requires changing the following makefile:
src/interfaces/libpq++/examples/Makefile
and the #includes in all of the *.cc to build against the source tree
instead of the following hardcoded installation directory structure:
/usr/local/pgsql
I was able to manually build
src/interfaces/libpq++/examples/testlibpq0.exe
against my Cygwin libpq++ without errors. However, I have not tried to
actually test testlibpq0.exe.
Is this sufficient? Or, do you want me to clean up libpq++/examples too?
(Or, is it silly to even ask? :,)) Let me know how you want to proceed and
I will submit a patch to pgsql-patches.
Jason Tishler
42 lines
1.1 KiB
Makefile
42 lines
1.1 KiB
Makefile
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.15 2001/09/06 02:58:33 momjian Exp $
|
|
LDFLAGS+= -g
|
|
DLLTOOL= dlltool
|
|
DLLWRAP= dllwrap
|
|
DLLLIBS= -lcygipc -lcrypt
|
|
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
|
|
MK_NO_LORDER=true
|
|
MAKE_DLL=true
|
|
#MAKE_DLL=false
|
|
# linking with -lm or -lc causes program to crash
|
|
# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
|
|
LIBS:=$(filter-out -lm -lc, $(LIBS))
|
|
|
|
AROPT = crs
|
|
DLSUFFIX = .dll
|
|
CFLAGS_SL =
|
|
|
|
%.dll: %.o
|
|
$(DLLTOOL) --export-all --output-def $*.def $<
|
|
$(DLLWRAP) -o $@ --def $*.def $< $(top_builddir)/src/utils/dllinit.o $(DLLLIBS)
|
|
rm -f $*.def
|
|
|
|
ifeq ($(findstring backend,$(subdir)), backend)
|
|
override CPPFLAGS+= -DBUILDING_DLL=1
|
|
endif
|
|
|
|
ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib)
|
|
override CPPFLAGS+= -DBUILDING_DLL=1
|
|
endif
|
|
|
|
ifeq ($(findstring interfaces/libpq++,$(subdir)), interfaces/libpq++)
|
|
override CPPFLAGS+= -DBUILDING_DLL=1
|
|
endif
|
|
|
|
ifeq ($(findstring src/pl/plpython,$(subdir)), src/pl/plpython)
|
|
override CPPFLAGS+= -DUSE_DL_IMPORT
|
|
endif
|
|
|
|
override javadir := '$(shell cygpath -w $(javadir))'
|
|
|
|
sqlmansect = 7
|