aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2010-12-26 10:34:47 -0500
committerAndrew Dunstan <andrew@dunslane.net>2010-12-26 10:34:47 -0500
commita534728afb7341e1ddf2df16196ed501eaa378c2 (patch)
treee3bdbb141d7234bde62eb1621260fd2819e19efb /src
parent85cff3ce7f360d139d87aee836d75a6202fee066 (diff)
downloadpostgresql-a534728afb7341e1ddf2df16196ed501eaa378c2.tar.gz
postgresql-a534728afb7341e1ddf2df16196ed501eaa378c2.zip
Only build in crashdump support on Windows if there's a working dbghelp.h.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in3
-rw-r--r--src/backend/main/main.c2
-rw-r--r--src/backend/port/win32/Makefile5
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/pg_config.h.win323
5 files changed, 14 insertions, 2 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 7a61a5a1a1f..ebeee0c3b2b 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -363,6 +363,9 @@ ELF_SYSTEM= @ELF_SYS@
# Backend stack size limit has to be hard-wired on Windows (it's in bytes)
WIN32_STACK_RLIMIT=4194304
+# Set if we have a working win32 crashdump header
+have_win32_dbghelp = @have_win32_dbghelp@
+
# Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index 6065e8c661c..d3f9bcde7f0 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
* If supported on the current platform, set up a handler to be called if
* the backend/postmaster crashes with a fatal signal or exception.
*/
-#ifdef WIN32
+#if defined(WIN32) && defined(HAVE_MINIDUMP_TYPE)
pgwin32_install_crashdump_handler();
#endif
diff --git a/src/backend/port/win32/Makefile b/src/backend/port/win32/Makefile
index d00c33421e7..820a3b3753e 100644
--- a/src/backend/port/win32/Makefile
+++ b/src/backend/port/win32/Makefile
@@ -12,6 +12,9 @@ subdir = src/backend/port/win32
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = timer.o socket.o signal.o security.o mingwcompat.o crashdump.o
+OBJS = timer.o socket.o signal.o security.o mingwcompat.o
+ifeq ($(have_win32_dbghelp), yes)
+OBJS += crashdump.o
+endif
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index fd169b682fb..613ef89eb60 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -342,6 +342,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if the system has the type `MINIDUMP_TYPE'. */
+#undef HAVE_MINIDUMP_TYPE
+
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index 2a383b619aa..79b803616de 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -258,6 +258,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
+/* Define to 1 if the system has the type `MINIDUMP_TYPE'. */
+#define HAVE_MINIDUMP_TYPE 1
+
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1