From 98bf00442183f3487548bf71ac9dc39b8ef18df1 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 4 Aug 2003 21:26:26 +0000
Subject: [PATCH] Re-add USE_THREADS, used by ecpg.

---
 configure                  | 6 +++++-
 configure.in               | 5 +++--
 src/include/pg_config.h.in | 4 ++++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 7f8038c323d..5a9f23717af 100755
--- a/configure
+++ b/configure
@@ -2785,7 +2785,11 @@ if test "${enable_thread_safety+set}" = set; then
 
   case $enableval in
     yes)
-      :
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_THREADS 1
+_ACEOF
+
       ;;
     no)
       :
diff --git a/configure.in b/configure.in
index 1d4430d724d..b60332d7402 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.275 2003/08/04 16:48:03 momjian Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.276 2003/08/04 21:26:26 momjian Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -314,7 +314,8 @@ IFS=$ac_save_IFS
 # Enable libpq to be thread-safety
 #
 AC_MSG_CHECKING([allow thread-safe libpq and ecpg])
-PGAC_ARG_BOOL(enable, thread-safety, no, [  --enable-thread-safety allow libpq and ecpg to be thread-safe])
+PGAC_ARG_BOOL(enable, thread-safety, no, [  --enable-thread-safety allow libpq and ecpg to be thread-safe],
+              [AC_DEFINE([USE_THREADS], 1, [Define to 1 to build libpq and ecpg to be thread-safe. (--enable-thread-safety)])])
 AC_MSG_RESULT([$enable_thread_safety])
 AC_SUBST(enable_thread_safety)
 
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 2c2e2f4225d..e89cdb8730a 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -600,6 +600,10 @@
 /* Define to select SysV-style shared memory. */
 #undef USE_SYSV_SHARED_MEMORY
 
+/* Define to 1 to build libpq and ecpg to be thread-safe.
+   (--enable-thread-safety) */
+#undef USE_THREADS
+
 /* Define to select unnamed POSIX semaphores. */
 #undef USE_UNNAMED_POSIX_SEMAPHORES
 
-- 
GitLab