]> granicus.if.org Git - postgresql/blob - src/makefiles/Makefile.cygwin
Second try: walreceiver should not be built with -DBUILDING_DLL
[postgresql] / src / makefiles / Makefile.cygwin
1 # $PostgreSQL: pgsql/src/makefiles/Makefile.cygwin,v 1.12 2010/01/15 21:43:21 tgl Exp $
2 DLLTOOL= dlltool
3 DLLWRAP= dllwrap
4 ifdef PGXS
5 BE_DLLLIBS= -L$(libdir) -lpostgres
6 else
7 BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
8 endif
9
10 # linking with -lm or -lc causes program to crash
11 # (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
12 LIBS:=$(filter-out -lm -lc, $(LIBS))
13
14 AROPT = crs
15 DLSUFFIX = .dll
16 CFLAGS_SL =
17
18 %.dll: %.o
19         $(DLLTOOL) --export-all --output-def $*.def $<
20         $(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
21         rm -f $*.def
22
23 ifneq (,$(findstring backend,$(subdir)))
24 ifeq (,$(findstring conversion_procs,$(subdir)))
25 ifeq (,$(findstring snowball,$(subdir)))
26 ifeq (,$(findstring walreceiver,$(subdir)))
27 override CPPFLAGS+= -DBUILDING_DLL
28 endif
29 endif
30 endif
31 endif
32
33 ifneq (,$(findstring timezone,$(subdir)))
34 override CPPFLAGS+= -DBUILDING_DLL
35 endif
36
37 ifneq (,$(findstring ecpg/ecpglib,$(subdir)))
38 override CPPFLAGS+= -DBUILDING_DLL
39 endif
40
41 # required by Python headers
42 ifneq (,$(findstring src/pl/plpython,$(subdir)))
43 override CPPFLAGS+= -DUSE_DL_IMPORT
44 endif