summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure45
-rw-r--r--configure.in16
-rw-r--r--doc/src/sgml/installation.sgml14
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/storage/s_lock.h8
5 files changed, 80 insertions, 6 deletions
diff --git a/configure b/configure
index 9d729d91cc4..02c38e4c509 100755
--- a/configure
+++ b/configure
@@ -869,6 +869,7 @@ Optional Packages:
--with-rendezvous build with Rendezvous support
--with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]
--without-readline do not use Readline
+ --without-spinlocks do not use Spinlocks
--without-zlib do not use Zlib
--with-gnu-ld assume the C compiler uses GNU ld default=no
@@ -3494,6 +3495,36 @@ fi;
#
+# Spinlocks
+#
+
+
+
+# Check whether --with-spinlocks or --without-spinlocks was given.
+if test "${with_spinlocks+set}" = set; then
+ withval="$with_spinlocks"
+
+ case $withval in
+ yes)
+ :
+ ;;
+ no)
+ :
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: no argument expected for --with-spinlocks option" >&5
+echo "$as_me: error: no argument expected for --with-spinlocks option" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+else
+ with_spinlocks=yes
+
+fi;
+
+
+#
# Zlib
#
@@ -3523,7 +3554,6 @@ else
fi;
-
#
# Elf
#
@@ -6062,6 +6092,19 @@ fi
fi
+if test "$with_spinlocks" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SPINLOCKS 1
+_ACEOF
+
+else
+ { echo "$as_me:$LINENO: WARNING:
+*** Not using spinlocks will cause poor performance." >&5
+echo "$as_me: WARNING:
+*** Not using spinlocks will cause poor performance." >&2;}
+fi
+
if test "$with_krb4" = yes ; then
echo "$as_me:$LINENO: checking for des_encrypt in -ldes" >&5
diff --git a/configure.in b/configure.in
index 58db85abd0c..62c14eeb286 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.286 2003/09/07 16:38:05 momjian Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.287 2003/09/12 16:10:26 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -522,12 +522,17 @@ PGAC_ARG_BOOL(with, readline, yes,
[ --without-readline do not use Readline])
#
+# Spinlocks
+#
+PGAC_ARG_BOOL(with, spinlocks, yes,
+ [ --without-spinlocks do not use Spinlocks])
+
+#
# Zlib
#
PGAC_ARG_BOOL(with, zlib, yes,
[ --without-zlib do not use Zlib])
-
#
# Elf
#
@@ -678,6 +683,13 @@ failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.])])
fi
+if test "$with_spinlocks" = yes; then
+ AC_DEFINE(HAVE_SPINLOCKS, 1, [Define to 1 if you have spinlocks.])
+else
+ AC_MSG_WARN([
+*** Not using spinlocks will cause poor performance.])
+fi
+
if test "$with_krb4" = yes ; then
AC_CHECK_LIB(des, des_encrypt, [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])])
AC_CHECK_LIB(krb, krb_sendauth, [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])])
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 02a77afcb6b..4a298251b7a 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.141 2003/09/11 21:42:20 momjian Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.142 2003/09/12 16:10:26 momjian Exp $ -->
<chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -900,6 +900,18 @@ JAVACMD=$JAVA_HOME/bin/java
</varlistentry>
<varlistentry>
+ <term><option>--without-spinlocks</option></term>
+ <listitem>
+ <para>
+ Allows source builds to succeed without CPU spinlock support.
+ Lack of spinlock support will produce poor performance.
+ This option is to be used only by platforms without
+ spinlock support.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--enable-thread-safety</option></term>
<listitem>
<para>
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 03874772cd0..8c04b8e6b47 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -357,6 +357,9 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
+/* Define to 1 if you have spinlocks. */
+#undef HAVE_SPINLOCKS
+
/* Define to 1 if you have the `srandom' function. */
#undef HAVE_SRANDOM
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 82795180439..4d49c52c711 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -63,7 +63,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: s_lock.h,v 1.112 2003/08/04 02:40:15 momjian Exp $
+ * $Id: s_lock.h,v 1.113 2003/09/12 16:10:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -537,7 +537,11 @@ extern slock_t wc_tas(volatile slock_t *lock);
-#else /* !HAS_TEST_AND_SET */
+#else /* HAS_TEST_AND_SET */
+
+#ifdef HAVE_SPINLOCKS
+#error This platform does not support native spinlocks. To continue the compile, rerun configure using --without-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org.
+#endif
/*
* Fake spinlock implementation using semaphores --- slow and prone